From f0de07104a329cc2eb6d2e77a23214313e675034 Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Wed, 24 Apr 2024 17:35:15 +0800
Subject: [PATCH] 继续添加功能,包括RS485采集

---
 Soft/system_general_para.h |   64 +++++++++++++++++++++++++++++---
 1 files changed, 58 insertions(+), 6 deletions(-)

diff --git a/Soft/system_general_para.h b/Soft/system_general_para.h
index d6e2459..e510409 100644
--- a/Soft/system_general_para.h
+++ b/Soft/system_general_para.h
@@ -73,11 +73,6 @@
 } VALVE_LOCK_STATE_T; // ����״̬����
 
 
-
-//ͨ�ýṹ�����
-
-
-
 //�������ʹ�С��
 typedef enum
 {
@@ -86,13 +81,70 @@
 } BIG_OR_LITTLE_ENDIAN; // ����״̬����
 
 
+/*****************ͨ�ýṹ�����******************************/
+typedef struct
+{
+  __IO FlagStatus delay_flag;  // ��ʱʱ�䵽��־λ
+  __IO uint16_t delay_time; // ��ʱ����ʱ��
+} DELAY_SEC_TYPE_T;         // ��ʱʱ�����ͽṹ��
 
+typedef struct
+{
+
+  DELAY_SEC_TYPE_T gprs_timeout_para;     // GPRS��ʱʱ��
+  DELAY_SEC_TYPE_T sys_active_time;       // ϵͳ����ʱ��
+	DELAY_SEC_TYPE_T sys_restart_delay_time;// ϵͳ�������ӳ�ʱ��
+	DELAY_SEC_TYPE_T UC_active_time;       // ��λ������ʱ��
+} SYS_DELAY_SEC_PARA_T;
+
+
+
+
+
+
+
+/*****************ͨ�ú�******************************/
 #define	BCD_2_DECIMAL(__BCD__)	 ((__BCD__ / 16) * 10 + __BCD__ % 16)
 
 #define	DECIMAL_2_BCD(__DECIMAL__)	 ((__DECIMAL__ / 16) * 10 + __DECIMAL__ % 16)
 
 
+// ��С��ת��
+#define BSWAP_16(x) ((x & 0x00ff) << 8) | \
+                        ((x & 0xff00) >> 8)
 
+#define BSWAP_32(x) ((x & 0xff000000) >> 24) |    \
+                        ((x & 0x00ff0000) >> 8) | \
+                        ((x & 0x0000ff00) << 8) | \
+                        ((x & 0x000000ff) << 24)
+
+
+#define BSWAP_64(x) ((x & 0xff00000000000000) >> 56) |     \
+                        ((x & 0x00ff000000000000) >> 40) | \
+                        ((x & 0x0000ff0000000000) >> 24) | \
+                        ((x & 0x000000ff00000000) >> 8) |  \
+                        ((x & 0x00000000ff000000) << 8) |  \
+                        ((x & 0x0000000000ff0000) << 24) | \
+                        ((x & 0x000000000000ff00) << 40) | \
+                        ((x & 0x00000000000000ff) << 56)
+
+/*�ó��ṹ���Աƫ�����ʹ�С*/
+#define OFFSET_OF(type, member) ((size_t) & (((type *)0))->member)
+#define SIZEOF_OF(type, member) (sizeof(((type *)0))->member)
+
+
+// ϵͳͨ���ӳ�ʱ������
+#define __SYS_DELAY_SEC_TIME_SET_(__HANDLE__, __NUMBER__) ((&sys_delay_sec_para_g)->__HANDLE__.delay_time = __NUMBER__)
+
+// ϵͳͨ���ӳ�ʱ���ȡ
+#define __SYS_DELAY_SEC_TIME_GET_(__HANDLE__)	((&sys_delay_sec_para_g)->__HANDLE__.delay_time)
+
+// ϵͳͨ���ӳٱ�־λget
+#define __SYS_DELAY_SEC_FLAG_GET(__HANDLE__) ((&sys_delay_sec_para_g)->__HANDLE__.delay_flag)
+// ϵͳͨ���ӳٱ�־λ����
+#define __SYS_DELAY_SEC_FLAG_SET_(__HANDLE__) ((&sys_delay_sec_para_g)->__HANDLE__.delay_flag = SET)
+// ϵͳͨ���ӳٱ�־λ���
+#define __SYS_DELAY_SEC_FLAG_CLEAR_(__HANDLE__) ((&sys_delay_sec_para_g)->__HANDLE__.delay_flag = RESET)
 
 
 
@@ -134,7 +186,7 @@
 //extern uint8_t read_data_buf_C_l[200];
 
 extern __IO FlagStatus sys_run_period; // ϵͳ��������
-
+extern SYS_DELAY_SEC_PARA_T sys_delay_sec_para_g;
 
 
 

--
Gitblit v1.9.3