Browse Source

fix 烧录器 烧录后无法进入睡眠的BUG

master
zhaohe 1 year ago
parent
commit
d7f0bb5d1c
  1. 4
      app/config/sdk_config.h
  2. 2
      app/src/board/board_button.c
  3. 24
      app/src/device_ctrl_service.c
  4. 2
      dynamic_electrocardiograph_ble_server
  5. 3
      scripter/unlock.bat
  6. 2
      sdk

4
app/config/sdk_config.h

@ -7734,7 +7734,7 @@
// <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
//==========================================================
#ifndef NRF_LOG_BACKEND_RTT_ENABLED
#define NRF_LOG_BACKEND_RTT_ENABLED 1
#define NRF_LOG_BACKEND_RTT_ENABLED 0
#endif
// <o> NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings.
// <i> Size of the buffer is a trade-off between RAM usage and processing.
@ -7812,7 +7812,7 @@
// <e> NRF_LOG_ENABLED - nrf_log - Logger
//==========================================================
#ifndef NRF_LOG_ENABLED
#define NRF_LOG_ENABLED 1
#define NRF_LOG_ENABLED 0
#endif
// <h> Log message pool - Configuration of log message pool

2
app/src/board/board_button.c

@ -29,6 +29,6 @@ void BoardButton_unload() {
void BoardButton_enable_sense() {
// app_button_disable();
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW);
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
// nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
}

24
app/src/device_ctrl_service.c

@ -10,6 +10,7 @@
#include "sample_data_manager_service.h"
#include "zble_module.h"
#include "zdatachannel_service.h"
#include "znordic.h"
//
APP_TIMER_DEF(m_state_machine_driver_tmr); //
static device_state_t m_device_state = kdevice_state_standby; //
@ -60,6 +61,17 @@ static void zble_event_listener(zble_event_t* ble_event) { //
*******************************************************************************/
static bool m_ispoweron = false;
// static bool m_drop_state_triggered = false;
void ENTER_DEEP_SLEEP() {
// 使
BoardButton_enable_sense();
// nrf_sdh_disable_request();
app_timer_stop_all();
nrf_sdh_disable_request();
sd_power_system_off();
NVIC_SystemReset();
}
static void poweroff() {
if (!m_ispoweron) return;
BoardBeepCtrl_unload();
@ -75,10 +87,8 @@ static void poweroff() {
BoardLight_setGreenLightEffect(kLightEffect_close);
app_timer_stop_all();
// 使
BoardButton_enable_sense();
sd_power_system_off();
NVIC_SystemReset();
m_ispoweron = false;
ENTER_DEEP_SLEEP();
}
static void poweron() {
if (m_ispoweron) {
@ -302,11 +312,7 @@ void DeviceCtrl_init() {
BoardLight_blockFlash(3, 100);
// ,使
BoardButton_enable_sense();
app_timer_stop_all();
sd_power_system_off();
NVIC_SystemReset();
m_ispoweron = false;
ENTER_DEEP_SLEEP();
}
//

2
dynamic_electrocardiograph_ble_server

@ -1 +1 @@
Subproject commit d76e1d1de74faaca531d54fb588d229a1090d3eb
Subproject commit 39b1906033f9813f3f909ef0ce1cb7d7d5aa574b

3
scripter/unlock.bat

@ -1,3 +1,4 @@
nrfjprog --recover
nrfjprog --eraseall -f NRF52
nrfjprog -f nrf52 --memwr 0x10001208 --val 0x0000005A
nrfjprog -f nrf52 --memwr 0x10001208 --val 0x0000005A
nrfjprog --eraseall -f NRF52

2
sdk

@ -1 +1 @@
Subproject commit ae45a16c26284c5ac8495ae6838d96cf386deb8e
Subproject commit fe92ba7e68d80cc8a00bb48ae21a5c3573534910
Loading…
Cancel
Save