Skip to content

Commit

Permalink
Fix deepsleep by properly init after waking up, for issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
biemster committed Dec 3, 2024
1 parent 3c34294 commit 3e5f318
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ void user_init_normal(void)

rf_set_power_level_index (MY_RF_POWER_INDEX);
bls_ll_setAdvEnable(1);
irq_enable();
}


_attribute_ram_code_ void user_init_deepRetn(void)
{
blc_ll_initBasicMCU(); //mandatory
rf_set_power_level_index (MY_RF_POWER_INDEX);
blc_ll_recoverDeepRetention();
irq_enable();
}

_attribute_ram_code_ void main_loop (void)
{
blt_sdk_main_loop();
Expand Down
7 changes: 6 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ _attribute_ram_code_ int main (void) //must run in ramcode

blc_app_loadCustomizedParameters(); //load customized freq_offset cap value

user_init_normal();
if( deepRetWakeUp ) {
user_init_deepRetn();
}
else {
user_init_normal();
}

while (1) {
#if (MODULE_WATCHDOG_ENABLE)
Expand Down
Binary file modified out/FindMy.bin
Binary file not shown.

0 comments on commit 3e5f318

Please sign in to comment.