Skip to content

Commit

Permalink
Use macros for splash min/max durations.
Browse files Browse the repository at this point in the history
  • Loading branch information
d0k3 committed Jul 17, 2018
1 parent d99f583 commit af04f10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions include/arm11/menu/menu_func.h
Expand Up @@ -28,6 +28,8 @@
#define DEVICE_BUFSIZE (((REG_CFG11_SOCINFO & 2) ? 1024 : 512) * 1024) // 1024 / 512 KiB
#define PROGRESS_WIDTH 20
#define SPLASH_DEFAULT_MSEC 1000
#define SPLASH_MIN_MSEC 500
#define SPLASH_MAX_MSEC 10000
#define VBLANK_APPROX_MSEC 16


Expand Down
2 changes: 1 addition & 1 deletion source/arm11/main.c
Expand Up @@ -182,7 +182,7 @@ int main(void)
{
// prevent bad splash delays
s32 dkey = *(s32*) configGetData(KSplashDuration);
dmsec = (dkey < 500) ? 500 : (dkey) > 10000 ? 10000 : (u32) dkey;
dmsec = (dkey < SPLASH_MIN_MSEC) ? SPLASH_MIN_MSEC : (dkey) > SPLASH_MAX_MSEC ? SPLASH_MAX_MSEC : (u32) dkey;
}

// convert msecs to vblanks and wait for the specified amount
Expand Down
4 changes: 2 additions & 2 deletions source/arm11/menu/menu_func.c
Expand Up @@ -336,8 +336,8 @@ u32 menuSetSplashDuration(PrintConsole* term_con, PrintConsole* menu_con, u32 pa
u32 kHeld = 0;

// make sure duration stays within boundaries
if (duration < 500) duration = 500;
else if (duration > 10000) duration = 10000;
if (duration < SPLASH_MIN_MSEC) duration = SPLASH_MIN_MSEC;
else if (duration > SPLASH_MAX_MSEC) duration = SPLASH_MAX_MSEC;

// update screen
ee_printf_screen_center("Change splash duration via arrow keys.\nPress [A] to confirm, [B] or HOME] to cancel.\n \nSplash duration: %li msec", duration);
Expand Down

0 comments on commit af04f10

Please sign in to comment.