forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

jinlicong
2024-04-25 a12102b90bda2f409babc8c241bfc66118a8cb70
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;