Browse Source

update

master
zhaohe 1 year ago
parent
commit
15e74619f0
  1. 2
      app/src/app_event.h
  2. 5
      app/src/board/board.h
  3. 10
      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, //

5
app/src/board/board.h

@ -60,8 +60,9 @@
#define FILE_MAX_COUNT 1
#define SDCARD_MAX_FILE_SIZE (uint32_t)(3.5 * 1024 * 1024 * 1024)
//
#define SAMPLE_RATE 500
#define SAMPLE_PRECISION 24
#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))
#define APP_EVENT_QUEUE_SIZE 100

10
app/src/heart_wave_sample_service.c

@ -75,7 +75,7 @@ volatile static bool m_drop_state_triggered = false;
*******************************************************************************/
// READY_PIN
//static void ads1293_ready_pin_irq(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action);
// static void ads1293_ready_pin_irq(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action);
// BUFFER
static void prvf_buffer_switch(void);
@ -326,7 +326,7 @@ void ads1293_sample_one_frame();
void nrfx_timer_event_handler(nrf_timer_event_t event_type, void* p_context) { //
ads1293_sample_one_frame();
}
//static void ads1293_ready_pin_irq(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { ads1293_sample_one_frame(); }
// static void ads1293_ready_pin_irq(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { ads1293_sample_one_frame(); }
static void ads1293_sample_one_frame() {
if (!m_work_flag) {
return;
@ -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