Skip to content

Commit

Permalink
add OLED init delay time when power-up
Browse files Browse the repository at this point in the history
  • Loading branch information
ChnMasterOG committed Mar 4, 2024
1 parent 81561fa commit 6b1daa8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions mounriver_project/KEYBOARD_CH582M/HAL/MCU.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ void HAL_Init(void)
uint16_t tmp;
char debug_info[128] = "OK";

DelayMs(20); //上电延迟
halTaskID = TMOS_ProcessEventRegister( HAL_ProcessEvent );
HAL_TimeInit();
#ifdef FIRST_USED
Expand All @@ -1055,9 +1056,6 @@ void HAL_Init(void)
#if (defined HAL_HW_I2C) && (HAL_HW_I2C == TRUE)
HW_I2C_Init( );
#endif
#if (defined HAL_OLED) && (HAL_OLED == TRUE)
HAL_OLED_Init( );
#endif
#if (defined HAL_BATTADC) && (HAL_BATTADC == TRUE)
BATTERY_Init( );
#endif
Expand All @@ -1081,6 +1079,9 @@ void HAL_Init(void)
MPR121_Init(debug_info);
#endif
#endif
#if (defined HAL_OLED) && (HAL_OLED == TRUE) // 最后初始化保证上电延迟
HAL_OLED_Init( );
#endif
#if (defined HAL_LED) && (HAL_LED == TRUE)
debug_info[7] = '\0';
if ( strcmp(debug_info, "OK") == 0 ) {
Expand Down
1 change: 0 additions & 1 deletion mounriver_project/KEYBOARD_CH582M/HAL/OLED.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ void HAL_OLED_Init(void)
OLED_CLK_GPIO_(ModeCfg)( OLED_CLK_Pin, GPIO_ModeOut_PP_5mA );
OLED_SDA_GPIO_(ModeCfg)( OLED_SDA_Pin, GPIO_ModeOut_PP_5mA );
#endif
DelayMs(20); //上电延迟

#ifdef OLED_0_42
//display off
Expand Down

0 comments on commit 6b1daa8

Please sign in to comment.