From 552ea09fe7f9ce6c6b5f412cb2fcf603be2836c3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 20 Nov 2016 02:59:40 -0800 Subject: 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 --- src/drivers/ao_vga.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/drivers') 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); } } -- cgit v1.2.3