Browse Source

update

master
zhaohe 1 year ago
parent
commit
e925a9bd99
  1. 2
      app/app.uvoptx
  2. 5
      app/src/device_ctrl_service.c
  3. 3
      app/src/heart_wave_sample_service.c

2
app/app.uvoptx

@ -73,7 +73,7 @@
<LExpSel>0</LExpSel> <LExpSel>0</LExpSel>
</OPTXL> </OPTXL>
<OPTFL> <OPTFL>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget> <IsCurrentTarget>1</IsCurrentTarget>
</OPTFL> </OPTFL>

5
app/src/device_ctrl_service.c

@ -167,10 +167,15 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { //
// //
else if (m_device_state == kdevice_state_ready) { else if (m_device_state == kdevice_state_ready) {
/*******************************************************************************
* ÓÀ²»ÐÝÃß *
*******************************************************************************/
#if 0
if (!zble_module_is_connected() && DeviceCtrl_cur_state_haspassed_ms() > APP_AUTO_SLEEP_TIMEOUT_MS) { if (!zble_module_is_connected() && DeviceCtrl_cur_state_haspassed_ms() > APP_AUTO_SLEEP_TIMEOUT_MS) {
ZLOGI("auto sleep"); ZLOGI("auto sleep");
prvf_change_to_standby_state(); prvf_change_to_standby_state();
} }
#endif
if (event->eventType == kevent_start_sample_cmd_event) { if (event->eventType == kevent_start_sample_cmd_event) {
ZLOGI("start sample"); ZLOGI("start sample");

3
app/src/heart_wave_sample_service.c

@ -403,7 +403,7 @@ void hwss_init(void) {
*/ */
nrfx_err_t err; nrfx_err_t err;
nrfx_timer_config_t timer_cfg = { nrfx_timer_config_t timer_cfg = {
.frequency = NRF_TIMER_FREQ_125kHz,
.frequency = NRF_TIMER_FREQ_250kHz,
.mode = NRF_TIMER_MODE_TIMER, .mode = NRF_TIMER_MODE_TIMER,
.bit_width = NRF_TIMER_BIT_WIDTH_24, .bit_width = NRF_TIMER_BIT_WIDTH_24,
.p_context = NULL, .p_context = NULL,
@ -417,6 +417,7 @@ void hwss_init(void) {
ZASSERT(SAMPLE_RATE == 400); ZASSERT(SAMPLE_RATE == 400);
uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&m_timer, 5); // 200HZ uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&m_timer, 5); // 200HZ
ZLOGI("timer_ticks:%d\n", timer_ticks);
ZASSERT(timer_ticks % 2 == 0); // ZASSERT(timer_ticks % 2 == 0); //
timer_ticks = timer_ticks / 2; // 400HZ timer_ticks = timer_ticks / 2; // 400HZ
nrfx_timer_extended_compare(&m_timer, NRF_TIMER_CC_CHANNEL0, timer_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true); nrfx_timer_extended_compare(&m_timer, NRF_TIMER_CC_CHANNEL0, timer_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);

Loading…
Cancel
Save