diff --git a/ubb-vga/ubb-vga.c b/ubb-vga/ubb-vga.c index e0f0483..dea0248 100644 --- a/ubb-vga/ubb-vga.c +++ b/ubb-vga/ubb-vga.c @@ -221,20 +221,6 @@ static void ben_setup(void) { base = map(SOC_BASE, REG_WINDOW); - /* - * Ironically, switching the LCD clock on and off many times only - * increases the risk of a hang. Therefore, we leave stop it during - * all the measurements and only enable it again at the end. - */ - disable_lcd(); - get_timer(); -} - - -static void cleanup(void) -{ - release_timer(); - enable_lcd(); } @@ -283,6 +269,9 @@ static void setup(void) static void setup_noirq(void) { + disable_lcd(); + get_timer(); + DMAC = 1; DCS(DMA) = (1 << 3) | (1 << 2); DCS(DMA) = 0; @@ -299,6 +288,9 @@ static void cleanup_noirq(void) DMAC = 0; DCS(DMA) = (1 << 3) | (1 << 2); DCS(DMA) = 0; + + release_timer(); + enable_lcd(); } @@ -511,7 +503,6 @@ int main(int argc, char *const *argv) setup(); session(gen, frames); - cleanup(); #if 0 printf("clkdiv: %d, /%d /%d\n", mode->clkdiv,