Reworked KFile write

This commit is contained in:
Mark Qvist 2014-04-04 08:48:34 +02:00
parent 50f11f6645
commit 319f18330c
3 changed files with 9 additions and 10 deletions

View File

@ -348,18 +348,17 @@ static size_t afsk_read(KFile *fd, void *_buf, size_t size) {
return buffer - (uint8_t *)_buf;
}
static size_t afsk_write(KFile *fd, const void *_buf, size_t size)
{
Afsk *af = AFSK_CAST(fd);
static size_t afsk_write(KFile *fd, const void *_buf, size_t size) {
Afsk *afsk = AFSK_CAST(fd);
const uint8_t *buf = (const uint8_t *)_buf;
while (size--)
{
while (fifo_isfull_locked(&af->txFifo))
while (size--) {
while (fifo_isfull_locked(&afsk->txFifo)) {
cpu_relax();
}
fifo_push_locked(&af->txFifo, *buf++);
afsk_txStart(af);
fifo_push_locked(&afsk->txFifo, *buf++);
afsk_txStart(afsk);
}
return buf - (const uint8_t *)_buf;

View File

@ -60,7 +60,7 @@ int main(void)
}
// Use AX.25 to send test data
if (timer_clock() - start > ms_to_ticks(15000L))
if (timer_clock() - start > ms_to_ticks(4000L))
{
kputs("Test TX\n");
start = timer_clock();

View File

@ -1,2 +1,2 @@
#define VERS_BUILD 117
#define VERS_BUILD 119
#define VERS_HOST "vixen"