mirror of
https://github.com/markqvist/OpenModem.git
synced 2024-12-31 18:26:36 -05:00
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;
|
return buffer - (uint8_t *)_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t afsk_write(KFile *fd, const void *_buf, size_t size)
|
static size_t afsk_write(KFile *fd, const void *_buf, size_t size) {
|
||||||
{
|
Afsk *afsk = AFSK_CAST(fd);
|
||||||
Afsk *af = AFSK_CAST(fd);
|
|
||||||
const uint8_t *buf = (const uint8_t *)_buf;
|
const uint8_t *buf = (const uint8_t *)_buf;
|
||||||
|
|
||||||
while (size--)
|
while (size--) {
|
||||||
{
|
while (fifo_isfull_locked(&afsk->txFifo)) {
|
||||||
while (fifo_isfull_locked(&af->txFifo))
|
|
||||||
cpu_relax();
|
cpu_relax();
|
||||||
|
}
|
||||||
|
|
||||||
fifo_push_locked(&af->txFifo, *buf++);
|
fifo_push_locked(&afsk->txFifo, *buf++);
|
||||||
afsk_txStart(af);
|
afsk_txStart(afsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf - (const uint8_t *)_buf;
|
return buf - (const uint8_t *)_buf;
|
||||||
|
@ -60,7 +60,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use AX.25 to send test data
|
// 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");
|
kputs("Test TX\n");
|
||||||
start = timer_clock();
|
start = timer_clock();
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#define VERS_BUILD 117
|
#define VERS_BUILD 119
|
||||||
#define VERS_HOST "vixen"
|
#define VERS_HOST "vixen"
|
||||||
|
Loading…
Reference in New Issue
Block a user