Browse Source

update

master
zhaohe 1 year ago
parent
commit
466d3469d6
  1. 2
      app/src/board/board.h
  2. 11
      app/src/one_conduction_main.c

2
app/src/board/board.h

@ -28,7 +28,7 @@
#define MAX_FILE_NUM 10 // 最多存储条目数
#define SAMPLE_RATE 500 // 采样率
#define SAMPLE_PRECISION 12 // 采样精度
#define AUTOMATIC_SLEEP_TIME 30000 // 开机后自动休眠时间
#define AUTOMATIC_SLEEP_TIME 5000 // 开机后自动休眠时间
#define SAMPLE_MIN_TIME_S (30.0) // 采样最小时间
#define LITTLE_DATA_BLOCK_FRAME_NUM 5 // 每次多少帧上报一次

11
app/src/one_conduction_main.c

@ -59,11 +59,11 @@ static void power_on() {
return;
}
hwss_init();
BoardBeepCtrl_load();
BoardEcgSensor_load();
BoardBattery_load();
SingleLeadECG_led_init();
hwss_init();
sample_data_mgr_init();
dsp_mgr_init();
@ -72,6 +72,7 @@ static void power_on() {
m_poweronflag = true;
}
static void power_off() {
if (!m_poweronflag) return;
dsp_mgr_uninit();
sample_data_mgr_uninit();
hwss_uninit();
@ -137,7 +138,7 @@ void ENTER_DEEP_SLEEP() {
BoardBattery_sence_gpio_init_before_sleep();
// nrf_sdh_disable_request();
app_timer_stop_all();
nrf_sdh_disable_request();
// nrf_sdh_disable_request();
sd_power_system_off();
NVIC_SystemReset();
}
@ -168,9 +169,9 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) {
}
// 10RTC未被设置过
else if (ds_cur_state_haspassed_ms() >= 10000) {
else if (ds_cur_state_haspassed_ms() >= 2000) {
if (!znordic_rtc_has_setted()) {
// ENTER_DEEP_SLEEP();
ENTER_DEEP_SLEEP();
}
}
}
@ -381,6 +382,6 @@ void one_conduction_main() {
ZERROR_CHECK(app_timer_create(&m_state_machine_driver_tmr, APP_TIMER_MODE_REPEATED, state_machine_driver_tmr_cb));
ZERROR_CHECK(app_timer_start(m_state_machine_driver_tmr, APP_TIMER_TICKS(300), NULL));
state_machine__change_to_standby_state();
state_machine__change_to_poweroning_state();
znordic_loop();
}
Loading…
Cancel
Save