I want to set interrupt priorities for processor internal exceptions. The cortex_m
crate provides easy access to NVIC control registers. Specifically, there is a method that let me set priority for each interrupt.
let mut p = cortex_m::Peripherals::take().unwrap();
p.NVIC.set_priority(...);
set_priority
asks me to pass an argument specifying for which interrupt I intend to modify the priority. Say I want to change the priority for PendSV
. However, passing in cortex_m::peripheral::scb::Exception::PendSV
will not work because it does not implement a required trait bound.
I am developing on STM32F407VGT6 board, so I also looked in the stm32f4
crate, but I did not find any enum definition that can help either.
Should I write my own enum that implements the required trait so that it can specify interrupt numbers, or is there already some existing crate that can make it work?