From 678cda82efa03c875db392b738943f30812f0d55 Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Tue, 23 Apr 2024 19:45:13 +0800
Subject: [PATCH] 写上位机处理部分
---
Soft/system_general_para.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 54 insertions(+), 6 deletions(-)
diff --git a/Soft/system_general_para.h b/Soft/system_general_para.h
index d6e2459..7eae946 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,66 @@
} 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 __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 +182,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