Main:
_attribute_ram_code_ int main (void) //must run in ramcode
{
blc_pm_select_internal_32k_crystal();
cpu_wakeup_init();
int deepRetWakeUp = pm_is_MCU_deepRetentionWakeup(); //MCU deep retention wakeUp
rf_drv_init(RF_MODE_BLE_1M);
gpio_init( !deepRetWakeUp ); //analog resistance will keep available in deepSleep mode, so no need initialize again
#if (CLOCK_SYS_CLOCK_HZ == 16000000)
clock_init(SYS_CLK_16M_Crystal);
#elif (CLOCK_SYS_CLOCK_HZ == 24000000)
clock_init(SYS_CLK_24M_Crystal);
#endif
blc_app_loadCustomizedParameters();
Function called on wakeup:
_attribute_ram_code_ void user_init_deepRetn(void){//after sleep this will get executed
init_lcd_deepsleep();
blc_ll_initBasicMCU();
rf_set_power_level_index (RF_POWER_P3p01dBm);
blc_ll_recoverDeepRetention();
}
This is a third-party SDK, and we cannot provide direct support because we are uncertain about the actual version they are using at the underlying level and whether they have modified certain configurations. We recommend you first communicate with Ai-Thinker.