Browse Source

add app_protocols

hardware_test_b
zhaohe 11 months ago
parent
commit
92dd3237c2
  1. 5
      .gitmodules
  2. 2
      .vscode/settings.json
  3. 82
      README.md
  4. 42
      app/src/acid_dispenser_ble_slave_main.c
  5. 1
      app_protocols
  6. 1
      release/test_version/README.md
  7. 17931
      release/test_version/one_lead_ecg_test_v1.hex
  8. BIN
      release/test_version/one_lead_ecg_test_v1.zip
  9. BIN
      release/test_version/心电上位机V2.exe
  10. BIN
      release/test_version/心电测试上位机.zip
  11. 16706
      release/v6/one_lead_ecg_ads1291.hex
  12. BIN
      release/v6/one_lead_ecg_ads1291.zip

5
.gitmodules

@ -12,4 +12,7 @@
url = zwsd@192.168.1.3:p_chinagoldgroup_hand_acid/blelib_libznordic.git
[submodule "protocol"]
path = protocol
url = zwsd@192.168.1.3:p_chinagoldgroup_hand_acid/hand_acid_ble_protocol.git
url = zwsd@192.168.1.3:p_chinagoldgroup_hand_acid/hand_acid_ble_protocol.git
[submodule "app_protocols"]
path = app_protocols
url = zwsd@192.168.1.3:p_chinagoldgroup_hand_acid/hand_acid_app_protocols.git

2
.vscode/settings.json

@ -224,5 +224,5 @@
"gstate.h": "c",
"event.h": "c"
},
// "files.encoding": "gbk"
"files.encoding": "gbk"
}

82
README.md

@ -1,4 +1,4 @@
# one_lead_ecg
# hand_acid_remoter_ble
```
@ -6,85 +6,5 @@ build_app.bat 编译应用程序
build_bootloader.bat 编译bootloader
flash_with_id.bat 烧录程序携带ID
```
```
0. 调试指示灯
1. 指示灯控制
2. 读取按键
3. 串口日志
手持-蓝牙
main:
1.启动广播
2.初始化串口
3.测试硬件
按键
指示灯
电池电量
台面-蓝牙
main:
2. 串口
3. IO状态输出
5. 蓝牙收发消息
...
```
1. 调试串口修改位置
1. 在sdk_config.h
```
```
全局状态:
连接,未连接
未设定,连续模式,点动模式
工作状态
enter:
{
设置工作状态为未设定状态
更新灯光效果
}
按键:
{
上报按键事件
}
connect:
{
更新灯光效果
}
disconnect:
{
更新灯光效果
}
state_and_mode_change:
{
更新灯光效果
}
loop:
{
超时休眠
心跳报
}
休眠状态
按键事件--->
切换状态到工作状态
按键监听:
灯光效果更新:
```

42
app/src/acid_dispenser_ble_slave_main.c

@ -49,7 +49,7 @@ static int32_t m_last_usr_operation_time = 0;
void on_zapp_ebus_event(void* p_event_data, uint16_t event_size);
/***********************************************************************************************************************
* *
* *
***********************************************************************************************************************/
void on_zble_event(zble_event_t* event) {
static app_event_t appevent;
@ -63,7 +63,7 @@ void on_zble_event(zble_event_t* event) {
}
}
/***********************************************************************************************************************
* *
* *
***********************************************************************************************************************/
void one_conduction_process_rx_packet(uint8_t* rx, int len) {
hand_acid_ble_proto_t* rxheader = (hand_acid_ble_proto_t*)rx;
@ -132,7 +132,7 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) {
}
/***********************************************************************************************************************
* *
* *
***********************************************************************************************************************/
static void nrf_gpio_set_rgb(uint8_t r, uint8_t g, uint8_t b) {
@ -144,25 +144,25 @@ static void nrf_gpio_set_rgb(uint8_t r, uint8_t g, uint8_t b) {
static void update_light_state() {
/**
* @brief
* :
* :
* :
* :
* :
* :
* :
* :
* :绿
* 线 :
*
*/
if (zapp_state_machine_now_state() == kstate_standby) {
//
//
nrf_gpio_set_rgb(0, 0, 0);
} else {
if (g_connected) { //
if (g_connected) { //
if (g_hand_acid_mode == khand_acid_m_jog_mode) {
nrf_gpio_set_rgb(0, 0, 1); //
nrf_gpio_set_rgb(0, 0, 1); //
} else if (g_hand_acid_mode == khand_acid_m_continuous_mode) {
nrf_gpio_set_rgb(0, 1, 0); //
nrf_gpio_set_rgb(0, 1, 0); //
} else if (g_hand_acid_mode == khand_acid_m_unset_mode) {
nrf_gpio_set_rgb(1, 1, 1); //
nrf_gpio_set_rgb(1, 1, 1); //
}
} else {
nrf_gpio_set_rgb(1, 0, 0);
@ -266,9 +266,9 @@ void on_zapp_ebus_event(void* p_event_data, uint16_t event_size) {
}
/***********************************************************************************************************************
* *
* *
***********************************************************************************************************************/
APP_TIMER_DEF(m_key_monitor_tmr); //
APP_TIMER_DEF(m_key_monitor_tmr); //
bool key_read_acid_state() {
uint32_t val = nrf_gpio_pin_read(ADD_ACID_KEY);
if (val == 0) {
@ -298,21 +298,21 @@ typedef struct {
static void process_key(key_t* key) {
static app_event_t event;
bool nowState = key->read_key_state(); //
bool nowState = key->read_key_state(); //
if (nowState != key->keystate) {
//
//
m_last_usr_operation_time = znordic_getpower_on_ms();
if (nowState) {
key->longPress = false;
key->pressing = true;
key->pressTicket = znordic_getpower_on_ms();
}
//
//
if (!nowState) {
if (!key->longPress) {
event.eventType = kappevent_key_pressed;
event.val.keyid = key->keid; //
event.val.keyid = key->keid; //
zapp_ebus_push_event(&event);
}
key->pressing = false;
@ -323,7 +323,7 @@ static void process_key(key_t* key) {
if (znordic_haspassed_ms(key->pressTicket) > m_longpress_trigger_time) {
key->longPress = true;
event.eventType = kappevent_key_long_pressed;
event.val.keyid = key->keid; //
event.val.keyid = key->keid; //
zapp_ebus_push_event(&event);
}
}
@ -346,7 +346,7 @@ static void state_machine_driver_tmr_cb(void* p_context) { //
}
/***********************************************************************************************************************
* *
* *
***********************************************************************************************************************/
static void board_init() {

1
app_protocols

@ -0,0 +1 @@
Subproject commit dbdfce1070c28400346d455da9862c34c767d4fc

1
release/test_version/README.md

@ -1 +0,0 @@
用于测试ads1291驱动的功能,支持修改ads1291寄存器等功能

17931
release/test_version/one_lead_ecg_test_v1.hex
File diff suppressed because it is too large
View File

BIN
release/test_version/one_lead_ecg_test_v1.zip

BIN
release/test_version/心电上位机V2.exe

BIN
release/test_version/心电测试上位机.zip

16706
release/v6/one_lead_ecg_ads1291.hex
File diff suppressed because it is too large
View File

BIN
release/v6/one_lead_ecg_ads1291.zip

Loading…
Cancel
Save