Split dispatch init/run, join IPv6 multicast discovery group in firmware

This commit is contained in:
Ian Gulliver
2026-04-06 20:01:22 +09:00
parent 00b960d81d
commit 49bbe1b29c
6 changed files with 40 additions and 7 deletions

View File

@@ -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;