Browse Source

Merge branch 'v1.0'

master
zhaohe 1 year ago
parent
commit
287302c2f7
  1. 3
      .vscode/settings.json
  2. 6
      app/app.uvoptx
  3. 2
      app/config/sdk_config.h
  4. 85
      app/main.c

3
.vscode/settings.json

@ -90,7 +90,8 @@
"nrf_uarte.h": "c",
"heart_rate_sensor_protocol.h": "c",
"ble_cmd_process_service.h": "c",
"heart_wave_sample_service.h": "c"
"heart_wave_sample_service.h": "c",
"device_info_mgr.h": "c"
},
"files.encoding": "gbk"
}

6
app/app.uvoptx

@ -75,7 +75,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
<IsCurrentTarget>0</IsCurrentTarget>
</OPTFL>
<CpuCode>5</CpuCode>
<DebugOpt>
@ -255,7 +255,7 @@
<OPTFL>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>5</CpuCode>
<DebugOpt>
@ -300,7 +300,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
<Name>-U685384569 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC4000 -FN2 -FF0nrf52xxx.flm -FS00 -FL0200000 -FP0($$Device:nRF52833_xxAA$Flash\nrf52xxx.flm) -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000 -FP1($$Device:nRF52833_xxAA$Flash\nrf52xxx_uicr.flm)</Name>
<Name>-U150710864 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC4000 -FN2 -FF0nrf52xxx.flm -FS00 -FL0200000 -FP0($$Device:nRF52833_xxAA$Flash\nrf52xxx.flm) -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000 -FP1($$Device:nRF52833_xxAA$Flash\nrf52xxx_uicr.flm)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>

2
app/config/sdk_config.h

@ -7794,7 +7794,7 @@
// <268435456=> 1000000 baud
#ifndef NRF_LOG_BACKEND_UART_BAUDRATE
#define NRF_LOG_BACKEND_UART_BAUDRATE 251658240
#define NRF_LOG_BACKEND_UART_BAUDRATE 30801920
#endif
// <o> NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings.

85
app/main.c

@ -8,12 +8,10 @@
#include <stdlib.h>
#include <string.h>
//
#include "app_uart.h"
#include "basic/ssd1306/driver_ssd1306_basic.h"
#include "basic\zdatachannel_service.h"
#include "one_conduction/one_conduction_board.h"
#include "one_conduction/one_conduction_main.h"
#include "three_lead\three_lead_board.h"
#include <math.h>
#include "app_scheduler.h"
#include "znordic.h"
#if defined(UART_PRESENT)
#include "nrf_uart.h"
@ -22,10 +20,81 @@
#include "nrf_uarte.h"
#endif
#if 1
#if 0
int main() {
one_conduction_main();
return 0;
}
#endif
#if 0
extern uint32_t g_nrf_log_tx_pin;
APP_TIMER_DEF(m_report_timer); //
static void tmr_cb(void* p_context) { //
ZLOGI("%d", SingleLeadECG_ecg_plod_get_ecg_val());
}
void main() {
APP_SCHED_INIT(APP_TIMER_SCHED_EVENT_DATA_SIZE, 20);
g_nrf_log_tx_pin = 41;
znordic_init();
NRF_LOG_INFO("compile time :%s", __TIME__);
SingleLeadECG_adc_module_init();
ZERROR_CHECK(app_timer_create(&m_report_timer, APP_TIMER_MODE_REPEATED, tmr_cb));
ZERROR_CHECK(app_timer_start(m_report_timer, APP_TIMER_TICKS(5), NULL));
znordic_loop();
}
#endif
/*******************************************************************************
* 3-ADS1293- *
*******************************************************************************/
extern uint32_t g_nrf_log_tx_pin;
APP_TIMER_DEF(m_test_tx_timer);
ZDATACHANNEL_DEF(m_zhrs, 2 /*回调事件优先??*/, 1 /*client num*/);
static void zdatachannel_data_handler(zdatachannel_evt_t* p_evt) {}
static void zdatachanel_send_log(const char* fmt, ...) {
static char tx[256] = {0};
static uint16_t len = 0;
va_list args;
va_start(args, fmt);
len = vsprintf(tx, fmt, args);
zdatachannel_data_send((uint8_t*)tx, &len);
va_end(args);
}
static void test_tx_timer_cb(void* p_context) {
zdatachanel_send_log("%d\n", SingleLeadECG_ecg_plod_get_ecg_val());
}
static void on_service_init(void) {
/**
* @brief
*/
ZLOGI("init zdatachannel service");
zdatachannel_init_t zdatachannle_init;
memset(&zdatachannle_init, 0, sizeof(zdatachannle_init));
zdatachannle_init.data_handler = zdatachannel_data_handler;
ZERROR_CHECK(zdatachannel_init(&m_zhrs, &zdatachannle_init));
}
void main() {
APP_SCHED_INIT(APP_TIMER_SCHED_EVENT_DATA_SIZE, 20);
znordic_init(0, 20);
NRF_LOG_INFO("compile time :%s", __TIME__);
static zble_module_cfg_t cfg = //
{
.deviceName = "ecg_test",
.on_service_init = on_service_init,
};
zble_module_init(&cfg);
SingleLeadECG_adc_module_init();
ZERROR_CHECK(app_timer_create(&m_test_tx_timer, APP_TIMER_MODE_REPEATED, test_tx_timer_cb));
ZERROR_CHECK(app_timer_start(m_test_tx_timer, APP_TIMER_TICKS(5), NULL));
zble_module_start_adv();
znordic_loop();
}
Loading…
Cancel
Save