Reworked KFile write
This commit is contained in:
parent
50f11f6645
commit
319f18330c
15
Modem/afsk.c
15
Modem/afsk.c
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#define VERS_BUILD 117
|
||||
#define VERS_BUILD 119
|
||||
#define VERS_HOST "vixen"
|
||||
|
|
Loading…
Reference in New Issue