From b1637a13be56707184a82e90473acb0f7be18913 Mon Sep 17 00:00:00 2001 From: wangfq Date: Mon, 20 Jul 2026 08:34:29 +0800 Subject: [PATCH] =?UTF-8?q?variation=20int16=5Ft=20->=20int32=5Ft,=20BLE?= =?UTF-8?q?=E4=B8=8A=E6=8A=A52=E5=AD=97=E8=8A=82->3=E5=AD=97=E8=8A=82?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89=C2=B132767=E6=88=AA=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BLE/DLD110S_Peripheral_28K/APP/dbn_ble_srv.c | 1 + BLE/DLD110S_Peripheral_28K/APP/include/storage.h | 2 +- BLE/DLD110S_Peripheral_28K/APP/peripheral_main.c | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) 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; }