Update example-fs-bb48

This commit is contained in:
NIIBE Yutaka
2016-05-24 17:34:20 +09:00
parent 2704416c38
commit 2578fc0f30
10 changed files with 395 additions and 113 deletions

View File

@@ -735,10 +735,10 @@ check_tx (struct tty *t)
}
int
tty_send (struct tty *t, uint8_t *buf, int len)
tty_send (struct tty *t, const uint8_t *buf, int len)
{
int r;
uint8_t *p;
const uint8_t *p;
int count;
p = buf;
@@ -767,6 +767,11 @@ tty_send (struct tty *t, uint8_t *buf, int len)
count = len >= 64 ? 64 : len;
}
/* Wait until all sent. */
chopstx_mutex_lock (&t->mtx);
while ((r = check_tx (t)) == 0)
chopstx_cond_wait (&t->cnd, &t->mtx);
chopstx_mutex_unlock (&t->mtx);
return r;
}