From 902e86242ea579fbc15f77c5665520404cbbd0ff Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 7 Sep 2010 23:47:04 +0200 Subject: add config to include intro This makes it possible to remove the long introduction animation. It also save some flash space. --- AT91SAM7S256/Source/c_ui.c | 8 +++++--- AT91SAM7S256/Source/config.h | 10 ++++++++++ AT91SAM7S256/Source/stdconst.h | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 AT91SAM7S256/Source/config.h diff --git a/AT91SAM7S256/Source/c_ui.c b/AT91SAM7S256/Source/c_ui.c index 95bbe6f..7e39d6f 100644 --- a/AT91SAM7S256/Source/c_ui.c +++ b/AT91SAM7S256/Source/c_ui.c @@ -1313,7 +1313,7 @@ void cUiCtrl(void) VarsUi.State = 0; VarsUi.Pointer = 0; - VarsUi.Timer = -INTRO_START_TIME; + VarsUi.Timer = CONFIG_INTRO ? -INTRO_START_TIME : 0; VarsUi.FNOFState = 0; VarsUi.FBState = 0; @@ -1325,10 +1325,10 @@ void cUiCtrl(void) VarsUi.GUSState = 0; IOMapUi.pMenu = (MENU*)cUiGetMenuPointer(0); - IOMapUi.State = INIT_INTRO; + IOMapUi.State = CONFIG_INTRO ? INIT_INTRO : INIT_WAIT; pMapDisplay->EraseMask = SCREEN_BIT(SCREEN_BACKGROUND); - pMapDisplay->pBitmaps[BITMAP_1] = (BMPMAP*)Intro[VarsUi.Pointer]; + pMapDisplay->pBitmaps[BITMAP_1] = CONFIG_INTRO ? (BMPMAP*)Intro[VarsUi.Pointer] : RCXintro_16; pMapDisplay->UpdateMask = BITMAP_BIT(BITMAP_1); pMapDisplay->Flags |= DISPLAY_ON; @@ -1338,6 +1338,7 @@ void cUiCtrl(void) } break; +#if CONFIG_INTRO case INIT_LOW_BATTERY : { if (++VarsUi.Timer >= (INTRO_LOWBATT_TIME)) @@ -1431,6 +1432,7 @@ void cUiCtrl(void) } } break; +#endif /* CONFIG_INTRO */ case INIT_WAIT : { diff --git a/AT91SAM7S256/Source/config.h b/AT91SAM7S256/Source/config.h new file mode 100644 index 0000000..d396771 --- /dev/null +++ b/AT91SAM7S256/Source/config.h @@ -0,0 +1,10 @@ +#ifndef CONFIG_H +#define CONFIG_H +/* + * This file defines compilation options. + */ + +/* Include intro code and images. */ +#define CONFIG_INTRO 1 + +#endif /* CONFIG_H */ diff --git a/AT91SAM7S256/Source/stdconst.h b/AT91SAM7S256/Source/stdconst.h index bf8f052..6c08175 100644 --- a/AT91SAM7S256/Source/stdconst.h +++ b/AT91SAM7S256/Source/stdconst.h @@ -20,6 +20,8 @@ #ifndef STDCONST #define STDCONST +#include "config.h" + #ifndef NULL #define NULL ((void *)0) #endif -- cgit v1.2.3