diff --git a/BLE/DLD110S_Peripheral_28K/APP/dbn_ble_srv.c b/BLE/DLD110S_Peripheral_28K/APP/dbn_ble_srv.c index f134859..40f74c7 100644 --- a/BLE/DLD110S_Peripheral_28K/APP/dbn_ble_srv.c +++ b/BLE/DLD110S_Peripheral_28K/APP/dbn_ble_srv.c @@ -516,6 +516,7 @@ void usart_packet_processing_acs_loop(uint8_t flag) g_tmp_report_buf.buf[i++] = (uint8_t)g_loop_acs_info.variation; g_tmp_report_buf.buf[i++] = (g_loop_acs_info.variation >> 8) % 0x100; + g_tmp_report_buf.buf[i++] = (g_loop_acs_info.variation >> 16) % 0x100; g_tmp_report_buf.len = i; diff --git a/BLE/DLD110S_Peripheral_28K/APP/include/storage.h b/BLE/DLD110S_Peripheral_28K/APP/include/storage.h index dd8e8f4..03c8b43 100644 --- a/BLE/DLD110S_Peripheral_28K/APP/include/storage.h +++ b/BLE/DLD110S_Peripheral_28K/APP/include/storage.h @@ -163,7 +163,7 @@ typedef struct _LOOP_ACS_INFO uint8_t flag_change; uint32_t frequent; uint32_t loop_capvd; - int16_t variation; + int32_t variation; uint32_t event_counter; uint32_t report_counter; } Loop_ACS_Info; diff --git a/BLE/DLD110S_Peripheral_28K/APP/peripheral_main.c b/BLE/DLD110S_Peripheral_28K/APP/peripheral_main.c index 400fdcb..15f492f 100644 --- a/BLE/DLD110S_Peripheral_28K/APP/peripheral_main.c +++ b/BLE/DLD110S_Peripheral_28K/APP/peripheral_main.c @@ -581,9 +581,7 @@ void vd1_task(void){ if (g_loop_acs_info.flag_change == 0) { int32_t _var = (int32_t)loop1_Origin - (int32_t)loop1_CAPVD; g_loop_acs_info.loop_capvd = loop1_CAPVD; - if (_var > 32767) _var = 32767; - if (_var < -32768) _var = -32768; - g_loop_acs_info.variation = (int16_t)_var; + g_loop_acs_info.variation = _var; if (g_flag_bt_state && (_var > VARIATION_EVENT_TH || _var < -VARIATION_EVENT_TH)) { g_loop_acs_info.flag_event = 1; }