The SDK way:
which is simply a wrapper around writing to the NVIC registers nvic_hw->ipr[]
num is the interrupt number - the same TIMER_IRQ_0 or whatever as we've been using previously.
The 'hardware_priority' is slightly confusing: it's an 8-bit field, but only the top two bits are used, so the useful priorities are 0x00, 0x40, 0x80, 0xc0.
Zero is the highest priority, 0xc0 the lowest.
According to the documentation, 0x80 is the default - personally, if I'm setting the priority at all I like to set it for all the interrupts I'm using just for clarity.
And of course this is an NVIC feature, so it applies to interrupts occurring on the core where you issue the call.
Code:
void irq_set_priority (uint num, uint8_t hardware_priority)
num is the interrupt number - the same TIMER_IRQ_0 or whatever as we've been using previously.
The 'hardware_priority' is slightly confusing: it's an 8-bit field, but only the top two bits are used, so the useful priorities are 0x00, 0x40, 0x80, 0xc0.
Zero is the highest priority, 0xc0 the lowest.
According to the documentation, 0x80 is the default - personally, if I'm setting the priority at all I like to set it for all the interrupts I'm using just for clarity.
And of course this is an NVIC feature, so it applies to interrupts occurring on the core where you issue the call.
Statistics: Posted by arg001 — Mon Aug 12, 2024 9:53 pm