summaryrefslogtreecommitdiff
path: root/src/stm/ao_serial_stm.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-20 20:54:10 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 12:31:16 -0800
commit088ddbb177efc8be2fc467524dc1668553080d3b (patch)
tree277f486b5204bfe087b79af66dfcc646fba4ed68 /src/stm/ao_serial_stm.c
parent992eee8e0b4c6c774f3355af107fb422019ff4e5 (diff)
altos/stm: Interrupt priority is in the upper bits of the priority mask
Because the STM32L only offers 16 priority levels, the bottom four bits of each priority mask are not used. All of the interrupt priority settings in the system were using values < 16, making them all effectively the same. Fix that by moving them into the upper 4 bits and using symbolic constants everywhere. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_serial_stm.c')
-rw-r--r--src/stm/ao_serial_stm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stm/ao_serial_stm.c b/src/stm/ao_serial_stm.c
index db0be992..c625471e 100644
--- a/src/stm/ao_serial_stm.c
+++ b/src/stm/ao_serial_stm.c
@@ -444,7 +444,7 @@ ao_serial_init(void)
ao_usart_init(&ao_stm_usart1);
stm_nvic_set_enable(STM_ISR_USART1_POS);
- stm_nvic_set_priority(STM_ISR_USART1_POS, 4);
+ stm_nvic_set_priority(STM_ISR_USART1_POS, AO_STM_NVIC_MED_PRIORITY);
#if USE_SERIAL_1_STDIN && !DELAY_SERIAL_1_STDIN
ao_add_stdio(_ao_serial1_pollchar,
ao_serial1_putchar,
@@ -500,7 +500,7 @@ ao_serial_init(void)
#endif
stm_nvic_set_enable(STM_ISR_USART2_POS);
- stm_nvic_set_priority(STM_ISR_USART2_POS, 4);
+ stm_nvic_set_priority(STM_ISR_USART2_POS, AO_STM_NVIC_MED_PRIORITY);
#if USE_SERIAL_2_STDIN && !DELAY_SERIAL_2_STDIN
ao_add_stdio(_ao_serial2_pollchar,
ao_serial2_putchar,
@@ -544,7 +544,7 @@ ao_serial_init(void)
ao_usart_init(&ao_stm_usart3);
stm_nvic_set_enable(STM_ISR_USART3_POS);
- stm_nvic_set_priority(STM_ISR_USART3_POS, 4);
+ stm_nvic_set_priority(STM_ISR_USART3_POS, AO_STM_NVIC_MED_PRIORITY);
#if USE_SERIAL_3_STDIN && !DELAY_SERIAL_3_STDIN
ao_add_stdio(_ao_serial3_pollchar,
ao_serial3_putchar,