Skip to content

Commit 06165f8

Browse files
committed
SDL_Flip now in while loop, otherwise it was not working on builroot...weird
1 parent 1f183b9 commit 06165f8

8 files changed

+32
-13
lines changed

funkey_prod_screens.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
#define Y_PADDING 10
3535
#define X_PADDING 20
3636

37-
#define FONT_NAME_TITLE "ProdResources/FreeSansBold.ttf"
38-
#define FONT_SIZE_TITLE 20
39-
#define FONT_NAME_INFO FONT_NAME_TITLE
40-
#define FONT_SIZE_INFO 18
37+
#define FOLDER_RESSOURCES "/usr/local/sbin/ProdResources"
38+
#define FONT_NAME_TITLE FOLDER_RESSOURCES"/FreeSansBold.ttf"
39+
#define FONT_SIZE_TITLE 20
40+
#define FONT_NAME_INFO FONT_NAME_TITLE
41+
#define FONT_SIZE_INFO 18
4142

4243
typedef struct
4344
{

prodScreen_buttonsTest.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#ifndef __PROD_SCREEN_BUTTONS__
22
#define __PROD_SCREEN_BUTTONS__
33

4-
#define IMG_CONSOLE_LAYOUT "ProdResources/funkey_with_buttons.png"
5-
#define IMG_BUTTON_LR_GREEN "ProdResources/button_LR_green.png"
6-
#define IMG_BUTTON_NORMAL_GREEN "ProdResources/button_round_green.png"
4+
#define IMG_CONSOLE_LAYOUT FOLDER_RESSOURCES"/funkey_with_buttons.png"
5+
#define IMG_BUTTON_LR_GREEN FOLDER_RESSOURCES"/button_LR_green.png"
6+
#define IMG_BUTTON_NORMAL_GREEN FOLDER_RESSOURCES"/button_round_green.png"
77

88
int launch_prod_screen_buttons();
99

prodScreen_failScreen.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ static int wait_event_loop(){
3838
}
3939
}
4040

41+
/* To inverstigate but with Buildroot, we need this: */
42+
SDL_Flip(hw_surface);
43+
4144
/* Sleep for some time */
4245
SDL_Delay(SLEEP_PERIOD_MS);
4346
}
@@ -101,7 +104,7 @@ int launch_prod_screen_fail(){
101104
SDL_FreeSurface(text_surface);
102105

103106
/// Render screen
104-
SDL_Flip(hw_surface);
107+
//SDL_Flip(hw_surface);
105108

106109
///
107110
int res = wait_event_loop();

prodScreen_ledTest.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ static int wait_event_loop(){
3737
}
3838
}
3939

40+
/* To inverstigate but with Buildroot, we need this: */
41+
SDL_Flip(hw_surface);
42+
4043
/* Sleep for some time */
4144
SDL_Delay(SLEEP_PERIOD_MS);
4245
}
@@ -97,7 +100,7 @@ int launch_prod_screen_LED(){
97100
SDL_FreeSurface(text_surface);
98101

99102
/* Render screen */
100-
SDL_Flip(hw_surface);
103+
//SDL_Flip(hw_surface);
101104

102105
///
103106
int res = wait_event_loop();

prodScreen_magnetTest.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ static int wait_event_loop(){
3838
}
3939
}
4040

41+
/* To inverstigate but with Buildroot, we need this: */
42+
SDL_Flip(hw_surface);
43+
4144
/* Sleep for some time */
4245
SDL_Delay(SLEEP_PERIOD_MS);
4346
}
@@ -99,7 +102,7 @@ int launch_prod_screen_magnet(){
99102
SDL_FreeSurface(text_surface);*/
100103

101104
/// Render screen
102-
SDL_Flip(hw_surface);
105+
//SDL_Flip(hw_surface);
103106

104107
///
105108
int res = wait_event_loop();

prodScreen_speakerTest.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ static int wait_event_loop(){
3838
}
3939
}
4040

41+
/* To inverstigate but with Buildroot, we need this: */
42+
SDL_Flip(hw_surface);
43+
4144
/* Sleep for some time */
4245
SDL_Delay(SLEEP_PERIOD_MS);
4346
}
@@ -98,7 +101,7 @@ int launch_prod_screen_speaker(){
98101
SDL_FreeSurface(text_surface);
99102

100103
/* Render screen */
101-
SDL_Flip(hw_surface);
104+
//SDL_Flip(hw_surface);
102105

103106
///
104107
int res = wait_event_loop();

prodScreen_validation.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ static int wait_event_loop(){
3838
}
3939
}
4040

41+
/* To inverstigate but with Buildroot, we need this: */
42+
SDL_Flip(hw_surface);
43+
4144
/* Sleep for some time */
4245
SDL_Delay(SLEEP_PERIOD_MS);
4346
}
@@ -99,7 +102,7 @@ int launch_prod_screen_validation(){
99102
SDL_FreeSurface(text_surface);
100103

101104
/// Render screen
102-
SDL_Flip(hw_surface);
105+
//SDL_Flip(hw_surface);
103106

104107
///
105108
int res = wait_event_loop();

prodScreen_waitBattery.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ static int wait_event_loop(){
6666
}
6767
}
6868

69+
/* To inverstigate but with Buildroot, we need this: */
70+
SDL_Flip(hw_surface);
71+
6972
if(SDL_GetTicks() - prev_ms > CHECK_BATTERY_DELAY_MS){
7073

7174
/* Update time*/
@@ -140,7 +143,7 @@ int launch_prod_screen_waitbattery(){
140143
SDL_FreeSurface(text_surface);*/
141144

142145
/// Render screen
143-
SDL_Flip(hw_surface);
146+
//SDL_Flip(hw_surface);
144147

145148
///
146149
int res = wait_event_loop();

0 commit comments

Comments
 (0)