Rename mip_rxcb to mip_qwrite, add mip_qread and enforce rx() for drivers

This commit is contained in:
Sergio R. Caprile committed 2023-01-03 19:33:26 -03:00
1 parent 042465387f
commit b259bdeddd
10 files changed
+59 -34

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ static void blink_cb(void *arg) { // Blink periodically
}
bool tud_network_recv_cb(const uint8_t *buf, uint16_t len) {
mip_rxcb((void *) buf, len, s_ifp);
mip_qwrite((void *) buf, len, s_ifp);
// MG_INFO(("RECV %hu", len));
// mg_hexdump(buf, len);
tud_network_recv_renew();
@@ -55,7 +55,7 @@ int main(void) {
mg_mgr_init(&mgr); // and attach it to the MIP interface
mg_timer_add(&mgr, 500, MG_TIMER_REPEAT, blink_cb, &mgr);
struct mip_driver driver = {.tx = usb_tx, .up = usb_up};
struct mip_driver driver = {.tx = usb_tx, .rx = mip_driver_rx, .up = usb_up};
struct mip_if mif = {.mac = {2, 0, 1, 2, 3, 0x77},
.ip = mg_htonl(MG_U32(192, 168, 3, 1)),
.mask = mg_htonl(MG_U32(255, 255, 255, 0)),
@@ -25,7 +25,7 @@ void SysTick_Handler(void) { // SyStick IRQ handler, triggered every 1ms
}
bool tud_network_recv_cb(const uint8_t *buf, uint16_t len) {
mip_rxcb((void *) buf, len, s_ifp);
mip_qwrite((void *) buf, len, s_ifp);
// MG_INFO(("RECV %hu", len));
// mg_hexdump(buf, len);
tud_network_recv_renew();
@@ -84,7 +84,7 @@ int main(void) {
mg_timer_add(&mgr, 500, MG_TIMER_REPEAT, blink_cb, &mgr);
MG_INFO(("Init TCP/IP stack ..."));
struct mip_driver driver = {.tx = usb_tx, .up = usb_up};
struct mip_driver driver = {.tx = usb_tx, .rx = mip_driver_rx, .up = usb_up};
struct mip_if mif = {.mac = {2, 0, 1, 2, 3, 0x77},
.ip = mg_htonl(MG_U32(192, 168, 3, 1)),
.mask = mg_htonl(MG_U32(255, 255, 255, 0)),
@@ -25,7 +25,7 @@ void SysTick_Handler(void) { // SyStick IRQ handler, triggered every 1ms
}
bool tud_network_recv_cb(const uint8_t *buf, uint16_t len) {
mip_rxcb((void *) buf, len, s_ifp);
mip_qwrite((void *) buf, len, s_ifp);
// MG_INFO(("RECV %hu", len));
// mg_hexdump(buf, len);
tud_network_recv_renew();
@@ -84,7 +84,7 @@ int main(void) {
mg_timer_add(&mgr, 500, MG_TIMER_REPEAT, blink_cb, &mgr);
MG_INFO(("Init TCP/IP stack ..."));
struct mip_driver driver = {.tx = usb_tx, .up = usb_up};
struct mip_driver driver = {.tx = usb_tx, .rx = mip_driver_rx, .up = usb_up};
struct mip_if mif = {.mac = {2, 0, 1, 2, 3, 0x77},
.ip = mg_htonl(MG_U32(192, 168, 3, 1)),
.mask = mg_htonl(MG_U32(255, 255, 255, 0)),