forked from ROMEO/obsw
TFT downlinks 50KiB
This commit is contained in:
@ -24,8 +24,11 @@ extern "C" {
|
||||
|
||||
void slipif_rxbyte_input(struct netif *netif, u8_t c);
|
||||
|
||||
uint8_t packets = 0;
|
||||
|
||||
static void *tftp_open(const char *fname, const char *mode, u8_t is_write) {
|
||||
LWIP_UNUSED_ARG(mode);
|
||||
packets = 100;
|
||||
return (void *)13;
|
||||
}
|
||||
|
||||
@ -33,7 +36,12 @@ static void tftp_close(void *handle) {}
|
||||
|
||||
static int tftp_read(void *handle, void *buf, int bytes) {
|
||||
memset(buf, 'x', bytes);
|
||||
return bytes - 60;
|
||||
if (packets == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
packets--;
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
|
||||
static int tftp_write(void *handle, struct pbuf *p) { return 0; }
|
||||
@ -89,7 +97,6 @@ void forwardPackets(void *) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO define sio_fd_t to an int
|
||||
uint32_t sio_data;
|
||||
|
||||
|
Reference in New Issue
Block a user