changed title, magnet test with instruction to close the console

This commit is contained in:
busebusemac 2020-09-27 11:18:54 +02:00
parent c22119a090
commit cb331d8b01
11 changed files with 22 additions and 11 deletions

View File

@ -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[] = {

View File

@ -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__

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);