From e64fe519d625261e7aa3c0b00266bec8f54ee2e2 Mon Sep 17 00:00:00 2001 From: Allen Hill Date: Mon, 28 Sep 2026 11:30:34 -0700 Subject: [PATCH] Add debug method to manually set controller address (e.g. for bench testing) --- src/avclan/peripheral.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/avclan/peripheral.hpp b/src/avclan/peripheral.hpp index 5f88d40..a6d2125 100644 --- a/src/avclan/peripheral.hpp +++ b/src/avclan/peripheral.hpp @@ -43,8 +43,9 @@ public: static_assert(((Devs::id != NoDevice) && ...), "a registered Device id collides with the NoDevice sentinel; " "update the sentinel value in avclan.h"); - static_assert(sizeof...(Devs) <= 0x100, - "too many devices: Notifier packs the device index into 8 bits"); + static_assert( + sizeof...(Devs) <= 0x100, + "too many devices: Notifier packs the device index into 8 bits"); static constexpr UBaseType_t EMIT_QUEUE_LEN = 2 * sizeof...(Devs); @@ -68,6 +69,7 @@ public: #ifndef NDEBUG Bus &get_bus() { return bus; } + void set_controller(uint16_t addr) { controller_ = addr; } #endif expected, Error::Read>