diff --git a/code/application/source/sf_app/code/include/sf_system.h b/code/application/source/sf_app/code/include/sf_system.h index 0bf923f90..e3fe05f9a 100755 --- a/code/application/source/sf_app/code/include/sf_system.h +++ b/code/application/source/sf_app/code/include/sf_system.h @@ -66,6 +66,7 @@ UINT8 sf_check_power_on_mode(void); void sf_power_off_msg_to_cardv(void); SINT32 sf_app_mcu_para_power_no_start(void); SINT32 sf_app_mcu_updata_start(void); +UINT8 sf_app_get_mcu_init_flag(void); #ifdef __cplusplus #if __cplusplus } diff --git a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c index d75194d76..1a0dd93f1 100755 --- a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c @@ -456,7 +456,18 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val) MLOGE("attrId ERROR!\n"); return -1; } - + + for (i = 0; i < 40; i++) + { + if (1 == sf_app_get_mcu_init_flag()) + { + break; + } + else + { + sf_sleep_ms(100); + } + } if(attrId == SF_MCU_POWEROFF) {