Skip to content

Commit

Permalink
Merge pull request #43 from RoboTeamTwente/Disable_oled_when_not_test
Browse files Browse the repository at this point in the history
Fix OLED update in test mode to prevent random reboots
  • Loading branch information
JWillegers authored Jul 16, 2024
2 parents 3369618 + 689debd commit 88b753f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Core/Src/top_board/robot.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,10 @@ void check_otherboards(CAN_TxHeaderTypeDef board_header, bool *board_state, MCP_
void loop(void){
uint32_t current_time = HAL_GetTick();
counter_loop++;

OLED_Update(getRecentlyPressedButton(), TEST_MODE);
// Only update only in test mode, else random reboots starts happening
if (TEST_MODE) {
OLED_Update(getRecentlyPressedButton(), TEST_MODE);
}

/* Send anything in the log buffer over UART */
LOG_send();
Expand Down Expand Up @@ -1106,7 +1108,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
uint32_t current_time = HAL_GetTick();
//Control loop
if(htim->Instance == TIM_CONTROL->Instance) {
if(!ROBOT_INITIALIZED || OLED_get_current_page_test_type() == BLOCKING_TEST) return;
if(!ROBOT_INITIALIZED || (TEST_MODE && OLED_get_current_page_test_type() == BLOCKING_TEST)) return;

flag_useStateInfo = activeRobotCommand.sendStateInfo;

Expand Down

0 comments on commit 88b753f

Please sign in to comment.