Split dispatch init/run, join IPv6 multicast discovery group in firmware
This commit is contained in:
@@ -6,15 +6,17 @@
|
||||
#include "timer_queue.h"
|
||||
#include "net.h"
|
||||
|
||||
[[noreturn]] void dispatch(std::span<const handler_entry> handlers) {
|
||||
void dispatch_init() {
|
||||
tusb_init();
|
||||
net_init();
|
||||
}
|
||||
|
||||
[[noreturn]] void dispatch_run(std::span<const handler_entry> handlers) {
|
||||
std::unordered_map<int8_t, void (*)(usb_cdc&, uint32_t)> handler_map;
|
||||
for (auto& entry : handlers) {
|
||||
handler_map[entry.type_id] = entry.handle;
|
||||
}
|
||||
|
||||
tusb_init();
|
||||
net_init();
|
||||
|
||||
static usb_cdc usb;
|
||||
static timer_queue timers;
|
||||
static static_vector<uint8_t, 256> rx_buf;
|
||||
|
||||
Reference in New Issue
Block a user