forked from ROMEO/obsw
lwip: not using private function anymore
This commit is contained in:
parent
1eb406074c
commit
73970d76d0
@ -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,
|
static const struct tftp_context tftp = {tftp_open, tftp_close, tftp_read,
|
||||||
tftp_write, tftp_error};
|
tftp_write, tftp_error};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void myInitDone(void *arg) { puts("init done"); }
|
void myInitDone(void *arg) { puts("init done"); }
|
||||||
|
|
||||||
struct netif netif;
|
struct netif netif;
|
||||||
@ -84,22 +82,31 @@ void handleUARTInt(void *) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void forwardPackets(void *) {
|
void forwardPackets(void *) {
|
||||||
uint8_t byte;
|
|
||||||
BaseType_t result;
|
|
||||||
while (1) {
|
while (1) {
|
||||||
result = xQueueReceive(uartIsrQueue, &byte, portMAX_DELAY);
|
// slipif_rxbyte_input() is private, so we use slipif_poll and implement
|
||||||
if (result == pdTRUE) {
|
// sio_tryread()
|
||||||
slipif_rxbyte_input(&netif, byte);
|
slipif_poll(&netif);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO define sio_fd_t to an int
|
||||||
uint32_t sio_data;
|
uint32_t sio_data;
|
||||||
|
|
||||||
sio_fd_t sio_open(u8_t devnum) { return &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); }
|
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"
|
} // extern "C"
|
||||||
|
|
||||||
void testIp() {
|
void testIp() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user