mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-24 01:55:21 +02: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:
parent
6c3adaf08f
commit
f7e8fbbaea
@ -221,20 +221,6 @@ static void ben_setup(void)
|
|||||||
{
|
{
|
||||||
base = map(SOC_BASE, REG_WINDOW);
|
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)
|
static void setup_noirq(void)
|
||||||
{
|
{
|
||||||
|
disable_lcd();
|
||||||
|
get_timer();
|
||||||
|
|
||||||
DMAC = 1;
|
DMAC = 1;
|
||||||
DCS(DMA) = (1 << 3) | (1 << 2);
|
DCS(DMA) = (1 << 3) | (1 << 2);
|
||||||
DCS(DMA) = 0;
|
DCS(DMA) = 0;
|
||||||
@ -299,6 +288,9 @@ static void cleanup_noirq(void)
|
|||||||
DMAC = 0;
|
DMAC = 0;
|
||||||
DCS(DMA) = (1 << 3) | (1 << 2);
|
DCS(DMA) = (1 << 3) | (1 << 2);
|
||||||
DCS(DMA) = 0;
|
DCS(DMA) = 0;
|
||||||
|
|
||||||
|
release_timer();
|
||||||
|
enable_lcd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -511,7 +503,6 @@ int main(int argc, char *const *argv)
|
|||||||
|
|
||||||
setup();
|
setup();
|
||||||
session(gen, frames);
|
session(gen, frames);
|
||||||
cleanup();
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printf("clkdiv: %d, /%d /%d\n", mode->clkdiv,
|
printf("clkdiv: %d, /%d /%d\n", mode->clkdiv,
|
||||||
|
Loading…
Reference in New Issue
Block a user