Commit 74dc9945 authored by 李俭双's avatar 李俭双

🐞 fix:代码评审问题:增加结构体对齐,增加零件号注释

parent 6cf5692e
......@@ -2,7 +2,7 @@
#define _BACKLIGHT_H_
#include "common.h"
#include "Application.h"
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint8_t Duty;
uint8_t Cycle;
......
......@@ -22,7 +22,7 @@ Bus-off
#define RSCAN0_BUS_OFF_LV1_RECOVERY_TIME 90U
#define RSCAN0_BUS_OFF_LV2_RECOVERY_TIME 1000U
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint8_t Status;
uint8_t Timer;
......
......@@ -2,8 +2,8 @@
#define _COMMON_INTERFACE_H_
#include "Components.h"
#define TY200_080000b 0
#define TY200_080000b_ty 1
#define TY200_080000b 0 //不带胎压功能 TY100
#define TY200_080000b_ty 1 //带胎压功能 TY200
#define IC_Current TY200_080000b_ty //选择当前程序为哪个零件号的仪表
......
......@@ -3,7 +3,7 @@
#include "common.h"
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint8_t Buffer[30];
uint8_t Cnt;
......
......@@ -28,7 +28,7 @@ typedef uint32_t (*FaultCodeCallback)(void); /* 故障码回调函数 */
typedef uint16_t (*FaultCodeNumback)(void); /* 故障码个数回调函数 */
typedef uint16_t (*FaultCodeValidback)(void); /* 故障码有效回调函数 */
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint32_t u16FaultCode; /* 故障码 */
uint16_t u16FaultCodeCount; /* 故障码总数 */
......@@ -36,7 +36,7 @@ typedef struct
typedef struct
typedef struct __attribute__((aligned(4)))
{
FaultCodeCallback callbacks[NUM_FAULT_TYPES];
FaultCodeNumback FaultCodeNumCbk;
......
......@@ -5,13 +5,13 @@
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint16_t value;
uint8_t segNum;
}PowerSegMap_st_t;
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint16_t value;
uint8_t segNum;
......@@ -19,7 +19,7 @@ typedef struct
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint16_t Year;
uint8_t Month;
......
......@@ -5,13 +5,13 @@
#include "common.h"
#include "rtc.h"
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint16_t Back_Time_Left;
uint8_t Back_Time_Left_Flag;
}_Menu_Infor;
typedef struct
typedef struct __attribute__((aligned(4)))
{
uint8_t Set_Hour;
uint8_t Set_Minute;
......
......@@ -29,7 +29,7 @@ typedef void (*LEDDriver_ShutdownPin_Set)(LED_Driver_uint8_t u8Level);
typedef void (*LEDDriver_Feed_Dog)(void);
typedef void (*LEDDriver_Delay_10us)(LED_Driver_uint16_t u16Count);
typedef struct
typedef struct __attribute__((aligned(4)))
{
/*芯片数量*/
LED_Driver_uint8_t u8LEDDriverChipNum;
......
......@@ -33,7 +33,7 @@ typedef Linelib_uint16_t (*LineIn_GetPowerMode)(void);
* @brief 硬线去抖属性结构体 \n
* 定义报接收文属性
*/
typedef struct
typedef struct __attribute__((aligned(4)))
{
Linelib_uint8_t DefaultLevel; /**< 初始电平 LEVEL_LOW /LEVEL_HIGH */
Linelib_uint8_t TriggerLevel; /**< 触发电平 LEVEL_LOW /LEVEL_HIGH */
......
......@@ -3,7 +3,7 @@
#include "Components.h"
#include "Application.h"
__attribute__((aligned(4)))
const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_TurnLeft, },
......
......@@ -43,7 +43,7 @@ typedef Power_Status_em (*pfunc_Power_ON)(void);
typedef Power_Status_em (*pfunc_Power_SLEEP)(void);
typedef Power_Status_em (*pfunc_Power_LIM)(void);
typedef struct
typedef struct __attribute__((aligned(4)))
{
pfunPower_KL30_Init Pwr_KL30_Init;
pfunPower_IG_OFF_Init Pwr_IG_OFF_Init;
......
......@@ -32,7 +32,7 @@ typedef Intlib_uint32_t (*Int_ReadODO)(void);
typedef void (*Int_EEPromWrite)(Intlib_uint32_t u32Data [], Intlib_uint16_t u16Len);
typedef void (*Int_EEPromRead)(Intlib_uint32_t u32Data [], Intlib_uint16_t u16Len);
typedef struct
typedef struct __attribute__((aligned(4)))
{
Int_PowerSts PowerSts_Cbk; /**< 获取系统电源状态回调 */
Int_ReadODO ReadODO_Cbk; /**< 获取当前总计里程回调 */
......@@ -40,7 +40,7 @@ typedef struct
Int_EEPromRead EEPromRead_Cbk; /**< 从EEPROM读取保养相关数据回调 */
} Maintain_Func_t;
typedef struct
typedef struct __attribute__((aligned(4)))
{
Intlib_uint32_t IntervalDayEnable; /**< 保养天数功能使能,0:无此功能 1:使能 */
Intlib_uint32_t IntervalKm; /**< 系统设定的保养里程间隔,单位km,这里特指首次保养的里程间隔,如不区分首次,则为默认值 */
......
......@@ -47,7 +47,7 @@ typedef monitorlib_uint8_t (*Get_LineInStatus)(void);
typedef void (*COMMON_Delay)(monitorlib_uint32_t mMs);
typedef void (*pfunLogic)(void);
typedef struct
typedef struct __attribute__((aligned(4)))
{
Get_Voltage_Vaild SysGet_KL30_Valid;
Get_Voltage_Vaild SysGet_KL15_Valid;
......
......@@ -47,6 +47,7 @@ Tellib_uint16_t Battery_Voltage_valid = 0;
Tellib_uint8_t LED_TCS_STATE = 0;
Tellib_uint8_t LED_TCS_CUR_STATE = 0;
Tellib_uint8_t LED_TCS_VALUE = 0;
__align(4)
const LED_Attribute_st LED_Attribute [ LED_Max ] = {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment