Le support aux utilisateurs et les demandes de création de comptes externes doivent être faites depuis les issues du projet GitLab HEFR (https://gitlab.forge.hefr.ch/forge-hefr/gitlab-hefr)

Commit 3a953a02 authored by Nicolas Maier's avatar Nicolas Maier
Browse files

Affichage warning quand pas de réponse dans "game"

parent 88d2309f
Pipeline #7285 failed with stage
in 36 seconds
......@@ -37,7 +37,7 @@
#define COMMUNICATION_RETRY_DELAY_MS 10
#define COMMUNICATION_MAX_ERR_COUNT 50
#define COMMUNICATION_ERR_COUNT_DISCONNECT 10
#define COMMUNICATION_ERR_COUNT_DISCONNECT 30
struct communication_info {
bool isJ1;
......
......@@ -173,7 +173,7 @@ void display_show_text(char* text, uint8_t offset_x, uint8_t offset_y) {
}
void display_update_disconnected(bool is_disconnected) {
static last_is_disconnected = false;
static bool last_is_disconnected = false;
if (last_is_disconnected != is_disconnected) {
draw_char(SCORES_SEPARATOR_BASE_X + SCORES_MARGIN,
GAME_AREA_MARGIN + SCORES_MARGIN,
......
......@@ -63,6 +63,7 @@
#define MIN_OFFSET_ANGLE_MODIFIER 2
#define SPECIAL_LOADING_MAX 12000000
#define MAX_PSEUDORAND 1000
#define WAIT_COUNT_DISCONNECT 60
struct vector {
......@@ -184,6 +185,7 @@ static void game_thread(void* param)
int step_count = STEP_COUNT_MAX;
bool should_reset = false;
int wait_count = 0;
while (true) {
......@@ -215,6 +217,9 @@ static void game_thread(void* param)
next_state.is_ally_playing = true;
next_state.current_special = msg_data[2];
wait_count = 0;
display_update_disconnected(false);
step_count = 1;
timer_get_counter(TIMER_WAIT_REFRESH);
break;
......@@ -227,6 +232,11 @@ static void game_thread(void* param)
} else {
prepare_set();
}
wait_count = 0;
display_update_disconnected(false);
step_count = 1;
timer_get_counter(TIMER_WAIT_REFRESH);
break;
}
......@@ -414,6 +424,10 @@ static void game_thread(void* param)
+ DISPLAY_BAR_WIDTH) {
next_state.ball_pos.y = GAME_TOPBOTTOM_MARGIN
+ DISPLAY_BAR_WIDTH;
wait_count++;
if (wait_count >= WAIT_COUNT_DISCONNECT) {
display_update_disconnected(true);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment