Browse Source

update

master
zhaohe 1 year ago
parent
commit
15e74619f0
  1. 2
      app/src/app_event.h
  2. 3
      app/src/board/board.h
  3. 6
      app/src/heart_wave_sample_service.c

2
app/src/app_event.h

@ -1,8 +1,8 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "board/board.h"
#define LITTLE_DATA_BLOCK_FRAME_NUM 4 // 每四帧回调一次
typedef enum {
kevent_sensor_drop = 0, //

3
app/src/board/board.h

@ -60,7 +60,8 @@
#define FILE_MAX_COUNT 1
#define SDCARD_MAX_FILE_SIZE (uint32_t)(3.5 * 1024 * 1024 * 1024)
//
#define SAMPLE_RATE 500
#define SAMPLE_RATE 400
#define LITTLE_DATA_BLOCK_FRAME_NUM 4 // 每两帧回调一次,对应100HZ
#define SAMPLE_PRECISION 24
#define APP_MAX_EVEN_SIZE MAX(APP_TIMER_SCHED_EVENT_DATA_SIZE, sizeof(app_event_t))

6
app/src/heart_wave_sample_service.c

@ -414,7 +414,11 @@ void hwss_init(void) {
if (err != NRFX_SUCCESS) {
NRF_LOG_ERROR("nrfx_timer_init failed with: %d\n", err);
}
uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&m_timer, 2); // 500HZ
ZASSERT(SAMPLE_RATE == 400);
uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&m_timer, 5); // 200HZ
ZASSERT(timer_ticks % 2 == 0); //
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);
}

Loading…
Cancel
Save