Skip to content

Commit 6b3f9a3

Browse files
committed
BUTTONS test now prints missing keys
1 parent cde9d77 commit 6b3f9a3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

prodScreen_buttonsTest.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33

44
/// Defines
5-
#define TIMEOUT_FAIL 121 // in seconds
5+
#define TIMEOUT_FAIL 5 //121 // in seconds
66
#define NB_KEYS 13
77

88
/// Static variables
99
static SDL_Surface *img_console_layout;
1010
static SDL_Surface *img_button_LR_green;
1111
static SDL_Surface *img_button_normal_green;
1212
static int keys[NB_KEYS] = {SDLK_m, SDLK_n, SDLK_l, SDLK_u, SDLK_r, SDLK_d, SDLK_b, SDLK_y, SDLK_x, SDLK_a, SDLK_s, SDLK_f, SDLK_q};
13+
static char *keys_str[NB_KEYS] = {"m (L1)", "n (R1)", "l (LEFT)", "u (UP)", "r (RIGHT)", "d (DOWN)", "b (B)", "y (Y)", "x (X)", "a (A)", "s (START)", "f (Fn)", "q (POWER ON/OFF)"};
1314
static int keys_pushed[NB_KEYS] = {0};
1415

1516

@@ -192,6 +193,13 @@ int launch_prod_screen_buttons(int argc, char *argv[]){
192193
SDL_Delay(SLEEP_PERIOD_MS);
193194
}
194195

196+
/* Print not touched buttons if timeout */
197+
printf(" Missing Keys: ");
198+
for (i = 0; i < NB_KEYS; i++){
199+
if(keys_pushed[i]) continue;
200+
printf("%s,", keys_str[i]);
201+
}
202+
printf("\n");
195203

196204
/*Free surfaces */
197205
SDL_FreeSurface(img_console_layout);

0 commit comments

Comments
 (0)