lwip: not using private function anymore

This commit is contained in:
Ulrich Mohr 2023-10-06 21:30:40 +02:00
parent 1eb406074c
commit 73970d76d0

View File

@ -44,8 +44,6 @@ static void tftp_error(void *handle, int err, const char *msg, int size) {}
static const struct tftp_context tftp = {tftp_open, tftp_close, tftp_read,
tftp_write, tftp_error};
void myInitDone(void *arg) { puts("init done"); }
struct netif netif;
@ -84,22 +82,31 @@ void handleUARTInt(void *) {
}
void forwardPackets(void *) {
uint8_t byte;
BaseType_t result;
while (1) {
result = xQueueReceive(uartIsrQueue, &byte, portMAX_DELAY);
if (result == pdTRUE) {
slipif_rxbyte_input(&netif, byte);
}
// slipif_rxbyte_input() is private, so we use slipif_poll and implement
// sio_tryread()
slipif_poll(&netif);
}
}
// TODO define sio_fd_t to an int
uint32_t sio_data;
sio_fd_t sio_open(u8_t devnum) { return &sio_data; }
void sio_send(u8_t c, sio_fd_t fd) { XUartPs_SendByte(STDOUT_BASEADDRESS, c); }
u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len) {
BaseType_t result;
result = xQueueReceive(uartIsrQueue, data, portMAX_DELAY);
if (result == pdTRUE) {
return 1;
} else {
return 0;
}
}
} // extern "C"
void testIp() {