WFI with interrupt-driven wakeup for USB and W6300
This commit is contained in:
@@ -283,6 +283,10 @@ bool net_init() {
|
||||
|
||||
w6300::open_socket(raw_socket, w6300::protocol::macraw, w6300::port_num{0}, w6300::sock_flag::none);
|
||||
w6300::set_socket_io_mode(raw_socket, w6300::sock_io_mode::nonblock);
|
||||
// CHECK START
|
||||
w6300::set_socket_interrupt_mask(raw_socket, 0x04);
|
||||
w6300::set_interrupt_mask(w6300::ik_sock_0);
|
||||
// CHECK END
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -296,6 +300,7 @@ void net_set_handler(net_handler handler) {
|
||||
}
|
||||
|
||||
void net_poll() {
|
||||
w6300::clear_interrupt(w6300::ik_int_all);
|
||||
if (w6300::get_socket_recv_buf(raw_socket) == 0) return;
|
||||
static uint8_t rx_buf[1518];
|
||||
w6300::ip_address dummy_addr = {};
|
||||
|
||||
Reference in New Issue
Block a user