Hi Team,
I am working on the ble_app_peripheral project. The default sleep mode is set to ARCH_EXT_SLEEP_ON in user_config.h file. I am using a gpio which is configured as follows in set_pad_function() in periph_init() :
GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_4, OUTPUT, PID_GPIO, true);
Also, the state of this gpio is varied in the code using GPIO_SetActive and GPIO_SetInactive functions.
我们面临的问题是, the current state of the gpio was not retained each time the device wakes up from extended sleep. The issue was solved by configuring the gpio to the current state each time using the function
GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_4, OUTPUT, PID_GPIO, present_gpio_state) in set_pad_function() .
Is this the expected behaviour or is there any other means for making the gpios hold their current state during extended sleep.
Thanks,
Team Wisilica
嗨wisillica,
Yes, the 580 retains its state while in sleep mode, but as soon as it wakes up the periph_setup() executes in order to configure the pins, so they are set but in their default state, the solution to that is to keep the pin's state in your fw and reconfigure it in the periph_init() accordingly.
Thanks MT_dialog
Hi,
Why is it required to do a periph_init every time the chip wakes up from sleep? Removing this call will have any side effects?
Thanks,
Wisilica
Hi wisilica,
The periph_init() is invoked in the LP_Handler() of the system, is there a reason that you would like to remove the function ? In the 580 the state is retained and not the function of the pin, so as soon as you fall asleep the state will be retained but not the configuration and as soon as you wake up the 580 will have the default configuration of the pins without the periph_init().
Thanks MT_dialog