diff options
author | Keith Packard <keithp@keithp.com> | 2016-11-20 02:59:40 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-11-20 20:48:40 -0800 |
commit | 552ea09fe7f9ce6c6b5f412cb2fcf603be2836c3 (patch) | |
tree | c4bd3f12dae197ee286f4c291f55241fe10d6510 /src/drivers | |
parent | fd05d495b463685d81e75115a93fdda2764c7113 (diff) |
altos/stm: Use basepri instead of primask for controlling interrupts
This allows for high priority interrupts (priority 0) to run, even
when other interrupts are blocked. Code executing in such interrupt
handlers must not attempt to control task execution as that will race
with the scheduler.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/ao_vga.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/drivers/ao_vga.c b/src/drivers/ao_vga.c index eecf58f0..0e9c6706 100644 --- a/src/drivers/ao_vga.c +++ b/src/drivers/ao_vga.c @@ -89,7 +89,6 @@ int vblank_off = 25; void stm_tim2_isr(void) { - ao_arch_block_interrupts(); if (!vblank) { /* Disable */ stm_dma.channel[DMA_INDEX].ccr = DMA_CCR(0); @@ -101,18 +100,17 @@ void stm_tim2_isr(void) } stm_tim2.sr = ~(1 << STM_TIM234_SR_CC2IF); line = stm_tim3.cnt; - if (vblank_off <= line && line < (AO_VGA_HEIGHT << 1) + vblank_off) { + if (vblank_off <= line && line < ((AO_VGA_HEIGHT-1) << 1) + vblank_off) { vblank = 0; if (((line - vblank_off) & 1) == 0) scanline += AO_VGA_STRIDE; } else { if (!vblank) { - stm_systick_isr(); +// stm_systick_isr(); scanline = ao_vga_fb; vblank = 1; } } - ao_arch_release_interrupts(); } static void @@ -359,9 +357,9 @@ ao_vga_enable(int enable) vblank_off = enable; ao_vga_fb_init(); stm_tim2.cr1 |= (1 << STM_TIM234_CR1_CEN); - stm_systick.csr &= ~(1 << STM_SYSTICK_CSR_ENABLE); +// stm_systick.csr &= ~(1 << STM_SYSTICK_CSR_ENABLE); } else { stm_tim2.cr1 &= ~(1 << STM_TIM234_CR1_CEN); - stm_systick.csr |= (1 << STM_SYSTICK_CSR_ENABLE); +// stm_systick.csr |= (1 << STM_SYSTICK_CSR_ENABLE); } } |