1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-07-01 03:06:43 +03:00

ubb-vga.c: moved timer setup and LCD disabling into noirq setup

- ubb-vga.c (ben_setup, setup_noirq): moved calls to disable_lcd and
  get_timer to setup_noirq
- ubb-vga.c (cleanup, cleanup_noirq): moved calls to release_timer
  and enable_lcd to cleanup_noirq
- ubb-vga.c (cleanup, main): "cleanup" is now empty; removed it
This commit is contained in:
Werner Almesberger 2011-05-06 19:36:34 -03:00
parent 6c3adaf08f
commit f7e8fbbaea

View File

@ -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,