Observe shared TWI0 IRQ in nRF radio timing captures

This commit is contained in:
mikecarper committed 2026-10-23 04:08:05 -07:00
1 parent 1b97c089a7
commit aa480ae79e
5 files changed
+23 -12

No files matched your search

+2 -1
View File
@@ -6,7 +6,7 @@ extern "C" {
volatile Counter mesh_hil_irq_counters[SourceCount] = {};
volatile uint32_t mesh_hil_irq_selected[TaskKindCount + 2] = {};
volatile Capture mesh_hil_radio_irqs = {
0x4d434952, 1, sizeof(Capture), 0, SourceCount, 0, 0, 0, 0, 0, {}};
0x4d434952, 2, sizeof(Capture), 0, SourceCount, 0, 0, 0, 0, 0, {}};
}
std::atomic<uint32_t> revision{0};
Work work;
@@ -29,6 +29,7 @@ MESH_OBSERVE_IRQ(UARTE0_UART0_IRQHandler, Uart0)
MESH_OBSERVE_IRQ(UARTE1_IRQHandler, Uart1)
MESH_OBSERVE_IRQ(POWER_CLOCK_IRQHandler, PowerClock)
MESH_OBSERVE_IRQ(USBD_IRQHandler, Usb)
MESH_OBSERVE_IRQ(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler, Twim0Spim0)
#undef MESH_OBSERVE_IRQ
extern "C" void __real_vTaskSwitchContext(void);
+3 -2
View File
@@ -15,7 +15,8 @@
#include <stdint.h>
namespace mesh { namespace irqobserver {
enum Source : uint32_t { Rtc1, Gpiote, Uart0, Uart1, PowerClock, Usb, Scheduler, SourceCount };
// Append sources to retain the original per-source indices in captures.
enum Source : uint32_t { Rtc1, Gpiote, Uart0, Uart1, PowerClock, Usb, Scheduler, Twim0Spim0, SourceCount };
enum TaskKind : uint32_t { LoopTask, TimerTask, UsbTask, OtherTask, TaskKindCount };
struct Counter { uint32_t sequence, calls, cycles; };
struct Sample {
@@ -186,7 +187,7 @@ inline void finish(uint32_t direction_index, uint32_t result, bool worst) {
barrier();
++capture.sequence;
}
static_assert(sizeof(Capture) == 392 && sizeof(Counter) == 12,
static_assert(sizeof(Capture) == 424 && sizeof(Counter) == 12 && SourceCount == 8,
"Unexpected IRQ observer ABI");
} } // namespace mesh::irqobserver
#endif