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.
This commit is contained in:
parent
07af74daef
commit
1646eff864
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user