DSPS project and periph_init

Learn MoreFAQsTutorials

4 posts / 0 new
Last post
Daekeun Yun
Offline
Last seen:2 weeks 3 days ago
Joined:2015-05-27凌晨5
DSPS project and periph_init

Hello
我想使用需求方的项目(DSPS 5.150.2). I added one characteristic to control GPIO at DSPS original project.
I can check the gpio is changed when I change the value of the characteristic.
The problem is that 'BLE_WAKEUP_LP_Handler' is continuously called which is calling the 'periph_init' function so that the gpio's state goes back to default state right after changing by BLE.
Could give me some advice about this?

Device:
PM_Dialog
Offline
Last seen:3 hours 54 min ago
Staff
Joined:2018-02-08 11:03
Hi Daekeun Yun,

Hi Daekeun Yun,

The BLE_WAKEUP_LP_Handler is called after the wake-up, and as you have already mentioned this handler executes the periph_init, so the gpio configuration before sleep is lost. If you want to keep the GPIO configuration after waking-up, you should add a flag into the function that you toggle the LED, and then check this flag into the periph_int() and configure the GPIO with the previous state.

Thanks, PM_Dialog

Daekeun Yun
Offline
Last seen:2 weeks 3 days ago
Joined:2015-05-27凌晨5
Thank you for your reply.

Thank you for your reply.
Even if I disable the sleep mode, still periph_init is called continuously.
Is there any reason for this?

da1458x_config_basic.h
#undef CFG_MEM_MAP_EXT_SLEEP
#undef CFG_MEM_MAP_DEEP_SLEEP

PM_Dialog
Offline
Last seen:3 hours 54 min ago
Staff
Joined:2018-02-08 11:03
Hi Daekeun Yun,

Hi Daekeun Yun,

Be aware that the deep sleep mode is not supported from the DSPS reference design application code. Only the active and extended sleep mode is supported. The macros that you have posted are not related with enabling/disabling neither the extended nor the deep sleep mode. In case you want to change the sleep mode, you should configure theapp_default_sleep_modevalue with the proper variable into theuser_config.hheader file.

  • Extended sleep mode configuration

const static sleep_state_t app_default_sleep_mode = ARCH_EXT_SLEEP_ON;

  • Active mode configuration

const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;

Thanks, PM_Dialog