From cb331d8b0154b76c31c6ca02a7f77c7ff45ffc59 Mon Sep 17 00:00:00 2001 From: busebusemac Date: Sun, 27 Sep 2020 11:18:54 +0200 Subject: [PATCH] changed title, magnet test with instruction to close the console --- funkey_prod_screens.c | 1 + funkey_prod_screens.h | 1 + prodScreen_brightnessTest.c | 2 +- prodScreen_buttonsTest.c | 2 +- prodScreen_displayTest.c | 2 +- prodScreen_failScreen.c | 2 +- prodScreen_ledTest.c | 2 +- prodScreen_magnetTest.c | 15 ++++++++++++--- prodScreen_speakerTest.c | 2 +- prodScreen_validation.c | 2 +- prodScreen_waitBattery.c | 2 +- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/funkey_prod_screens.c b/funkey_prod_screens.c index 80539fc..1156938 100644 --- a/funkey_prod_screens.c +++ b/funkey_prod_screens.c @@ -13,6 +13,7 @@ TTF_Font *font_title = NULL; TTF_Font *font_info = NULL; SDL_Color bg_color = {COLOR_BG_R, COLOR_BG_G, COLOR_BG_B}; SDL_Color text_color = {COLOR_TEXT_R, COLOR_TEXT_G, COLOR_TEXT_B}; +char *prog_title = "FUNKEY S TESTS"; /* Static Variables */ static s_prod_test prod_tests[] = { diff --git a/funkey_prod_screens.h b/funkey_prod_screens.h index 2fe7130..d24db0b 100644 --- a/funkey_prod_screens.h +++ b/funkey_prod_screens.h @@ -60,6 +60,7 @@ extern TTF_Font *font_title; extern TTF_Font *font_info; extern SDL_Color bg_color; extern SDL_Color text_color; +char *prog_title; #endif //__FUNKEY_PROD_SCREENS__ \ No newline at end of file diff --git a/prodScreen_brightnessTest.c b/prodScreen_brightnessTest.c index 847d752..c33b21a 100644 --- a/prodScreen_brightnessTest.c +++ b/prodScreen_brightnessTest.c @@ -56,7 +56,7 @@ int launch_prod_screen_brightness(int argc, char *argv[]){ SDL_FillRect(hw_surface, NULL, SDL_MapRGBA(hw_surface->format, bg_color.r, bg_color.g, bg_color.b, 0) ); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FunKey PCBA Tests", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); diff --git a/prodScreen_buttonsTest.c b/prodScreen_buttonsTest.c index 2940bb7..bdd49fc 100644 --- a/prodScreen_buttonsTest.c +++ b/prodScreen_buttonsTest.c @@ -63,7 +63,7 @@ int launch_prod_screen_buttons(int argc, char *argv[]){ SDL_BlitSurface(img_console_layout, NULL, hw_surface, NULL); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FunKey PCBA Tests", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); diff --git a/prodScreen_displayTest.c b/prodScreen_displayTest.c index 712d97e..46937ad 100644 --- a/prodScreen_displayTest.c +++ b/prodScreen_displayTest.c @@ -25,7 +25,7 @@ int launch_prod_screen_display(int argc, char *argv[]){ SDL_FillRect(hw_surface, NULL, SDL_MapRGBA(hw_surface->format, bg_color.r, bg_color.g, bg_color.b, 0) ); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FUNKEY PCBA TESTS", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); diff --git a/prodScreen_failScreen.c b/prodScreen_failScreen.c index eeb5c59..a60d163 100644 --- a/prodScreen_failScreen.c +++ b/prodScreen_failScreen.c @@ -57,7 +57,7 @@ int launch_prod_screen_fail(int argc, char *argv[]){ /* Write Title */ SDL_Color red={255,0,0}; - text_surface = TTF_RenderText_Shaded(font_title, "FUNKEY PCBA TESTS", red, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, red, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); diff --git a/prodScreen_ledTest.c b/prodScreen_ledTest.c index 8a358b9..1192b3f 100644 --- a/prodScreen_ledTest.c +++ b/prodScreen_ledTest.c @@ -55,7 +55,7 @@ int launch_prod_screen_LED(int argc, char *argv[]){ SDL_FillRect(hw_surface, NULL, SDL_MapRGBA(hw_surface->format, bg_color.r, bg_color.g, bg_color.b, 0) ); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FunKey PCBA Tests", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); diff --git a/prodScreen_magnetTest.c b/prodScreen_magnetTest.c index 9e434f9..422e685 100644 --- a/prodScreen_magnetTest.c +++ b/prodScreen_magnetTest.c @@ -68,16 +68,25 @@ int launch_prod_screen_magnet(int argc, char *argv[]){ SDL_FillRect(hw_surface, NULL, SDL_MapRGBA(hw_surface->format, bg_color.r, bg_color.g, bg_color.b, 0) ); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FunKey PCBA Tests", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); SDL_FreeSurface(text_surface); - /* Write "Screen ok ? */ + /* Write + " MAGNET TEST + (close the console)*/ + int y_pad_tmp = 11; text_surface = TTF_RenderText_Shaded(font_title, "MAGNET TEST", text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; - text_pos.y = SCREEN_VERTICAL_SIZE/2 - text_surface->h/2; + text_pos.y = SCREEN_VERTICAL_SIZE/2 - text_surface->h/2 - y_pad_tmp; + SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); + SDL_FreeSurface(text_surface); + + text_surface = TTF_RenderText_Shaded(font_title, "(close the console)", text_color, bg_color); + text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; + text_pos.y = SCREEN_VERTICAL_SIZE/2 - text_surface->h/2 + y_pad_tmp; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); SDL_FreeSurface(text_surface); diff --git a/prodScreen_speakerTest.c b/prodScreen_speakerTest.c index 0a040d9..c8d4171 100644 --- a/prodScreen_speakerTest.c +++ b/prodScreen_speakerTest.c @@ -56,7 +56,7 @@ int launch_prod_screen_speaker(int argc, char *argv[]){ SDL_FillRect(hw_surface, NULL, SDL_MapRGBA(hw_surface->format, bg_color.r, bg_color.g, bg_color.b, 0) ); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FunKey PCBA Tests", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); diff --git a/prodScreen_validation.c b/prodScreen_validation.c index 2b3a179..70ccd83 100644 --- a/prodScreen_validation.c +++ b/prodScreen_validation.c @@ -56,7 +56,7 @@ int launch_prod_screen_validation(int argc, char *argv[]){ SDL_FillRect(hw_surface, NULL, SDL_MapRGBA(hw_surface->format, bg_color.r, bg_color.g, bg_color.b, 0) ); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FUNKEY PCBA TESTS", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos); diff --git a/prodScreen_waitBattery.c b/prodScreen_waitBattery.c index ae9a1b6..a547144 100644 --- a/prodScreen_waitBattery.c +++ b/prodScreen_waitBattery.c @@ -96,7 +96,7 @@ int launch_prod_screen_waitbattery(int argc, char *argv[]){ SDL_FillRect(hw_surface, NULL, SDL_MapRGBA(hw_surface->format, bg_color.r, bg_color.g, bg_color.b, 0) ); /* Write Title */ - text_surface = TTF_RenderText_Shaded(font_title, "FUNKEY PCBA TESTS", text_color, bg_color); + text_surface = TTF_RenderText_Shaded(font_title, prog_title, text_color, bg_color); text_pos.x = SCREEN_HORIZONTAL_SIZE/2 - text_surface->w/2; text_pos.y = Y_PADDING; SDL_BlitSurface(text_surface, NULL, hw_surface, &text_pos);