Commit 1646eff8 authored by iabdalkader's avatar iabdalkader Committed by Damien George

stm32/irq: Fix IRQ_ENABLE_STATS stats config to work on all MCUs.

Only the M4 and M7 MCUs have an FPU and FPU_IRQn, and FPU_IRQn is not
always the last entry/IRQ number.
parent 07af74da
......@@ -31,7 +31,7 @@
/// \moduleref pyb
#if IRQ_ENABLE_STATS
uint32_t irq_stats[FPU_IRQn + 1] = {0};
uint32_t irq_stats[IRQ_STATS_MAX] = {0};
#endif
/// \function wfi()
......
......@@ -39,7 +39,12 @@
#define IRQ_ENABLE_STATS (0)
#if IRQ_ENABLE_STATS
extern uint32_t irq_stats[FPU_IRQn + 1];
#if defined(STM32H7)
#define IRQ_STATS_MAX (256)
#else
#define IRQ_STATS_MAX (128)
#endif
extern uint32_t irq_stats[IRQ_STATS_MAX];
#define IRQ_ENTER(irq) ++irq_stats[irq]
#define IRQ_EXIT(irq)
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment