From b4f3ab2c995395ff2b61284d239758364784a51e Mon Sep 17 00:00:00 2001
From: stark1898y <1658608470@qq.com>
Date: Mon, 30 Dec 2024 10:15:27 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BB=93=E7=AE=A1=E5=BA=93?=
=?UTF-8?q?=E5=9C=B0=E5=9D=80=EF=BC=8CCH584M?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.cproject | 4 +--
.project | 2 +-
...TYQ_CH592F.wvproj => BLE_TYQ_CH584M.wvproj | Bin
BSP/inc/bsp_adc.h | 2 +-
BSP/inc/bsp_beep_led_emv.h | 2 +-
BSP/inc/bsp_flash.h | 2 +-
BSP/inc/bsp_i2c.h | 2 +-
BSP/inc/bsp_iwdg.h | 4 +--
BSP/inc/bsp_tim.h | 2 +-
BSP/inc/bsp_valve.h | 2 +-
BSP/src/bsp_flash.c | 2 +-
BSP/src/bsp_iwdg.c | 2 +-
BSP/src/bsp_tim.c | 2 +-
BSP/src/bsp_valve.c | 29 +++++++++++++++---
Profile/gattprofile.c | 4 +--
README.md | 5 +--
common/FlexibleButton-2.0.1/flexible_button.h | 2 +-
common/letter-shell/shell.c | 2 +-
common/letter-shell/shell.h | 2 +-
common/letter-shell/shell_companion.c | 2 +-
common/letter-shell/shell_ext.h | 2 +-
common/lwrb-3.2.0/lwrb.h | 2 +-
common/lwrb-3.2.0/lwrb_ex.c | 2 +-
23 files changed, 51 insertions(+), 29 deletions(-)
rename BLE_TYQ_CH592F.wvproj => BLE_TYQ_CH584M.wvproj (100%)
diff --git a/.cproject b/.cproject
index 665cf57..c07b59d 100644
--- a/.cproject
+++ b/.cproject
@@ -47,7 +47,7 @@
-
+
@@ -173,5 +173,5 @@
-
+
diff --git a/.project b/.project
index b2e792e..ec429be 100644
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
- BLE_TYQ_CH592F
+ BLE_TYQ_CH584M
diff --git a/BLE_TYQ_CH592F.wvproj b/BLE_TYQ_CH584M.wvproj
similarity index 100%
rename from BLE_TYQ_CH592F.wvproj
rename to BLE_TYQ_CH584M.wvproj
diff --git a/BSP/inc/bsp_adc.h b/BSP/inc/bsp_adc.h
index a1bd348..26457f8 100644
--- a/BSP/inc/bsp_adc.h
+++ b/BSP/inc/bsp_adc.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-08 12:20:47
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-08 12:20:47
- * @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_adc.h
+ * @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_adc.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/inc/bsp_beep_led_emv.h b/BSP/inc/bsp_beep_led_emv.h
index b34ca02..06fdd21 100644
--- a/BSP/inc/bsp_beep_led_emv.h
+++ b/BSP/inc/bsp_beep_led_emv.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-09 09:50:56
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-17 16:12:04
- * @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_beep_led_emv.h
+ * @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_beep_led_emv.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/inc/bsp_flash.h b/BSP/inc/bsp_flash.h
index f9d4078..5b79744 100644
--- a/BSP/inc/bsp_flash.h
+++ b/BSP/inc/bsp_flash.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 15:54:51
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-12 16:34:01
- * @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_flash.h
+ * @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_flash.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/inc/bsp_i2c.h b/BSP/inc/bsp_i2c.h
index 77b52e1..8e12447 100644
--- a/BSP/inc/bsp_i2c.h
+++ b/BSP/inc/bsp_i2c.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-15 15:42:00
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-16 20:50:17
- * @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_i2c.h
+ * @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_i2c.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/inc/bsp_iwdg.h b/BSP/inc/bsp_iwdg.h
index 70b167c..13a111c 100644
--- a/BSP/inc/bsp_iwdg.h
+++ b/BSP/inc/bsp_iwdg.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-15 16:13:37
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-15 16:13:37
- * @FilePath : \BLE_TYQ_CH592F - 副本\BSP\inc\bsp_iwdg.h
+ * @FilePath : \BLE_TYQ_CH584M - 副本\BSP\inc\bsp_iwdg.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
@@ -13,7 +13,7 @@
* @Date : 2024-12-14 10:51:01
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-15 11:16:24
- * @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_iwdg.h
+ * @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_iwdg.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/inc/bsp_tim.h b/BSP/inc/bsp_tim.h
index 4074919..8cdc917 100644
--- a/BSP/inc/bsp_tim.h
+++ b/BSP/inc/bsp_tim.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-15 15:01:15
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-15 16:24:28
- * @FilePath : \BLE_TYQ_CH592F - 副本\BSP\inc\bsp_tim.h
+ * @FilePath : \BLE_TYQ_CH584M - 副本\BSP\inc\bsp_tim.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/inc/bsp_valve.h b/BSP/inc/bsp_valve.h
index 6418892..6ba63c9 100644
--- a/BSP/inc/bsp_valve.h
+++ b/BSP/inc/bsp_valve.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 15:55:38
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-17 15:51:09
- * @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_valve.h
+ * @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_valve.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/src/bsp_flash.c b/BSP/src/bsp_flash.c
index f2c078f..47115f1 100644
--- a/BSP/src/bsp_flash.c
+++ b/BSP/src/bsp_flash.c
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 15:54:57
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-16 08:55:00
- * @FilePath : \BLE_TYQ_CH592F\BSP\src\bsp_flash.c
+ * @FilePath : \BLE_TYQ_CH584M\BSP\src\bsp_flash.c
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/src/bsp_iwdg.c b/BSP/src/bsp_iwdg.c
index a4c5f80..9edc0c5 100644
--- a/BSP/src/bsp_iwdg.c
+++ b/BSP/src/bsp_iwdg.c
@@ -3,7 +3,7 @@
* @Date : 2024-12-15 16:13:41
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-15 16:13:42
- * @FilePath : \BLE_TYQ_CH592F - 副本\BSP\src\bsp_iwdg.c
+ * @FilePath : \BLE_TYQ_CH584M - 副本\BSP\src\bsp_iwdg.c
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/src/bsp_tim.c b/BSP/src/bsp_tim.c
index f8f71c9..2577111 100644
--- a/BSP/src/bsp_tim.c
+++ b/BSP/src/bsp_tim.c
@@ -3,7 +3,7 @@
* @Date : 2024-12-15 15:01:15
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-15 16:24:32
- * @FilePath : \BLE_TYQ_CH592F - \BSP\src\bsp_tim.c
+ * @FilePath : \BLE_TYQ_CH584M - \BSP\src\bsp_tim.c
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/BSP/src/bsp_valve.c b/BSP/src/bsp_valve.c
index 27015f3..239fb68 100644
--- a/BSP/src/bsp_valve.c
+++ b/BSP/src/bsp_valve.c
@@ -2,8 +2,8 @@
* @Author : stark1898y 1658608470@qq.com
* @Date : 2024-12-15 15:01:15
* @LastEditors : stark1898y 1658608470@qq.com
- * @LastEditTime : 2024-12-17 16:12:13
- * @FilePath : \BLE_TYQ_CH592F\BSP\src\bsp_valve.c
+ * @LastEditTime : 2024-12-24 11:17:00
+ * @FilePath : \BLE_TYQ_CH584M\BSP\src\bsp_valve.c
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
@@ -360,13 +360,34 @@ static uint16_t VAVLE_Task_ProcessEvent(uint8_t task_id, uint16_t events)
BSP_RequestBoost();
logDebug("VAVLE_CLOSE_ACTION_EVT");
// 关阀动作,一定要先关充电的,防止其他12V用电
- EMV_CHARGE_OFF_DEINIT;
+ // EMV_CHARGE_OFF_DEINIT;
logDebug("EMV_CHARGE_OFF_DEINIT");
- BEEP_ON;
+ BOOST_EN;
+ EMV_CHARGE_EN;
+
+ DelayMs(10);
+
+ // BEEP_ON;
// EMV_CTRL
EMV_ON;
+ DelayMs(50);
+
+ {BEEP_OFF_DEINIT;
+
+ EMV_CHARGE_OFF_DEINIT;
+ EMV_OFF_DEINIT;
+
+ BSP_NoNeedBoost();
+
+ gValveData.switch_status = kClosed;
+
+ tmos_memset(&RelyData, 0, sizeof(RelyData));
+ BSP_VALVE_Generate_ValveResponse(&RelyData, kCmdCloseVavle, 1);
+
+ tmos_set_event(Peripheral_TaskID, SBP_REPLY_CMD_EVT);}
+
logDebug("EMV_ON");
tmos_start_task(vavle_task_id, VAVLE_CLOSE_END_EVT, MS1_TO_SYSTEM_TIME(100));
diff --git a/Profile/gattprofile.c b/Profile/gattprofile.c
index 88696e8..2e4a583 100644
--- a/Profile/gattprofile.c
+++ b/Profile/gattprofile.c
@@ -726,8 +726,8 @@ static void simpleProfile_HandleConnStatusCB(uint16_t connHandle, uint8_t change
}
}
-
-//ʹ֪ͨconnection_handleӾʾҪвӣ
+// https://www.cnblogs.com/ZYL-FS/p/17759138.html
+// ʹ֪ͨconnection_handleӾʾҪвӣ
uint8_t enable_notify(uint16_t connection_handle, uint8_t enable)
{
uint16_t cccd = 0; //һcccdֵ
diff --git a/README.md b/README.md
index a488e9b..a160610 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,9 @@
-# [BLE_TYQ_CH592F](https://gitee.com/SXDT-Embedded/ble_-tyq_-ch592-f)
+# [BLE_TYQ_CH584M](https://gitee.com/SXDT-Embedded/ble_-tyq_-ch592-f)
基于“CH592EVT_V1-4”
-


+
+2024-12-30更换为CH584M,加入电磁阀状态检测,BLE_TYQ_CH584M_V2-0
diff --git a/common/FlexibleButton-2.0.1/flexible_button.h b/common/FlexibleButton-2.0.1/flexible_button.h
index 2456610..833b2d2 100644
--- a/common/FlexibleButton-2.0.1/flexible_button.h
+++ b/common/FlexibleButton-2.0.1/flexible_button.h
@@ -3,7 +3,7 @@
* @Date : 2024-07-04 16:13:57
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-14 15:56:11
- * @FilePath : \BLE_TYQ_CH592F\common\FlexibleButton-2.0.1\flexible_button.h
+ * @FilePath : \BLE_TYQ_CH584M\common\FlexibleButton-2.0.1\flexible_button.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/common/letter-shell/shell.c b/common/letter-shell/shell.c
index cb4a4b0..31676d5 100644
--- a/common/letter-shell/shell.c
+++ b/common/letter-shell/shell.c
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 09:44:00
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-12 10:08:36
- * @FilePath : \BLE_TYQ_CH592F\common\letter-shell\shell.c
+ * @FilePath : \BLE_TYQ_CH584M\common\letter-shell\shell.c
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/common/letter-shell/shell.h b/common/letter-shell/shell.h
index 966c010..4b39e9e 100644
--- a/common/letter-shell/shell.h
+++ b/common/letter-shell/shell.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 09:44:00
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-12 10:08:31
- * @FilePath : \BLE_TYQ_CH592F\common\letter-shell\shell.h
+ * @FilePath : \BLE_TYQ_CH584M\common\letter-shell\shell.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/common/letter-shell/shell_companion.c b/common/letter-shell/shell_companion.c
index 5b2f599..21b4702 100644
--- a/common/letter-shell/shell_companion.c
+++ b/common/letter-shell/shell_companion.c
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 09:44:00
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-12 10:08:57
- * @FilePath : \BLE_TYQ_CH592F\common\letter-shell\shell_companion.c
+ * @FilePath : \BLE_TYQ_CH584M\common\letter-shell\shell_companion.c
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/common/letter-shell/shell_ext.h b/common/letter-shell/shell_ext.h
index 0063d87..83c12ed 100644
--- a/common/letter-shell/shell_ext.h
+++ b/common/letter-shell/shell_ext.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 09:44:00
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-12 10:08:47
- * @FilePath : \BLE_TYQ_CH592F\common\letter-shell\shell_ext.h
+ * @FilePath : \BLE_TYQ_CH584M\common\letter-shell\shell_ext.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/common/lwrb-3.2.0/lwrb.h b/common/lwrb-3.2.0/lwrb.h
index d72c7d1..e93a9be 100644
--- a/common/lwrb-3.2.0/lwrb.h
+++ b/common/lwrb-3.2.0/lwrb.h
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 09:44:00
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-12 13:34:24
- * @FilePath : \BLE_TYQ_CH592F\common\lwrb-3.2.0\lwrb.h
+ * @FilePath : \BLE_TYQ_CH584M\common\lwrb-3.2.0\lwrb.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
diff --git a/common/lwrb-3.2.0/lwrb_ex.c b/common/lwrb-3.2.0/lwrb_ex.c
index eec4819..2a168dc 100644
--- a/common/lwrb-3.2.0/lwrb_ex.c
+++ b/common/lwrb-3.2.0/lwrb_ex.c
@@ -3,7 +3,7 @@
* @Date : 2024-12-12 13:35:45
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-12 13:35:45
- * @FilePath : \BLE_TYQ_CH592F\common\lwrb-3.2.0\lwrb_ex.c
+ * @FilePath : \BLE_TYQ_CH584M\common\lwrb-3.2.0\lwrb_ex.c
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.