Commit d0dea94e authored by 张金硕's avatar 张金硕

Merge branch 'jinshuo' of...

Merge branch 'jinshuo' of http://tyw-server.synology.me:12345/shihao/haojin750tft into Beijixing_DemoShow
parents 78b956a0 6ddf8a84
...@@ -1028,16 +1028,16 @@ ...@@ -1028,16 +1028,16 @@
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\System_Monitor\System_Monitor_User.h</FilePath> <FilePath>..\..\..\..\Source\Component\System_Monitor\System_Monitor_User.h</FilePath>
</File> </File>
<File>
<FileName>keil_S1.0.8_20240924.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\keil_S1.0.8_20240924.lib</FilePath>
</File>
<File> <File>
<FileName>UartProtocol.h</FileName> <FileName>UartProtocol.h</FileName>
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath> <FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath>
</File> </File>
<File>
<FileName>UartProtocol_Test_BW121_Bat32_241219.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol_Test_BW121_Bat32_241219.lib</FilePath>
</File>
</Files> </Files>
</Group> </Group>
<Group> <Group>
......
...@@ -10,8 +10,9 @@ Light_uint16_t LightR_Status = 0; ...@@ -10,8 +10,9 @@ Light_uint16_t LightR_Status = 0;
Light_uint16_t LightR_Status_NCount = 0u; Light_uint16_t LightR_Status_NCount = 0u;
Light_uint16_t LightR_Status_DCount = 0u; Light_uint16_t LightR_Status_DCount = 0u;
Light_uint8_t NtcDataCount; Light_uint8_t NtcDataCount;
__align(4) /* 四字节对齐 */
Light_uint16_t NtcData[LIGHT_DATA_NUM] = {0}; Light_uint16_t NtcData[LIGHT_DATA_NUM] = {0};
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint8_t u8Lvl; uint8_t u8Lvl;
uint8_t Pos_Lamp_Sts; uint8_t Pos_Lamp_Sts;
...@@ -81,6 +82,7 @@ void BackLight_Back_PWM_Init(void) ...@@ -81,6 +82,7 @@ void BackLight_Back_PWM_Init(void)
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
} }
__align(4) /* 四字节对齐 */
uint16_t NTCDegreesBoard[] = uint16_t NTCDegreesBoard[] =
{ {
550, 550,
...@@ -95,6 +97,7 @@ uint16_t NTCDegreesBoard[] = ...@@ -95,6 +97,7 @@ uint16_t NTCDegreesBoard[] =
1000, 1000,
}; };
__align(4) /* 四字节对齐 */
uint16_t NTCResBoard[] = uint16_t NTCResBoard[] =
{ {
27091, 27091,
......
...@@ -39,6 +39,8 @@ extern void BackLight_Process(void); ...@@ -39,6 +39,8 @@ extern void BackLight_Process(void);
extern Light_uint8_t Backlight_GetPwmLevel(void); extern Light_uint8_t Backlight_GetPwmLevel(void);
extern void Data_Light_Res_service(Light_uint8_t deltaTime);
#endif #endif
...@@ -12,6 +12,8 @@ uint8_t LastCurIgnSt = POWER_STATE_IGN_OFF; ...@@ -12,6 +12,8 @@ uint8_t LastCurIgnSt = POWER_STATE_IGN_OFF;
uint8_t IOState = 0; uint8_t IOState = 0;
_PICID_Struct PicObj; _PICID_Struct PicObj;
_QRCODE_RECT QRCode_Rect; _QRCODE_RECT QRCode_Rect;
__align(4) /* 四字节对齐 */
const uint8_t HJBlueToothName[9]= {"HJ750"}; const uint8_t HJBlueToothName[9]= {"HJ750"};
uint8_t UUIDConfigBuf[21] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; uint8_t UUIDConfigBuf[21] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
//007502024092400000002 //007502024092400000002
...@@ -204,6 +206,7 @@ TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] = ...@@ -204,6 +206,7 @@ TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] =
}; };
__align(4) /* 四字节对齐 */
uint8_t PhoneNumber[40]; uint8_t PhoneNumber[40];
uint8_t LastPhoneNumber[20]; uint8_t LastPhoneNumber[20];
uint8_t LastBlueToothPhoneName[100]; uint8_t LastBlueToothPhoneName[100];
...@@ -243,10 +246,10 @@ void TextService(void) ...@@ -243,10 +246,10 @@ void TextService(void)
MCUVersionASCLLList[12] = DATA_Version[6]; MCUVersionASCLLList[12] = DATA_Version[6];
MCUVersionASCLLList[14] = DATA_Version[7]; MCUVersionASCLLList[14] = DATA_Version[7];
MCUVersionASCLLList[16] = 0x2E; MCUVersionASCLLList[16] = 0x2E;
MCUVersionASCLLList[18] = SW_Version[0]; MCUVersionASCLLList[18] = (uint8_t)((SWV >> 8u) & 0x0Fu) + 0x30u;
MCUVersionASCLLList[20] = 0x2E; MCUVersionASCLLList[20] = 0x2E;
MCUVersionASCLLList[22] = SW_Version[1]; MCUVersionASCLLList[22] = (uint8_t)((SWV >> 4u) & 0x0Fu) + 0x30u;
MCUVersionASCLLList[24] = SW_Version[2]; MCUVersionASCLLList[24] = (uint8_t)(SWV & 0x0Fu) + 0x30u;
memset(InformationOSVersion, 0, sizeof(InformationOSVersion)); memset(InformationOSVersion, 0, sizeof(InformationOSVersion));
......
...@@ -17,19 +17,18 @@ typedef enum { ...@@ -17,19 +17,18 @@ typedef enum {
TEXT_NUM_TOTAL, TEXT_NUM_TOTAL,
} TEXT_NUM_ENUM; } TEXT_NUM_ENUM;
typedef struct { typedef struct __attribute__((aligned(4)))
{
TEXT_NUM_ENUM TextNum; TEXT_NUM_ENUM TextNum;
uint16_t LableNum; uint16_t LableNum;
uint16_t Vaild; uint16_t Vaild;
}TEXT_STRUCT; }TEXT_STRUCT;
#define INFORMATION_VERSION_DATE "20241111" #define INFORMATION_VERSION_DATE "20241129"
#define SW_EXTERNAL_VERSION "100"
#define POWER_STATE_IGN_OFF 0u #define POWER_STATE_IGN_OFF 0u
#define POWER_STATE_IGN_ON 1u #define POWER_STATE_IGN_ON 1u
static const uint8_t DATA_Version[8] = {INFORMATION_VERSION_DATE}; static const uint8_t DATA_Version[8] = {INFORMATION_VERSION_DATE};
static const uint8_t SW_Version[3] = {SW_EXTERNAL_VERSION};
/*QRCode X Y height Width*/ /*QRCode X Y height Width*/
...@@ -58,4 +57,4 @@ extern TEXT_STRUCT TextPara[]; ...@@ -58,4 +57,4 @@ extern TEXT_STRUCT TextPara[];
extern uint8_t UUIDConfigBuf[21]; extern uint8_t UUIDConfigBuf[21];
extern uint8_t IOState; extern uint8_t IOState;
#endif #endif
\ No newline at end of file
...@@ -36,6 +36,17 @@ void Can_Init(void) ...@@ -36,6 +36,17 @@ void Can_Init(void)
*/ */
void Can_RX_Apply_Buff(void) void Can_RX_Apply_Buff(void)
{ {
CAN_RecvMsg.DLC = 8;
CAN_RecvMsg.Data[0] = 0;
CAN_RecvMsg.Data[1] = 0;
CAN_RecvMsg.Data[2] = 0;
CAN_RecvMsg.Data[3] = 0;
CAN_RecvMsg.Data[4] = 0;
CAN_RecvMsg.Data[5] = 0;
CAN_RecvMsg.Data[6] = 0;
CAN_RecvMsg.Data[7] = 0;
CAN_RecvMsg.OverWriteConfig = 0;
CAN_RecvMsg.Id = 0x101; CAN_RecvMsg.Id = 0x101;
CAN_RecvMsg.IDE = CAN_Id_Standard; CAN_RecvMsg.IDE = CAN_Id_Standard;
CAN_RecvMsg.CacheType = CAN_CacheType_Rx_NoMask; CAN_RecvMsg.CacheType = CAN_CacheType_Rx_NoMask;
...@@ -141,6 +152,16 @@ void Can_Tx_Apply_Buff(void) ...@@ -141,6 +152,16 @@ void Can_Tx_Apply_Buff(void)
// CAN_MessageCache_DeInit(CAN0MSG08); // CAN_MessageCache_DeInit(CAN0MSG08);
// CAN_MessageCache_Init(CAN0MSG08, &CAN_SendMsg); // CAN_MessageCache_Init(CAN0MSG08, &CAN_SendMsg);
CAN_SendMsg_Diag_Tx.Data[0] = 0;
CAN_SendMsg_Diag_Tx.Data[1] = 0;
CAN_SendMsg_Diag_Tx.Data[2] = 0;
CAN_SendMsg_Diag_Tx.Data[3] = 0;
CAN_SendMsg_Diag_Tx.Data[4] = 0;
CAN_SendMsg_Diag_Tx.Data[5] = 0;
CAN_SendMsg_Diag_Tx.Data[6] = 0;
CAN_SendMsg_Diag_Tx.Data[7] = 0;
CAN_SendMsg_Diag_Tx.OverWriteConfig = 0;
CAN_SendMsg_Diag_Tx.Id = DIAG_ID_Tx; CAN_SendMsg_Diag_Tx.Id = DIAG_ID_Tx;
CAN_SendMsg_Diag_Tx.IDE = CAN_Id_Standard; CAN_SendMsg_Diag_Tx.IDE = CAN_Id_Standard;
CAN_SendMsg_Diag_Tx.CacheType = CAN_CacheType_Tx; CAN_SendMsg_Diag_Tx.CacheType = CAN_CacheType_Tx;
......
...@@ -21,7 +21,7 @@ Bus-off ...@@ -21,7 +21,7 @@ Bus-off
#define RSCAN0_BUS_OFF_LV1_RECOVERY_TIME 90U #define RSCAN0_BUS_OFF_LV1_RECOVERY_TIME 90U
#define RSCAN0_BUS_OFF_LV2_RECOVERY_TIME 1000U #define RSCAN0_BUS_OFF_LV2_RECOVERY_TIME 1000U
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint8_t Status; uint8_t Status;
uint8_t Timer; uint8_t Timer;
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
#define FAST_TIME 15 //20*20 400ms变化一格 #define FAST_TIME 15 //20*20 400ms变化一格
#define NORMAL_TIME 500 //500*20 10s变化一格 #define NORMAL_TIME 500 //500*20 10s变化一格
#define Disconnected_TIME 1 //掉线时间 #define Disconnected_TIME 1 //掉线时间
#pragma ghs section bss = ".myNonInitArea" // #pragma ghs section bss = ".myNonInitArea"
//_Data_Cng Data_Cng_Percent; //_Data_Cng Data_Cng_Percent;
//_Data_Cng Data_Cng_Pressure; //_Data_Cng Data_Cng_Pressure;
Hys_uint8_t u8HysRamData[HYS_RAM_DATA_LEN]; Hys_uint8_t u8HysRamData[HYS_RAM_DATA_LEN];
#pragma ghs section bss = default // #pragma ghs section bss = default
DataCoolantTempStruct DataCoolantTemp ; DataCoolantTempStruct DataCoolantTemp ;
DataCoolantTempDisStruct DataCoolantTemp_Dis; DataCoolantTempDisStruct DataCoolantTemp_Dis;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define DATA_ESPEED_DAMPING_FACTOR 3 //阻尼系数 #define DATA_ESPEED_DAMPING_FACTOR 3 //阻尼系数
#define DATA_ESPEED_INC_STEP 30 //速度增加时慢加速速度变化步长 #define DATA_ESPEED_INC_STEP 30 //速度增加时慢加速速度变化步长
#define DATA_ESPEED_DEC_STEP 20 //方向改变时急减速速度变化步长 #define DATA_ESPEED_DEC_STEP 20 //方向改变时急减速速度变化步长
#define DATA_ESPEED_APPR_SPEED_MIN 20 //最小逼近速度 #define DATA_ESPEED_APPR_SPEED_MIN 180 //最小逼近速度
#define DATA_ESPEED_HYSTERESIS 80 //回差 #define DATA_ESPEED_HYSTERESIS 80 //回差
/*** 控制结构 ***/ /*** 控制结构 ***/
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define FUEL_SEG_UP 0u #define FUEL_SEG_UP 0u
#define FUEL_SEG_DOWN 1u #define FUEL_SEG_DOWN 1u
__align(4) /* 四字节对齐 */
uint16_t g_u16FuelData[FUEL_DATA_NUM]; uint16_t g_u16FuelData[FUEL_DATA_NUM];
uint8_t g_u8FuelDataCount = 0u; uint8_t g_u8FuelDataCount = 0u;
......
...@@ -101,4 +101,4 @@ uint8_t Get_OilPressureStauts(void) ...@@ -101,4 +101,4 @@ uint8_t Get_OilPressureStauts(void)
{ {
return 0u; return 0u;
} }
} }
\ No newline at end of file
...@@ -7,4 +7,4 @@ void Oil_Pressure_KL30_Init(void); ...@@ -7,4 +7,4 @@ void Oil_Pressure_KL30_Init(void);
void Oil_Pressure_KL15_Init(void); void Oil_Pressure_KL15_Init(void);
void Oil_R_Cal(uint8_t deltaTime); void Oil_R_Cal(uint8_t deltaTime);
uint8_t Get_OilPressureStauts(void); uint8_t Get_OilPressureStauts(void);
#endif #endif
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "CAN_CH0_CAN_Communication_Matrix.h" #include "CAN_CH0_CAN_Communication_Matrix.h"
FaultCodeList_t FaultCode_t; FaultCodeList_t FaultCode_t;
uint32_t FaultCodeList [MaxFaultCode]; uint32_t FaultCodeList [MaxFaultCode];
static uint8_t u8FaultCodeValid = 0; // static uint8_t u8FaultCodeValid = 0;
uint32_t Get_FaultCodeDtc1(void) uint32_t Get_FaultCodeDtc1(void)
{ {
uint32_t u16FaultCode = 0x0000; uint32_t u16FaultCode = 0x0000;
......
...@@ -40,6 +40,7 @@ void FaultCode_Servers(void); ...@@ -40,6 +40,7 @@ void FaultCode_Servers(void);
extern uint32_t Get_Current_FaultCode(void); extern uint32_t Get_Current_FaultCode(void);
extern uint8_t Get_Current_Hight_FaultCode(void); extern uint8_t Get_Current_Hight_FaultCode(void);
extern uint8_t Get_Current_Mid_FaultCode(void); extern uint8_t Get_Current_Mid_FaultCode(void);
extern uint8_t Get_FaultCode_Lost(void);
// extern uint8_t Get_FaultCode_Valid(void); // extern uint8_t Get_FaultCode_Valid(void);
#endif #endif
\ No newline at end of file
...@@ -20,7 +20,7 @@ void Gpio_Init(_GpioUser_Enum InitMode) ...@@ -20,7 +20,7 @@ void Gpio_Init(_GpioUser_Enum InitMode)
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN05, GpioOut_Low); //L_BiasBitSW 里程百位--- RTE_GPIO_Config(RTE_GPIO_PORT00_PIN05, GpioOut_Low); //L_BiasBitSW 里程百位---
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN06, GpioOut_Low); //L_BiasBitSW 里程千位--- RTE_GPIO_Config(RTE_GPIO_PORT00_PIN06, GpioOut_Low); //L_BiasBitSW 里程千位---
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN00, GpioOut_Low); //表盘背光-PWM RTE_GPIO_Config(RTE_GPIO_PORT01_PIN00, RTE_GPIO_DIR_IN); //表盘背光-PWM
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN01, GpioOut_Low); //RXD-ESP-IN-MCU RTE_GPIO_Config(RTE_GPIO_PORT01_PIN01, GpioOut_Low); //RXD-ESP-IN-MCU
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN02, GpioOut_Low); //TXD-ESP-IN-MCU RTE_GPIO_Config(RTE_GPIO_PORT01_PIN02, GpioOut_Low); //TXD-ESP-IN-MCU
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN03, RTE_GPIO_DIR_IN); RTE_GPIO_Config(RTE_GPIO_PORT01_PIN03, RTE_GPIO_DIR_IN);
......
...@@ -32,14 +32,14 @@ typedef enum ...@@ -32,14 +32,14 @@ typedef enum
HYS_OPERATE_SUCCESS = 0UL, /*函数操作成功*/ HYS_OPERATE_SUCCESS = 0UL, /*函数操作成功*/
HYS_OPERATE_FAIL, /*函数操作失败*/ HYS_OPERATE_FAIL, /*函数操作失败*/
} HYS_Operate_Type_en_t; } HYS_Operate_Type_en_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
/*该段的下限值*/ /*该段的下限值*/
Hys_uint16_t u16HYSSegLow; Hys_uint16_t u16HYSSegLow;
/*该段的上限值*/ /*该段的上限值*/
Hys_uint16_t u16HYSSegHigh; Hys_uint16_t u16HYSSegHigh;
} HYS_Seg_Table_st_t; } HYS_Seg_Table_st_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
/*参数分段属性表*/ /*参数分段属性表*/
const HYS_Seg_Table_st_t *pstHYSSegTable; const HYS_Seg_Table_st_t *pstHYSSegTable;
...@@ -50,7 +50,7 @@ typedef struct ...@@ -50,7 +50,7 @@ typedef struct
/*1U:正序 0U:降序*/ /*1U:正序 0U:降序*/
Hys_uint8_t u8HYSSortBy; Hys_uint8_t u8HYSSortBy;
} HYS_Attribute_st_t; } HYS_Attribute_st_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
/*物理量数量,也就是 HYS_NUM_MAX */ /*物理量数量,也就是 HYS_NUM_MAX */
Hys_uint8_t u8HYSNum; Hys_uint8_t u8HYSNum;
...@@ -68,4 +68,4 @@ Hys_uint8_t HYS_Get_Seg(HYS_Num_en_t enHYSIndex); ...@@ -68,4 +68,4 @@ Hys_uint8_t HYS_Get_Seg(HYS_Num_en_t enHYSIndex);
HYS_Operate_Type_en_t HYS_Reset_Physical_Quantity(HYS_Num_en_t enHYSIndex); HYS_Operate_Type_en_t HYS_Reset_Physical_Quantity(HYS_Num_en_t enHYSIndex);
/*读取版本号*/ /*读取版本号*/
Hys_uint8_t HYS_Version_Read(void); Hys_uint8_t HYS_Version_Read(void);
#endif #endif
\ No newline at end of file
#include "MCU_Core_Protocol.h" #include "MCU_Core_Protocol.h"
#include "Components.h" #include "Components.h"
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint8_t SOC_St; /*系统启动状态 0启动中 1启动成功 2启动超时*/ uint8_t SOC_St; /*系统启动状态 0启动中 1启动成功 2启动超时*/
uint8_t AnimStatus; uint8_t AnimStatus;
...@@ -9,7 +9,7 @@ typedef struct ...@@ -9,7 +9,7 @@ typedef struct
uint8_t Restart; uint8_t Restart;
} Core_Monitor_t; } Core_Monitor_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint8_t u8POPEn; uint8_t u8POPEn;
uint8_t u8BlueToothEn; uint8_t u8BlueToothEn;
...@@ -28,7 +28,7 @@ static uint16_t SocStartupCnt = 0u; ...@@ -28,7 +28,7 @@ static uint16_t SocStartupCnt = 0u;
static Core_Monitor_t Core_Monitor; static Core_Monitor_t Core_Monitor;
static Rec_ID_12_Struct RecID12; static Rec_ID_12_Struct RecID12;
Rec_0x012_un_t g_unRec_0x012; Rec_0x012_un_t g_unRec_0x012;
static void Core_Poweroff_Service(); static void Core_Poweroff_Service(void);
uint8_t g_u8AvgSpeedOFFValid = 0U; uint8_t g_u8AvgSpeedOFFValid = 0U;
uint8_t SOC_Online_Status_Get(void) uint8_t SOC_Online_Status_Get(void)
......
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
*/ */
#include "Protocol_CRC16.h" #include "Protocol_CRC16.h"
__align(4) /* 四字节对齐 */
static const Protocol_uint8_t CRC16_TAB_H [ 256 ] = {0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u}; static const Protocol_uint8_t CRC16_TAB_H [ 256 ] = {0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u};
__align(4) /* 四字节对齐 */
static const Protocol_uint8_t CRC16_TAB_L [ 256 ] = {0x00u, 0xC0u, 0xC1u, 0x01u, 0xC3u, 0x03u, 0x02u, 0xC2u, 0xC6u, 0x06u, 0x07u, 0xC7u, 0x05u, 0xC5u, 0xC4u, 0x04u, 0xCCu, 0x0Cu, 0x0Du, 0xCDu, 0x0Fu, 0xCFu, 0xCEu, 0x0Eu, 0x0Au, 0xCAu, 0xCBu, 0x0Bu, 0xC9u, 0x09u, 0x08u, 0xC8u, 0xD8u, 0x18u, 0x19u, 0xD9u, 0x1Bu, 0xDBu, 0xDAu, 0x1Au, 0x1Eu, 0xDEu, 0xDFu, 0x1Fu, 0xDDu, 0x1Du, 0x1Cu, 0xDCu, 0x14u, 0xD4u, 0xD5u, 0x15u, 0xD7u, 0x17u, 0x16u, 0xD6u, 0xD2u, 0x12u, 0x13u, 0xD3u, 0x11u, 0xD1u, 0xD0u, 0x10u, 0xF0u, 0x30u, 0x31u, 0xF1u, 0x33u, 0xF3u, 0xF2u, 0x32u, 0x36u, 0xF6u, 0xF7u, 0x37u, 0xF5u, 0x35u, 0x34u, 0xF4u, 0x3Cu, 0xFCu, 0xFDu, 0x3Du, 0xFFu, 0x3Fu, 0x3Eu, 0xFEu, 0xFAu, 0x3Au, 0x3Bu, 0xFBu, 0x39u, 0xF9u, 0xF8u, 0x38u, 0x28u, 0xE8u, 0xE9u, 0x29u, 0xEBu, 0x2Bu, 0x2Au, 0xEAu, 0xEEu, 0x2Eu, 0x2Fu, 0xEFu, 0x2Du, 0xEDu, 0xECu, 0x2Cu, 0xE4u, 0x24u, 0x25u, 0xE5u, 0x27u, 0xE7u, 0xE6u, 0x26u, 0x22u, 0xE2u, 0xE3u, 0x23u, 0xE1u, 0x21u, 0x20u, 0xE0u, 0xA0u, 0x60u, 0x61u, 0xA1u, 0x63u, 0xA3u, 0xA2u, 0x62u, 0x66u, 0xA6u, 0xA7u, 0x67u, 0xA5u, 0x65u, 0x64u, 0xA4u, 0x6Cu, 0xACu, 0xADu, 0x6Du, 0xAFu, 0x6Fu, 0x6Eu, 0xAEu, 0xAAu, 0x6Au, 0x6Bu, 0xABu, 0x69u, 0xA9u, 0xA8u, 0x68u, 0x78u, 0xB8u, 0xB9u, 0x79u, 0xBBu, 0x7Bu, 0x7Au, 0xBAu, 0xBEu, 0x7Eu, 0x7Fu, 0xBFu, 0x7Du, 0xBDu, 0xBCu, 0x7Cu, 0xB4u, 0x74u, 0x75u, 0xB5u, 0x77u, 0xB7u, 0xB6u, 0x76u, 0x72u, 0xB2u, 0xB3u, 0x73u, 0xB1u, 0x71u, 0x70u, 0xB0u, 0x50u, 0x90u, 0x91u, 0x51u, 0x93u, 0x53u, 0x52u, 0x92u, 0x96u, 0x56u, 0x57u, 0x97u, 0x55u, 0x95u, 0x94u, 0x54u, 0x9Cu, 0x5Cu, 0x5Du, 0x9Du, 0x5Fu, 0x9Fu, 0x9Eu, 0x5Eu, 0x5Au, 0x9Au, 0x9Bu, 0x5Bu, 0x99u, 0x59u, 0x58u, 0x98u, 0x88u, 0x48u, 0x49u, 0x89u, 0x4Bu, 0x8Bu, 0x8Au, 0x4Au, 0x4Eu, 0x8Eu, 0x8Fu, 0x4Fu, 0x8Du, 0x4Du, 0x4Cu, 0x8Cu, 0x44u, 0x84u, 0x85u, 0x45u, 0x87u, 0x47u, 0x46u, 0x86u, 0x82u, 0x42u, 0x43u, 0x83u, 0x41u, 0x81u, 0x80u, 0x40u}; static const Protocol_uint8_t CRC16_TAB_L [ 256 ] = {0x00u, 0xC0u, 0xC1u, 0x01u, 0xC3u, 0x03u, 0x02u, 0xC2u, 0xC6u, 0x06u, 0x07u, 0xC7u, 0x05u, 0xC5u, 0xC4u, 0x04u, 0xCCu, 0x0Cu, 0x0Du, 0xCDu, 0x0Fu, 0xCFu, 0xCEu, 0x0Eu, 0x0Au, 0xCAu, 0xCBu, 0x0Bu, 0xC9u, 0x09u, 0x08u, 0xC8u, 0xD8u, 0x18u, 0x19u, 0xD9u, 0x1Bu, 0xDBu, 0xDAu, 0x1Au, 0x1Eu, 0xDEu, 0xDFu, 0x1Fu, 0xDDu, 0x1Du, 0x1Cu, 0xDCu, 0x14u, 0xD4u, 0xD5u, 0x15u, 0xD7u, 0x17u, 0x16u, 0xD6u, 0xD2u, 0x12u, 0x13u, 0xD3u, 0x11u, 0xD1u, 0xD0u, 0x10u, 0xF0u, 0x30u, 0x31u, 0xF1u, 0x33u, 0xF3u, 0xF2u, 0x32u, 0x36u, 0xF6u, 0xF7u, 0x37u, 0xF5u, 0x35u, 0x34u, 0xF4u, 0x3Cu, 0xFCu, 0xFDu, 0x3Du, 0xFFu, 0x3Fu, 0x3Eu, 0xFEu, 0xFAu, 0x3Au, 0x3Bu, 0xFBu, 0x39u, 0xF9u, 0xF8u, 0x38u, 0x28u, 0xE8u, 0xE9u, 0x29u, 0xEBu, 0x2Bu, 0x2Au, 0xEAu, 0xEEu, 0x2Eu, 0x2Fu, 0xEFu, 0x2Du, 0xEDu, 0xECu, 0x2Cu, 0xE4u, 0x24u, 0x25u, 0xE5u, 0x27u, 0xE7u, 0xE6u, 0x26u, 0x22u, 0xE2u, 0xE3u, 0x23u, 0xE1u, 0x21u, 0x20u, 0xE0u, 0xA0u, 0x60u, 0x61u, 0xA1u, 0x63u, 0xA3u, 0xA2u, 0x62u, 0x66u, 0xA6u, 0xA7u, 0x67u, 0xA5u, 0x65u, 0x64u, 0xA4u, 0x6Cu, 0xACu, 0xADu, 0x6Du, 0xAFu, 0x6Fu, 0x6Eu, 0xAEu, 0xAAu, 0x6Au, 0x6Bu, 0xABu, 0x69u, 0xA9u, 0xA8u, 0x68u, 0x78u, 0xB8u, 0xB9u, 0x79u, 0xBBu, 0x7Bu, 0x7Au, 0xBAu, 0xBEu, 0x7Eu, 0x7Fu, 0xBFu, 0x7Du, 0xBDu, 0xBCu, 0x7Cu, 0xB4u, 0x74u, 0x75u, 0xB5u, 0x77u, 0xB7u, 0xB6u, 0x76u, 0x72u, 0xB2u, 0xB3u, 0x73u, 0xB1u, 0x71u, 0x70u, 0xB0u, 0x50u, 0x90u, 0x91u, 0x51u, 0x93u, 0x53u, 0x52u, 0x92u, 0x96u, 0x56u, 0x57u, 0x97u, 0x55u, 0x95u, 0x94u, 0x54u, 0x9Cu, 0x5Cu, 0x5Du, 0x9Du, 0x5Fu, 0x9Fu, 0x9Eu, 0x5Eu, 0x5Au, 0x9Au, 0x9Bu, 0x5Bu, 0x99u, 0x59u, 0x58u, 0x98u, 0x88u, 0x48u, 0x49u, 0x89u, 0x4Bu, 0x8Bu, 0x8Au, 0x4Au, 0x4Eu, 0x8Eu, 0x8Fu, 0x4Fu, 0x8Du, 0x4Du, 0x4Cu, 0x8Cu, 0x44u, 0x84u, 0x85u, 0x45u, 0x87u, 0x47u, 0x46u, 0x86u, 0x82u, 0x42u, 0x43u, 0x83u, 0x41u, 0x81u, 0x80u, 0x40u};
/** /**
......
...@@ -30,7 +30,7 @@ Platform_16Bit ...@@ -30,7 +30,7 @@ Platform_16Bit
/**@struct Protocol_Data_t /**@struct Protocol_Data_t
* @brief 解析后的协议数据 * @brief 解析后的协议数据
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
Protocol_uint8_t FrameNo; /**< 帧序号 */ Protocol_uint8_t FrameNo; /**< 帧序号 */
Protocol_uint8_t PowerSts; /**< 电源状态 */ Protocol_uint8_t PowerSts; /**< 电源状态 */
...@@ -49,7 +49,7 @@ typedef void (*UARTClose)(void); ...@@ -49,7 +49,7 @@ typedef void (*UARTClose)(void);
/**@struct Protocol_Func_t /**@struct Protocol_Func_t
* @brief 协议解析回调函数 * @brief 协议解析回调函数
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
UARTOpen UARTOpen_Cbk; /**< 串口打开回调 */ UARTOpen UARTOpen_Cbk; /**< 串口打开回调 */
UARTSend UARTSend_Cbk; /**< 串口发送回调 */ UARTSend UARTSend_Cbk; /**< 串口发送回调 */
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
#define UART_RX_MAX_DEPTH (2 * 1024UL) // 4K #define UART_RX_MAX_DEPTH (2 * 1024UL) // 4K
#define UART_DATA_BUF_LEN (2 * 1024UL) // 4K #define UART_DATA_BUF_LEN (2 * 1024UL) // 4K
typedef struct typedef struct __attribute__((aligned(4)))
{ {
Protocol_uint32_t read_pos; Protocol_uint32_t read_pos;
Protocol_uint32_t write_pos; Protocol_uint32_t write_pos;
Protocol_uint8_t Rx_Buffer [ UART_RX_MAX_DEPTH ]; Protocol_uint8_t Rx_Buffer [ UART_RX_MAX_DEPTH ];
} UARTRxBuf_t; } UARTRxBuf_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
Protocol_uint32_t read_pos; Protocol_uint32_t read_pos;
Protocol_uint32_t write_pos; Protocol_uint32_t write_pos;
...@@ -22,6 +22,8 @@ typedef struct ...@@ -22,6 +22,8 @@ typedef struct
static UARTRxBuf_t UARTRxBuf; static UARTRxBuf_t UARTRxBuf;
static UARTTxBuf_t UARTTxBuf; static UARTTxBuf_t UARTTxBuf;
__align(4) /* 四字节对齐 */
static Protocol_uint8_t mDataBufPtr [ UART_DATA_BUF_LEN ]; static Protocol_uint8_t mDataBufPtr [ UART_DATA_BUF_LEN ];
static Protocol_uint8_t Protocol_OpenUart(void); static Protocol_uint8_t Protocol_OpenUart(void);
......
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
#include "Components.h" #include "Components.h"
#include "PicBin.h" #include "PicBin.h"
#include "GpioUser.h" #include "GpioUser.h"
__align(4) /* 四字节对齐 */
//#include "AMT630H_Datas.h" //#include "AMT630H_Datas.h"
#define AMT630H_ERR_TIME 10000U #define AMT630H_ERR_TIME 10000U
#define AMT630H_RELEASE_MODE 1U #define AMT630H_RELEASE_MODE 1U
unsigned int AMT630H_InitTime = 0; unsigned int AMT630H_InitTime = 0;
uint8_t g_sysFlag_Lcdcheck = 0; uint8_t g_sysFlag_Lcdcheck = 0;
/* Initialization */ /* Initialization */
LCD_TFT_SOUND_PARA_ST LcdSoundParamterData; LCD_TFT_PARA_ST LcdSoundParamterData;
LCD_TFT_MIPI_PARA_ST LcdMipiSoundParamterDate;
SOFTWARE_VERSION_ST amt630Version; SOFTWARE_VERSION_ST amt630Version;
uint8_t Amt630hInitFinishFlag = 0; uint8_t Amt630hInitFinishFlag = 0;
...@@ -128,8 +130,8 @@ static const uint16_t BootAnimationList[AMT630H_ANIMATION_PIC_NUM] = { ...@@ -128,8 +130,8 @@ static const uint16_t BootAnimationList[AMT630H_ANIMATION_PIC_NUM] = {
}; };
void AMT630H_Animation_PlayProc(uint16_t PicIndex) void AMT630H_Animation_PlayProc(uint16_t PicIndex)
{ {
unsigned char *pBuf; // unsigned char *pBuf;
uint32_t tmpLen = 0; // uint32_t tmpLen = 0;
SetPageGuid(GRAPHICS_PAGE_0, 1, 0, 0); SetPageGuid(GRAPHICS_PAGE_0, 1, 0, 0);
SetPageBackground(GRAPHICS_PAGE_0, PicIndex); SetPageBackground(GRAPHICS_PAGE_0, PicIndex);
// if (AMT630H_Animation_DispPic == (AMT630H_ANIMATION_PIC_NUM - 30)) // if (AMT630H_Animation_DispPic == (AMT630H_ANIMATION_PIC_NUM - 30))
...@@ -213,15 +215,16 @@ void AMT630H_RstCtrl(void) ...@@ -213,15 +215,16 @@ void AMT630H_RstCtrl(void)
RTE_GPIO_Set_Level(STBYB_LCD_MCU, 0);//lcd RTE_GPIO_Set_Level(STBYB_LCD_MCU, 0);//lcd
RTE_GPIO_Set_Level(MCU_RSTB_LCD, 0);//lcd RTE_GPIO_Set_Level(MCU_RSTB_LCD, 0);//lcd
Delay_Time_Ctrl(10); Delay_Time_Ctrl(10);
RTE_GPIO_Set_Level(VCC1V2_AMT_EN, 1); RTE_GPIO_Set_Level(VCC_33_EN_MCU, 1);
Delay_Time_Ctrl(15); Delay_Time_Ctrl(15);
RTE_GPIO_Set_Level(VCC_33_EN_MCU, 1); RTE_GPIO_Set_Level(VCC1V2_AMT_EN, 1);
Delay_Time_Ctrl(45); Delay_Time_Ctrl(15);
RTE_GPIO_Set_Level(x1530_EN_MCU, 1);
Delay_Time_Ctrl(55);
RTE_GPIO_Set_Level(MCU_RSTB_LCD, 1); RTE_GPIO_Set_Level(MCU_RSTB_LCD, 1);
Delay_Time_Ctrl(15);
RTE_GPIO_Set_Level(STBYB_LCD_MCU, 1);
Delay_Time_Ctrl(10); Delay_Time_Ctrl(10);
RTE_GPIO_Set_Level(x1530_EN_MCU, 1);//1530 RTE_GPIO_Set_Level(STBYB_LCD_MCU, 1);//1530
Delay_Time_Ctrl(30);
} }
void Amt630hInit(void) void Amt630hInit(void)
...@@ -264,7 +267,14 @@ void Amt630hInit(void) ...@@ -264,7 +267,14 @@ void Amt630hInit(void)
LcdSoundParamterData.SoundChannelNum = 0; LcdSoundParamterData.SoundChannelNum = 0;
LcdSoundParamterData.SoundFreq = AUDIO_FREQ_48K; LcdSoundParamterData.SoundFreq = AUDIO_FREQ_48K;
SetLcdSoundParameter(&LcdSoundParamterData);
LcdMipiSoundParamterDate.MipiClkFreq = 0;
LcdMipiSoundParamterDate.MipiDisplaymMode = 0;
LcdMipiSoundParamterDate.MipiLane = 0;
LcdMipiSoundParamterDate.MipiNpPolarityInverse = 0;
RN6752_PARA_ST* LcdSoundRn6752ParamterDate = NULL;
// SetLcdSoundParameter(&LcdSoundParamterData);
SetLcdParameter(&LcdSoundParamterData,&LcdMipiSoundParamterDate,AMT630_UART3,LcdSoundRn6752ParamterDate);
SetSwVerBuf((uint8_t*)&amt630Version); SetSwVerBuf((uint8_t*)&amt630Version);
User_PicIndexDataInit(); User_PicIndexDataInit();
...@@ -292,10 +302,11 @@ void Amt630hInit(void) ...@@ -292,10 +302,11 @@ void Amt630hInit(void)
void AMT630H_Sleep(void) void AMT630H_Sleep(void)
{ {
RTE_GPIO_Set_Level(STBYB_LCD_MCU, 0); RTE_GPIO_Set_Level(STBYB_LCD_MCU, 0);
Delay_Time_Ctrl(30); Delay_Time_Ctrl(110);
RTE_GPIO_Set_Level(VCC_33_EN_MCU, 0); RTE_GPIO_Set_Level(VCC_33_EN_MCU, 0);
RTE_GPIO_Set_Level(VCC1V2_AMT_EN, 0); RTE_GPIO_Set_Level(VCC1V2_AMT_EN, 0);
RTE_GPIO_Set_Level(MCU_RSTB_LCD, 0); RTE_GPIO_Set_Level(MCU_RSTB_LCD, 0);
RTE_GPIO_Set_Level(x1530_EN_MCU, 0);
} }
static void AMT630H_AliveCounterMonitor(void) static void AMT630H_AliveCounterMonitor(void)
......
...@@ -10,7 +10,7 @@ typedef enum ...@@ -10,7 +10,7 @@ typedef enum
EM_FLASH_CHECK_RESULT_FAIL, EM_FLASH_CHECK_RESULT_FAIL,
}EM_FLASH_CHECK_RESULT_T; }EM_FLASH_CHECK_RESULT_T;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint8_t Flag; uint8_t Flag;
uint32_t InquireTime; uint32_t InquireTime;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <stdint.h> #include <stdint.h>
#include "UDS_ISO14229_Services.h" #include "UDS_ISO14229_Services.h"
#include "flash.h" #include "flash.h"
#include "Device\Cmsemicon\BAT32A279\RTE\UART\RTE_UART.h"
#define NULL 0 #define NULL 0
extern uint8_t UartRevBuff[0x1000]; extern uint8_t UartRevBuff[0x1000];
...@@ -27,7 +28,7 @@ void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal) ...@@ -27,7 +28,7 @@ void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal)
uint8_t i = 0; uint8_t i = 0;
int32_t TmpNum; int32_t TmpNum;
uint16_t tmpIndex = 0; uint16_t tmpIndex = 0;
uint8_t PointFrontRearBlank = 2; // uint8_t PointFrontRearBlank = 2;
uint16_t DotPosition = 0; uint16_t DotPosition = 0;
uint8_t DotInterval = 0; uint8_t DotInterval = 0;
uint16_t NumberList[20]; uint16_t NumberList[20];
......
...@@ -7,6 +7,7 @@ typedef unsigned short uint16_t; ...@@ -7,6 +7,7 @@ typedef unsigned short uint16_t;
typedef short int16_t; typedef short int16_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
#define AMT_NULL 0
#define UART_UPDATE_ACK_NONE 0 #define UART_UPDATE_ACK_NONE 0
#define UART_UPDATE_ACK_OK 1 #define UART_UPDATE_ACK_OK 1
...@@ -40,11 +41,7 @@ extern void UartSendData(uint8_t *data, uint32_t len); ...@@ -40,11 +41,7 @@ extern void UartSendData(uint8_t *data, uint32_t len);
extern void AnalysisUartData(void); extern void AnalysisUartData(void);
/* Generate Function end */ /* Generate Function end */
/* Sound */ /* Lcd Parameter */
#define SOUND_STATE_FREE 0
#define SOUND_STATE_BUSY 1
#define WAV_TEST_NUM_TIC 0xfd
#define WAV_TEST_NUM_TOC 0xfe
enum { enum {
AUDIO_FREQ_NONE, AUDIO_FREQ_NONE,
AUDIO_FREQ_8K, AUDIO_FREQ_8K,
...@@ -61,13 +58,12 @@ enum { ...@@ -61,13 +58,12 @@ enum {
AUDIO_FREQ_192K, AUDIO_FREQ_192K,
AUDIO_FREQ_TOTAL, AUDIO_FREQ_TOTAL,
}; };
extern void PackedTransfer_SoundPlay(uint8_t Channel, uint8_t WavNum, uint16_t PlayTimes, uint16_t MinTimes, uint8_t Volume); typedef enum {
extern void PackedTransfer_SoundStop(uint8_t Channel); AMT630_UART1 = 1,
extern void PackedTransfer_SoundChangeVolume(uint8_t Channel, uint8_t Volume); AMT630_UART2,
extern uint8_t GetSoundChannelSta(uint8_t Channel); AMT630_UART3,
/* Sound end */ } AMT630_UART_CH_TYPE;
/* Lcd Parameter */
#define LCD_WIRING_MODE_RGB 0 #define LCD_WIRING_MODE_RGB 0
#define LCD_WIRING_MODE_RBG 1 #define LCD_WIRING_MODE_RBG 1
#define LCD_WIRING_MODE_GRB 2 #define LCD_WIRING_MODE_GRB 2
...@@ -77,6 +73,7 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel); ...@@ -77,6 +73,7 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel);
#define LCD_INTERFACE_TTL 0 #define LCD_INTERFACE_TTL 0
#define LCD_INTERFACE_LVDS 1 #define LCD_INTERFACE_LVDS 1
#define LCD_INTERFACE_MIPI 2
#define LCD_WIRING_BIT_ORDER_MSB 0 #define LCD_WIRING_BIT_ORDER_MSB 0
#define LCD_WIRING_BIT_ORDER_LSB 1 #define LCD_WIRING_BIT_ORDER_LSB 1
...@@ -91,12 +88,13 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel); ...@@ -91,12 +88,13 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel);
#define VIDEO_IN_NTSC 1 #define VIDEO_IN_NTSC 1
#define VIDEO_IN_PAL 2 #define VIDEO_IN_PAL 2
#pragma pack(1)
typedef struct { typedef struct {
uint16_t LcdWidth; uint16_t LcdWidth;
uint16_t LcdHeight; uint16_t LcdHeight;
uint8_t LcdVideoInputValid : 2; uint8_t LcdVideoInputValid : 2;
uint8_t LcdBpp : 6; uint8_t LcdBpp : 6;
uint8_t Ark7116ResetPin; uint8_t Ark7116ResetPin;
uint8_t LcdInterfaceType : 4; uint8_t LcdInterfaceType : 4;
uint8_t LcdWiringMode : 4; uint8_t LcdWiringMode : 4;
uint8_t LcdWiringBitOrder : 2; uint8_t LcdWiringBitOrder : 2;
...@@ -112,12 +110,27 @@ typedef struct { ...@@ -112,12 +110,27 @@ typedef struct {
uint32_t LcdClkFreq; uint32_t LcdClkFreq;
uint8_t SoundFreq; uint8_t SoundFreq;
uint8_t SoundChannelNum; uint8_t SoundChannelNum;
} LCD_TFT_SOUND_PARA_ST; }LCD_TFT_PARA_ST;
typedef struct {
extern void SetLcdSoundParameter(LCD_TFT_SOUND_PARA_ST *pData); uint32_t MipiClkFreq;
uint8_t MipiNpPolarityInverse;
uint8_t MipiLane;
uint8_t MipiDisplaymMode;
}LCD_TFT_MIPI_PARA_ST;
#define RN6752_INPUT_TYPE_NONE 0
#define RN6752_INPUT_TYPE_CVBS_NTSC 1
#define RN6752_INPUT_TYPE_CVBS_PAL 2
#define RN6752_INPUT_TYPE_AHD_720P_25 3
#define RN6752_INPUT_TYPE_AHD_720P_30 4
typedef struct {
uint8_t Rn6752InputType;
uint8_t Rn6752ResetPin;
uint8_t Rn6752Address;
}RN6752_PARA_ST;
#pragma pack()
extern void SetLcdParameter(LCD_TFT_PARA_ST *pData, LCD_TFT_MIPI_PARA_ST *pDataMipi, AMT630_UART_CH_TYPE Amt630UartCh, RN6752_PARA_ST *pDataRn6752);
/* Lcd Parameter end */ /* Lcd Parameter end */
/* Amt Software */ /* Amt Software */
...@@ -235,7 +248,7 @@ typedef enum { ...@@ -235,7 +248,7 @@ typedef enum {
TFT_ROT_270, TFT_ROT_270,
} TFT_ROT_TYPE; } TFT_ROT_TYPE;
#define TEXT_ROT_SCALE (r, s) ((((r) & 0xffff) << 16) | ((s) & 0xffff)) #define TEXT_ROT_SCALE(r, s) ((((r) & 0xffff) << 16) | ((s) & 0xffff))
#define TEXT_COLOR(r, g, b, a) ((((r) & 0xff) << 24) | (((g) & 0xff) << 16) | (((b) & 0xff) << 8) | ((a) & 0xff)) #define TEXT_COLOR(r, g, b, a) ((((r) & 0xff) << 24) | (((g) & 0xff) << 16) | (((b) & 0xff) << 8) | ((a) & 0xff))
#define TEXT_LINE_OFFSET(x, y) ((((x) & 0xffff) << 16) | ((y) & 0xffff)) #define TEXT_LINE_OFFSET(x, y) ((((x) & 0xffff) << 16) | ((y) & 0xffff))
...@@ -253,7 +266,9 @@ extern void SetPageText(GRAPHICS_PAGE_ENUM page, uint16_t LabelNum, int16_t PosX ...@@ -253,7 +266,9 @@ extern void SetPageText(GRAPHICS_PAGE_ENUM page, uint16_t LabelNum, int16_t PosX
extern void SetPagePointerPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex); extern void SetPagePointerPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex);
extern void SetPagePointerSePic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN); extern void SetPagePointerSePic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN);
extern void SetPagePointerTrackPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex); extern void SetPagePointerTrackPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex);
extern void SetPagePointerTrackActiceArea(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, int16_t ActivePosX, int16_t ActivePosY, uint16_t ActiveW, uint16_t ActiveH);
extern void SetPageSliderNumPic(GRAPHICS_PAGE_ENUM page, uint8_t SliderNum); extern void SetPageSliderNumPic(GRAPHICS_PAGE_ENUM page, uint8_t SliderNum);
extern void SetPageSliderImagePic(GRAPHICS_PAGE_ENUM page, uint8_t SliderImageNum);
extern void PackedTransfer_PicDirectDraw(uint32_t PicIndex, uint8_t Valid); extern void PackedTransfer_PicDirectDraw(uint32_t PicIndex, uint8_t Valid);
extern void PackedTransfer_BgJpg(uint32_t PicIndex); extern void PackedTransfer_BgJpg(uint32_t PicIndex);
...@@ -319,21 +334,97 @@ extern void PackedTransfer_SetTftIoMode(uint8_t st); /*st 0:normal gpio, 1:TFT i ...@@ -319,21 +334,97 @@ extern void PackedTransfer_SetTftIoMode(uint8_t st); /*st 0:normal gpio, 1:TFT i
/* Set tft io mode end */ /* Set tft io mode end */
/* Slider Num */ /* Slider Num */
extern void PackedTransfer_SliderNumData(uint8_t n, uint8_t *data, uint32_t len); #pragma pack(1)
#define SLIDER_NUM_MAX 300 /* The maximum value is 300 */
typedef struct {
uint8_t SliderNum;
uint8_t SliderValid;
uint8_t ZoomOutMax;
uint8_t AlphaMin;
float DestVal;
float CurVal;
int16_t PosX;
int16_t PosY;
int16_t Interval;
uint16_t PicNum;
uint16_t DampingVal;
uint16_t PicIndex[SLIDER_NUM_MAX];
} SLIDER_NUMBER_PARA_ST;
#pragma pack()
extern void PackedTransfer_SliderNumData(uint8_t n, uint8_t *data, uint32_t len); /* PackedTransfer_SliderNumData(0, &SliderNumParaData, sizeof (SLIDER_NUMBER_PARA_ST)); */
extern void PackedTransfer_SliderNumDestVal(uint8_t n, uint16_t val, uint8_t ForceUpdate, uint8_t DisplayValid); extern void PackedTransfer_SliderNumDestVal(uint8_t n, uint16_t val, uint8_t ForceUpdate, uint8_t DisplayValid);
/* Slider Num end */ /* Slider Num end */
/* Slider Image */
#pragma pack(1)
#define SLIDER_IMAGE_PIC_MAX 5 /* The maximum value is 5 */
enum {
SLIDER_IMAGE_TYPE_HORIZONTAL_LEFT_TO_RIGHT,
SLIDER_IMAGE_TYPE_HORIZONTAL_RIGHT_TO_LEFT,
SLIDER_IMAGE_TYPE_VERTICAL_UP_TO_DOWN,
SLIDER_IMAGE_TYPE_VERTICAL_DOWN_TO_UP,
};
typedef struct {
uint8_t SliderType;
uint8_t SliderValid;
uint8_t Reserve1;
uint8_t Reserve2;
float DestVal;
float CurVal;
int16_t PosX;
int16_t PosY;
int16_t Interval;
uint16_t DampingVal;
uint16_t PicIndex[SLIDER_IMAGE_PIC_MAX];
} SLIDER_IMAGE_PARA_ST;
#pragma pack()
extern void PackedTransfer_SliderImageData(uint8_t n, uint8_t *data, uint32_t len); /* The setting range of parameter n is 0~9, PackedTransfer_SliderImageData(0, &SliderImageParaData, sizeof (SLIDER_IMAGE_PARA_ST)); */
extern void PackedTransfer_SliderImageDestVal(uint8_t n, uint16_t val, uint8_t ForceUpdate, uint8_t DisplayValid);
/* Slider Num end */
enum {NUM_0, NUM_1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6, NUM_7, NUM_8, NUM_9, NUM_POINT, NUM_LINE}; enum {NUM_0, NUM_1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6, NUM_7, NUM_8, NUM_9, NUM_POINT, NUM_LINE};
typedef struct { typedef struct {
const uint16_t *NumList; const uint16_t *NumList;
uint16_t NumListLength;
int16_t NumInterval; int16_t NumInterval;
int16_t PointNumInterval;
int16_t PointNumCoorX;
int16_t LineCoorX;
int16_t x; int16_t x;
int16_t y; int16_t y;
int16_t Number1TotalLattice;
int16_t Number1UseLattice;
int16_t Number7TotalLattice;
int16_t Number7UseLattice;
uint8_t DecimalNum; uint8_t DecimalNum;
uint8_t MinDigits; uint8_t MinDigits;
} DISPLAY_NUM_ST; } DISPLAY_NUM_ST;
typedef struct {
const uint16_t *CharacterList;
uint16_t CharacterLength;
int16_t CharacterInterval;
int16_t PointCharacterInterval;
int16_t PointCharacterCoorX;
int16_t LineCoorX;
int16_t x;
int16_t y;
int16_t Number1TotalLattice;
int16_t Number1UseLattice;
int16_t Number7TotalLattice;
int16_t Number7UseLattice;
}DISPLAY_CHARACTER_ST;
typedef enum {
CHAR_LEFT_JUSTIFYING = 0,
CHAR_RIGHT_JUSTIFYING,
TOTAL_JUSTIFYING_TYPE,
}CHAR_JUSTIFYING_TYPE;
extern void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal); extern void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal);
extern void DisplayCharacter(uint8_t page, DISPLAY_CHARACTER_ST *pCharacterData, char* Character, uint8_t JustifyingType);
/* /*
note: note:
...@@ -454,7 +545,7 @@ typedef struct ...@@ -454,7 +545,7 @@ typedef struct
typedef struct typedef struct
{ {
uint8_t BlueToothSignalSate; uint8_t BlueToothSignalSate;
uint8_t BlueToothPhoneSate;//incalloutcall uint8_t BlueToothPhoneSate;//incall¡¢outcall
uint8_t BlueToothPhoneName[100]; uint8_t BlueToothPhoneName[100];
uint8_t PhoneNumber[20]; uint8_t PhoneNumber[20];
uint16_t PhoneBookTotalCount; uint16_t PhoneBookTotalCount;
...@@ -478,6 +569,37 @@ typedef struct ...@@ -478,6 +569,37 @@ typedef struct
uint8_t RoadName[100]; uint8_t RoadName[100];
uint32_t distance; uint32_t distance;
}_NavigationData_struct; }_NavigationData_struct;
enum BLUE_HELMET_CONNECT_STATE
{
BLUE_HELMET_UNSUPPORTED = 0u,
BLUE_HELMET_STANDBY,
BLUE_HELMET_CONNECTING,
BLUE_HELMET_CONNECTED,
BLUE_HELMET_PASUSED,
BLUE_HELMET_STREAMING,
};
enum BLUE_HELMET_REQUIRE_STATE
{
BLUE_HELMET_SCAN_END = 0u,
BLUE_HELMET_SCAN_STATE,
BLUE_HELMET_MAIN_REQUIRE_STATE,
BLUE_HELMET_MAIN_REQUIRE_END,
BLUE_HELMET_SECOND_REQUIRE_STATE,
BLUE_HELMET_SECOND_REQUIRE_END,
};
typedef struct
{
uint8_t MainheadsetState;
uint8_t SecondheadsetState;
uint8_t MainMacAddressSuccess[20];
uint8_t secondMacAddressSuccess[20];
uint8_t Name[50];
uint8_t ScanMacAddress[20];
}_BLUE_HELMET_DATA_struct;
typedef struct typedef struct
{ {
uint16_t x; uint16_t x;
...@@ -500,8 +622,8 @@ typedef struct ...@@ -500,8 +622,8 @@ typedef struct
typedef struct{ typedef struct{
uint8_t blearn; uint8_t blearn;
uint8_t strmac[6]; uint8_t strmac[6];
uint8_t temperature;
uint16_t PressureVal; uint16_t PressureVal;
int temperature;
}ec_stru_TirePressure; }ec_stru_TirePressure;
extern ec_stru_TirePressure ec_stru_pressure; extern ec_stru_TirePressure ec_stru_pressure;
...@@ -510,6 +632,7 @@ extern uint8_t UUID_Received; ...@@ -510,6 +632,7 @@ extern uint8_t UUID_Received;
extern _BlueToothPhoneData BlueToothPhoneData; extern _BlueToothPhoneData BlueToothPhoneData;
extern _GPS_TIME GPS_Time; extern _GPS_TIME GPS_Time;
extern _NavigationData_struct NavigationData_st; extern _NavigationData_struct NavigationData_st;
extern _BLUE_HELMET_DATA_struct BlueHelmetDate;
extern void PackedTransfer_DisplayPhoneMirrorQRcode(uint8_t data,_PICID_Struct PICID_OBJ); extern void PackedTransfer_DisplayPhoneMirrorQRcode(uint8_t data,_PICID_Struct PICID_OBJ);
extern void PackedTransfer_BlueTooth_DataSet(uint8_t data); extern void PackedTransfer_BlueTooth_DataSet(uint8_t data);
extern void PackedTransfer_GetPhoneBookCmd(void); extern void PackedTransfer_GetPhoneBookCmd(void);
...@@ -531,5 +654,6 @@ extern void SetBlueToothName(uint8_t *data,uint8_t len); ...@@ -531,5 +654,6 @@ extern void SetBlueToothName(uint8_t *data,uint8_t len);
extern void SetTaskbarHeight(uint16_t height); extern void SetTaskbarHeight(uint16_t height);
extern void Set_Pro_Unique_Identifier(uint8_t *data,uint8_t len); extern void Set_Pro_Unique_Identifier(uint8_t *data,uint8_t len);
extern uint8_t GetUpdate(void); extern uint8_t GetUpdate(void);
extern void SetBluetoothhelmet(uint8_t data, uint8_t *MacAddress);
extern uint8_t GetWifiConncetState(void);
#endif #endif
...@@ -22,7 +22,7 @@ extern { ...@@ -22,7 +22,7 @@ extern {
#endif #endif
/* Exported types ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint32_t u32Res1; uint32_t u32Res1;
uint32_t u32Res2; uint32_t u32Res2;
......
...@@ -58,7 +58,7 @@ typedef enum ...@@ -58,7 +58,7 @@ typedef enum
* @brief 报文接收属性结构体 \n * @brief 报文接收属性结构体 \n
* 定义报接收文属性 * 定义报接收文属性
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
canlib_uint8_t Init_Aarry [ 8u ]; /**< 报文初始化值.默认加载,未收到报文时,buffer内为该值 */ canlib_uint8_t Init_Aarry [ 8u ]; /**< 报文初始化值.默认加载,未收到报文时,buffer内为该值 */
canlib_uint8_t TimeOut_Array [ 8u ]; /**< 报文掉线值.掉线后加载 */ canlib_uint8_t TimeOut_Array [ 8u ]; /**< 报文掉线值.掉线后加载 */
...@@ -74,7 +74,7 @@ typedef struct ...@@ -74,7 +74,7 @@ typedef struct
* @brief 报文发送属性结构体 \n * @brief 报文发送属性结构体 \n
* 定义发送报文属性 * 定义发送报文属性
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
canlib_uint32_t u32MsgID; /**< 报文发送ID */ canlib_uint32_t u32MsgID; /**< 报文发送ID */
canlib_uint32_t u32MsgCycle; /**< 报文发送周期,单位是us */ canlib_uint32_t u32MsgCycle; /**< 报文发送周期,单位是us */
...@@ -91,7 +91,7 @@ typedef struct ...@@ -91,7 +91,7 @@ typedef struct
* @brief 报文发送结构体 \n * @brief 报文发送结构体 \n
* 定义报文发送结构的信息 * 定义报文发送结构的信息
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
canlib_uint32_t MsgID; /**< 报文发送ID */ canlib_uint32_t MsgID; /**< 报文发送ID */
canlib_uint8_t MsgStd; /**< 报文发送标准帧/扩展帧 */ canlib_uint8_t MsgStd; /**< 报文发送标准帧/扩展帧 */
...@@ -106,7 +106,7 @@ typedef canlib_uint8_t (*HAL_CAN_Send)(st_CAN_Msg *Msg); ...@@ -106,7 +106,7 @@ typedef canlib_uint8_t (*HAL_CAN_Send)(st_CAN_Msg *Msg);
* @brief 内部使用 \n * @brief 内部使用 \n
* 内容不明 * 内容不明
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
canlib_uint8_t AnalyzeMsg [ 8u ]; canlib_uint8_t AnalyzeMsg [ 8u ];
canlib_uint8_t ReceiveBuf [ 8u ]; canlib_uint8_t ReceiveBuf [ 8u ];
...@@ -120,7 +120,7 @@ typedef struct ...@@ -120,7 +120,7 @@ typedef struct
* @brief 内部使用,不做讲解 \n * @brief 内部使用,不做讲解 \n
* 内部使用,不做讲解 * 内部使用,不做讲解
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
st_CANMsgStruct *CAN_MSG_Analysis; st_CANMsgStruct *CAN_MSG_Analysis;
const st_CANMsgAttribute *pAttrubute; const st_CANMsgAttribute *pAttrubute;
...@@ -131,7 +131,7 @@ typedef struct ...@@ -131,7 +131,7 @@ typedef struct
* @brief 内部使用,不做讲解 \n * @brief 内部使用,不做讲解 \n
* 内部使用,不做讲解 * 内部使用,不做讲解
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
canlib_uint32_t u32MsgID; canlib_uint32_t u32MsgID;
canlib_uint32_t u32Timer; canlib_uint32_t u32Timer;
...@@ -149,7 +149,7 @@ typedef struct ...@@ -149,7 +149,7 @@ typedef struct
* @brief 内部使用,不做讲解 \n * @brief 内部使用,不做讲解 \n
* 内部使用,不做讲解 * 内部使用,不做讲解
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
const st_CAN_SendAttribute *pCAN_SendAttribute; const st_CAN_SendAttribute *pCAN_SendAttribute;
st_CAN_SendOperation *CanMsg; st_CAN_SendOperation *CanMsg;
......
...@@ -40,6 +40,15 @@ ...@@ -40,6 +40,15 @@
#include "Application\BlueTooth.h" #include "Application\BlueTooth.h"
#include "cgc.h" #include "cgc.h"
#include "UDS\UDS_ISO14229_Services.h" #include "UDS\UDS_ISO14229_Services.h"
#include "PowerManagement\PowerManag_user.h"
#include "PowerManagement\PowerManagement.h"
#include "Can_User.h"
#include "Line_in\Line_In_user.h"
#include "Mileage\Services_Mileage_User.h"
#include "Mileage\Services_Mileage.h"
#include "Eeprom\eeManager_Interface.h"
#include "Protocol_User.h"
#include "FaultCode.h"
#endif #endif
...@@ -36,7 +36,7 @@ typedef enum ...@@ -36,7 +36,7 @@ typedef enum
AT24C16 = 16, AT24C16 = 16,
}DeviceNo_t; }DeviceNo_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
ee_uint32_t Odo; ee_uint32_t Odo;
ee_uint32_t Trip; ee_uint32_t Trip;
......
...@@ -17,14 +17,16 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//选择 ...@@ -17,14 +17,16 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//选择
{ {
case KEY_EVENT_SHORT_PRESS_1: case KEY_EVENT_SHORT_PRESS_1:
Key_Event_Short_Press_Left(); Key_Event_Short_Press_Left();
Key_Clear_Time();
break; break;
case KEY_EVENT_SHORT_PRESS_2: case KEY_EVENT_SHORT_PRESS_2:
break; break;
case KEY_EVENT_LONG_PRESS_1: //2 case KEY_EVENT_LONG_PRESS_1: //2
if((Get_Dis_OdoAndTrip() == 1) && (Get_ActualVechileSpeed() == 0)) if((Get_Dis_OdoAndTrip() == 1) && (Get_ActualVechileSpeed() == 0))
{ {
Data_Clear_Trip(1); Data_Clear_Trip(EM_TRIP_A);
} }
Key_Clear_Time();
break; break;
case KEY_EVENT_LONG_PRESS_2: //3 case KEY_EVENT_LONG_PRESS_2: //3
break; break;
...@@ -63,11 +65,13 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认 ...@@ -63,11 +65,13 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认
RTC_SetTime(&counter_val.time); RTC_SetTime(&counter_val.time);
} }
Key_Event_Short_Press_Right(); Key_Event_Short_Press_Right();
Key_Clear_Time();
break; break;
case KEY_EVENT_SHORT_PRESS_2: case KEY_EVENT_SHORT_PRESS_2:
break; break;
case KEY_EVENT_LONG_PRESS_1: //2s case KEY_EVENT_LONG_PRESS_1: //2s
Key_Event_SHORT_PRESS_2_Right(); Key_Event_LONG_PRESS_1_Right();
Key_Clear_Time();
break; break;
case KEY_EVENT_LONG_PRESS_2: //3s case KEY_EVENT_LONG_PRESS_2: //3s
break; break;
...@@ -76,6 +80,7 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认 ...@@ -76,6 +80,7 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认
case KEY_EVENT_LONG_PRESS_4: //10s case KEY_EVENT_LONG_PRESS_4: //10s
TYW_RESET_ODO(); TYW_RESET_ODO();
Get_Into_OTA_Update_Mode(); Get_Into_OTA_Update_Mode();
Key_Clear_Time();
break; break;
case KEY_EVENT_OFF_TO_ON: case KEY_EVENT_OFF_TO_ON:
break; break;
...@@ -325,7 +330,8 @@ void Key_Event_Short_Press_Right(void)//确认 ...@@ -325,7 +330,8 @@ void Key_Event_Short_Press_Right(void)//确认
{ {
PackedTransfer_BlueTooth_DataSet(Phone_Hangup_Out); PackedTransfer_BlueTooth_DataSet(Phone_Hangup_Out);
} }
else if(Get_ActualVechileSpeed() == 0) else if((Menu_Get_Current_Cursor_Information() == MENU_ITEM_PHONE_CONNECT_APP)||
((Menu_Get_Current_Cursor_Information() == MENU_ITEM_MAIN_ITEM) && (Get_ActualVechileSpeed() == 0)))
{ {
Menu_Service(MENU_KEY_CONFIRM_SHORT); Menu_Service(MENU_KEY_CONFIRM_SHORT);
} }
...@@ -340,7 +346,7 @@ void Key_Event_Short_Press_Right(void)//确认 ...@@ -340,7 +346,7 @@ void Key_Event_Short_Press_Right(void)//确认
} }
} }
void Key_Event_SHORT_PRESS_2_Right(void) void Key_Event_LONG_PRESS_1_Right(void)
{ {
if((Get_DispVechileSpeed() >= 1990)&&(Get_DispEngineSpeed() >= 12000)) if((Get_DispVechileSpeed() >= 1990)&&(Get_DispEngineSpeed() >= 12000))
{ {
...@@ -448,18 +454,18 @@ void KEY_RIGHT_EVENT_NONE_Service(void) ...@@ -448,18 +454,18 @@ void KEY_RIGHT_EVENT_NONE_Service(void)
void Key_Clear_Time(void) void Key_Clear_Time(void)
{ {
if(Key_Status_Read_Left() == KEY_REALTIME_PRESS) // if(Key_Status_Read_Left() == KEY_REALTIME_PRESS)
{ // {
MenuData.Back_Time_Left = 0; MenuData.Back_Time_Left = 0;
MenuData.Back_Time_Left_Flag = 0; // MenuData.Back_Time_Left_Flag = 0;
MenuData.Back_Time_Right_Flag = 0; // MenuData.Back_Time_Right_Flag = 0;
} // }
if(Key_Status_Read_Right() == KEY_REALTIME_PRESS) // if(Key_Status_Read_Right() == KEY_REALTIME_PRESS)
{ // {
MenuData.Back_Time_Right = 0; MenuData.Back_Time_Right = 0;
MenuData.Back_Time_Left_Flag = 0; MenuData.Back_Time_Left_Flag = 0;
MenuData.Back_Time_Right_Flag = 0; MenuData.Back_Time_Right_Flag = 0;
} // }
} }
uint8_t ClearODO_Flag = 0; uint8_t ClearODO_Flag = 0;
...@@ -544,4 +550,4 @@ uint8_t Get_Dis_Bluetooth_Open_Close(void) ...@@ -544,4 +550,4 @@ uint8_t Get_Dis_Bluetooth_Open_Close(void)
uint8_t Get_Dis_Language(void) uint8_t Get_Dis_Language(void)
{ {
return MenuData.Language; //0中文,1英文 return MenuData.Language; //0中文,1英文
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "common.h" #include "common.h"
#include "rtc.h" #include "rtc.h"
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint16_t Back_Time_Left; uint16_t Back_Time_Left;
uint16_t Back_Time_Right; uint16_t Back_Time_Right;
...@@ -30,7 +30,7 @@ typedef enum ...@@ -30,7 +30,7 @@ typedef enum
BackLight_Val_A, BackLight_Val_A,
}_BackLight_Val_Type; }_BackLight_Val_Type;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint16_t Back_Time_Left; uint16_t Back_Time_Left;
uint16_t Back_Time_Right; uint16_t Back_Time_Right;
...@@ -62,7 +62,7 @@ Key_Status_en_t Key_Status_Read_Left(void); ...@@ -62,7 +62,7 @@ Key_Status_en_t Key_Status_Read_Left(void);
Key_Status_en_t Key_Status_Read_Right(void); Key_Status_en_t Key_Status_Read_Right(void);
void Key_Event_Short_Press_Left(void); void Key_Event_Short_Press_Left(void);
void Key_Event_Short_Press_Right(void); void Key_Event_Short_Press_Right(void);
void Key_Event_SHORT_PRESS_2_Right(void); void Key_Event_LONG_PRESS_1_Right(void);
void Key_Event_BackLight_Press_Left(void); void Key_Event_BackLight_Press_Left(void);
void Get_Into_OTA_Update_Mode(void); void Get_Into_OTA_Update_Mode(void);
void KEY_RIGHT_EVENT_NONE_Service(void); void KEY_RIGHT_EVENT_NONE_Service(void);
......
...@@ -33,7 +33,7 @@ typedef Linelib_uint16_t (*LineIn_GetPowerMode)(void); ...@@ -33,7 +33,7 @@ typedef Linelib_uint16_t (*LineIn_GetPowerMode)(void);
* @brief 硬线去抖属性结构体 \n * @brief 硬线去抖属性结构体 \n
* 定义报接收文属性 * 定义报接收文属性
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
Linelib_uint8_t DefaultLevel; /**< 初始电平 LEVEL_LOW /LEVEL_HIGH */ Linelib_uint8_t DefaultLevel; /**< 初始电平 LEVEL_LOW /LEVEL_HIGH */
Linelib_uint8_t TriggerLevel; /**< 触发电平 LEVEL_LOW /LEVEL_HIGH */ Linelib_uint8_t TriggerLevel; /**< 触发电平 LEVEL_LOW /LEVEL_HIGH */
......
...@@ -133,5 +133,6 @@ static Linelib_uint16_t LINE_GET_PWR(void) ...@@ -133,5 +133,6 @@ static Linelib_uint16_t LINE_GET_PWR(void)
void LINE_IN_Init(void) void LINE_IN_Init(void)
{ {
memset(LINE_IN_Men,0,sizeof(LINE_IN_Men));
Line_In_KL30_WakeUp_Init(LINE_IN_Men, g_stLineInAttribute, LINE_IN_MAX, LINE_GET_PWR); Line_In_KL30_WakeUp_Init(LINE_IN_Men, g_stLineInAttribute, LINE_IN_MAX, LINE_GET_PWR);
} }
...@@ -426,4 +426,8 @@ void Menu_User_WAKEUP(void); ...@@ -426,4 +426,8 @@ void Menu_User_WAKEUP(void);
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType);
void Menu_Logic_Operation_Clock_Hour_Bit_Set(Menu_Key_en_t enKeyType);
void Menu_Logic_Operation_Clock_Min_Tenb_Set(Menu_Key_en_t enKeyType);
void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType);
#endif #endif
...@@ -37,9 +37,9 @@ Platform_16Bit ...@@ -37,9 +37,9 @@ Platform_16Bit
typedef enum typedef enum
{ {
EM_TRIP_A, EM_TRIP_A,
EM_TRIP_B, // EM_TRIP_B,
EM_TRIP_C, // EM_TRIP_C,
EM_TRIP_D, // EM_TRIP_D,
EM_TRIP_MAX, EM_TRIP_MAX,
} DataTripEnum_t; } DataTripEnum_t;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "Mileage\Services_Mileage.h" #include "Mileage\Services_Mileage.h"
#include "Eeprom\eepromManage.h" #include "Eeprom\eepromManage.h"
#include "CommonInterface.h" #include "CommonInterface.h"
#include "Key\Key_user.h"
__align(4) __align(4)
...@@ -25,7 +25,7 @@ static void Data_User_EEPROM_Write(Data_EEPROM_Enum_t BlockID, uint32_t u32Data[ ...@@ -25,7 +25,7 @@ static void Data_User_EEPROM_Write(Data_EEPROM_Enum_t BlockID, uint32_t u32Data[
#define EEPROM_BLOCK_05 0xC0 #define EEPROM_BLOCK_05 0xC0
#define EEPROM_BLOCK_06 0xE0 #define EEPROM_BLOCK_06 0xE0
uint32_t Milleage_InitFlag = 0U;
/****************************************************************************** /******************************************************************************
...@@ -41,6 +41,7 @@ void Data_User_Mileage_KL30Init(void) ...@@ -41,6 +41,7 @@ void Data_User_Mileage_KL30Init(void)
Mileage_Func_t Func = {0}; Mileage_Func_t Func = {0};
ODO_Init_t ODOInit = {0}; ODO_Init_t ODOInit = {0};
Trip_Init_t TripInit[4] = {0}; Trip_Init_t TripInit[4] = {0};
Milleage_InitFlag = 0U;
(void)Data_User_EEPROM_Read(EM_MILEAGE_BLOCK, TempBuf, 1); (void)Data_User_EEPROM_Read(EM_MILEAGE_BLOCK, TempBuf, 1);
if (TempBuf[0] == 0xFFFFFFFF) if (TempBuf[0] == 0xFFFFFFFF)
...@@ -67,7 +68,7 @@ void Data_User_Mileage_KL30Init(void) ...@@ -67,7 +68,7 @@ void Data_User_Mileage_KL30Init(void)
{ {
ODOInit.Stamp = TempBuf[1]; ODOInit.Stamp = TempBuf[1];
} }
if (TempBuf[1] == 0xFFFFFFFF) if (TempBuf[2] == 0xFFFFFFFF)
{ {
ODOInit.Offset = 0; ODOInit.Offset = 0;
} }
...@@ -75,10 +76,10 @@ void Data_User_Mileage_KL30Init(void) ...@@ -75,10 +76,10 @@ void Data_User_Mileage_KL30Init(void)
{ {
ODOInit.Offset = TempBuf[2]; ODOInit.Offset = TempBuf[2];
} }
ODOInit.MaxValue = 9999999; ODOInit.MaxValue = 16099999;
Data_ODO_KL30_Init(DataODOBuf, &ODOInit, Func.EEPromWrite_Cbk); Data_ODO_KL30_Init(DataODOBuf, &ODOInit, Func.EEPromWrite_Cbk);
(void)Data_User_EEPROM_Read(EM_TRIP_BLOCK, TempBuf + 3, 8); (void)Data_User_EEPROM_Read(EM_TRIP_BLOCK, TempBuf + 3, 2);
if (TempBuf[3] == 0XFFFFFFFF) if (TempBuf[3] == 0XFFFFFFFF)
{ {
TripInit[EM_TRIP_A].Stamp = 0; TripInit[EM_TRIP_A].Stamp = 0;
...@@ -87,28 +88,39 @@ void Data_User_Mileage_KL30Init(void) ...@@ -87,28 +88,39 @@ void Data_User_Mileage_KL30Init(void)
{ {
TripInit[EM_TRIP_A].Stamp = TempBuf[3]; TripInit[EM_TRIP_A].Stamp = TempBuf[3];
} }
TripInit[EM_TRIP_A].Offset = TempBuf[4]; if (TempBuf[4] == 0XFFFFFFFF)
TripInit[EM_TRIP_A].MaxValue = 99999; /* 最大999.9Mile 进行复位 */ {
TripInit[EM_TRIP_A].Offset = 0;
}
else
{
TripInit[EM_TRIP_A].Offset = TempBuf[4];
}
// TripInit[EM_TRIP_A].Offset = TempBuf[4];
TripInit[EM_TRIP_A].MaxValue = 16200; /* 最大999.9Mile 进行复位 */
TripInit[EM_TRIP_A].IsRestart = 1u; TripInit[EM_TRIP_A].IsRestart = 1u;
TripInit[EM_TRIP_B].Stamp = 0xFFFFFFFFu; // TripInit[EM_TRIP_B].Stamp = 0xFFFFFFFFu;
TripInit[EM_TRIP_B].MaxValue = 99999; // TripInit[EM_TRIP_B].MaxValue = 99999;
TripInit[EM_TRIP_B].IsRestart = 1u; // TripInit[EM_TRIP_B].IsRestart = 1u;
TripInit[EM_TRIP_C].Stamp = 0xFFFFFFFFu; // TripInit[EM_TRIP_C].Stamp = 0xFFFFFFFFu;
TripInit[EM_TRIP_C].MaxValue = 99999; // TripInit[EM_TRIP_C].MaxValue = 99999;
TripInit[EM_TRIP_C].IsRestart = 1u; // TripInit[EM_TRIP_C].IsRestart = 1u;
TripInit[EM_TRIP_D].Stamp = 0xFFFFFFFFu; // TripInit[EM_TRIP_D].Stamp = 0xFFFFFFFFu;
TripInit[EM_TRIP_D].MaxValue = 99999; // TripInit[EM_TRIP_D].MaxValue = 99999;
TripInit[EM_TRIP_D].IsRestart = 1u; // TripInit[EM_TRIP_D].IsRestart = 1u;
Data_Trip_KL30_Init(DataTripBuf, TripInit, EM_TRIP_MAX, Func.EEPromWrite_Cbk); Data_Trip_KL30_Init(DataTripBuf, TripInit, EM_TRIP_MAX, Func.EEPromWrite_Cbk);
Milleage_InitFlag = 0X5AA53AA3UL;
} }
void Data_User_Mileage_WakeupInit(void) void Data_User_Mileage_WakeupInit(void)
{ {
Mileage_Func_t Func = {0}; Mileage_Func_t Func = {0};
Milleage_InitFlag = 0;
Func.Get_Sys_IG_Sts = Common_Get_IG_Sts; Func.Get_Sys_IG_Sts = Common_Get_IG_Sts;
Func.Get_Act_V_Speed_Valid = Common_Get_Act_V_Speed_Valid; Func.Get_Act_V_Speed_Valid = Common_Get_Act_V_Speed_Valid;
...@@ -120,9 +132,14 @@ void Data_User_Mileage_WakeupInit(void) ...@@ -120,9 +132,14 @@ void Data_User_Mileage_WakeupInit(void)
Data_ODO_Wakeup_Init(DataODOBuf, Func.EEPromWrite_Cbk); Data_ODO_Wakeup_Init(DataODOBuf, Func.EEPromWrite_Cbk);
Data_Trip_Wakeup_Init(DataTripBuf, EM_TRIP_MAX, Func.EEPromWrite_Cbk); Data_Trip_Wakeup_Init(DataTripBuf, EM_TRIP_MAX, Func.EEPromWrite_Cbk);
Milleage_InitFlag = 0X5AA53AA3UL;
} }
uint32_t Get_MileageInit_Status(void)
{
return Milleage_InitFlag;
}
static uint32_t Data_User_EEPROM_Read(uint16_t u16BlockID, uint32_t u32Data[], uint16_t u16Len) static uint32_t Data_User_EEPROM_Read(uint16_t u16BlockID, uint32_t u32Data[], uint16_t u16Len)
{ {
...@@ -181,7 +198,7 @@ static void Data_User_EEPROM_Write(Data_EEPROM_Enum_t BlockID, uint32_t u32Data[ ...@@ -181,7 +198,7 @@ static void Data_User_EEPROM_Write(Data_EEPROM_Enum_t BlockID, uint32_t u32Data[
void Services_Mileage_Callback(void) void Services_Mileage_Callback(void)
{ {
Data_Mileage_ISR(); // Data_Mileage_ISR();
Data_ODO_Processing(); Data_ODO_Processing();
Data_Trip_Processing(); Data_Trip_Processing();
Trip_Clear_Km_Service(); Trip_Clear_Km_Service();
...@@ -218,15 +235,15 @@ uint32_t Get_Trip_Value(void) ...@@ -218,15 +235,15 @@ uint32_t Get_Trip_Value(void)
uint32_t Trip = 0; uint32_t Trip = 0;
if (Get_Dis_Unit() == 0) /* 公制 */ if (Get_Dis_Unit() == 0) /* 公制 */
{ {
Trip = Data_Read_Trip(EM_TRIP_B); Trip = Data_Read_Trip(EM_TRIP_A);
} }
else if (Get_Dis_Unit() == 1) /* 英制 */ else if (Get_Dis_Unit() == 1) /* 英制 */
{ {
Trip = Data_Km_To_Mile(Data_Read_Trip(EM_TRIP_B)); Trip = Data_Km_To_Mile(Data_Read_Trip(EM_TRIP_A));
} }
else /* 无效值,按照公里处理,理论上不会执行到这 */ else /* 无效值,按照公里处理,理论上不会执行到这 */
{ {
Trip = Data_Read_Trip(EM_TRIP_B); Trip = Data_Read_Trip(EM_TRIP_A);
} }
return Trip; return Trip;
} }
...@@ -239,7 +256,15 @@ void Trip_Clear_Km_Service(void) ...@@ -239,7 +256,15 @@ void Trip_Clear_Km_Service(void)
{ {
if (Get_Dis_Unit() == 0) /* 公制 */ if (Get_Dis_Unit() == 0) /* 公制 */
{ {
if (Data_Read_Trip(EM_TRIP_B) > 9999) /* 当前单位在KM时,里程大于999.9KM进行清零 */ if (Data_Read_Trip(EM_TRIP_A) > 9999) /* 当前单位在KM时,里程大于999.9KM进行清零 */
{
Data_Clear_Trip_All();
}
}
else
{
Millib_uint32_t mile_data = Data_Km_To_Mile(Data_Read_Trip(EM_TRIP_A));
if (mile_data > 9999) /* 当前单位在Mile时,里程大于999.9KM进行清零 */
{ {
Data_Clear_Trip_All(); Data_Clear_Trip_All();
} }
......
#include "PowerManagement.h" #include "PowerManagement.h"
#include "Components.h" #include "Components.h"
#include "FaultCode.h" #include "FaultCode.h"
#include "System_Monitor\System_Monitor_User.h"
RTC_Information_st_t g_stRTCInformation; RTC_Information_st_t g_stRTCInformation;
...@@ -35,45 +36,56 @@ void PwrMemInit(void) ...@@ -35,45 +36,56 @@ void PwrMemInit(void)
PowerMemInit(&g_stPwrTasks); PowerMemInit(&g_stPwrTasks);
} }
static void Power_KL30_Init(void) static void Power_KL30_Init(void) //588.6ms
{ {
// ClearODO_Flag = 0; // ClearODO_Flag = 0;
RTE_GPIO_Init(); //50us
Gpio_Init(Gpio_KL30_Init); //650us
UART_Channel_Config_st_t loc_config; UART_Channel_Config_st_t loc_config;
eeprom_StoreInfo_Init(); eeprom_StoreInfo_Init(); //50us
loc_config.u32UARTChEn = 1U; loc_config.u32UARTChEn = 1U;
loc_config.u32UARTbps = 115200U; loc_config.u32UARTbps = 500000U;
loc_config.pfnUARTConfirmCallBack = NULL; loc_config.pfnUARTConfirmCallBack = NULL;
loc_config.pfnUARTReadMsgCallBack = Amt630hUartRecvData; loc_config.pfnUARTReadMsgCallBack = Amt630hUartRecvData;
UART_DeInit(UART2); UART_DeInit(UART2); //50us
RTE_UART_Init(UART_CH2, &loc_config); RTE_UART_Init(UART_CH2, &loc_config); //68.35ms
Common_DataInit(); Common_DataInit(); //50us
Analog_Signal_Conv_Init(); Analog_Signal_Conv_Init(); //150us
Sys_KL30_Init(); Sys_KL30_Init(); //275.55ms
Data_Vehicle_Speed_KL30_Wakeup_Init(); Data_Vehicle_Speed_KL30_Wakeup_Init(); //50us
Data_Engine_Speed_KL30_Wakeup_Init(); Data_Engine_Speed_KL30_Wakeup_Init(); //50us
LINE_IN_Init(); LINE_IN_Init(); //50us+
Key_KL30_Init_EXample(); Key_KL30_Init_EXample(); //50us
Data_User_Mileage_KL30Init(); Data_User_Mileage_KL30Init(); //145.7ms
Fuel_KL30_Init(); Fuel_KL30_Init(); //50us
Oil_Pressure_KL30_Init(); Oil_Pressure_KL30_Init(); //50us
BackLight_30_Init(); BackLight_30_Init(); //50us+
Amt630hInit(); Amt630hInit(); //97.9ms
Telltales_Init(); Telltales_Init(); //50us+
g_stRTCInformation.u8RTCSecond = 0; g_stRTCInformation.u8RTCSecond = 0;
g_stRTCInformation.u8RTCMinute = 0; g_stRTCInformation.u8RTCMinute = 0;
g_stRTCInformation.u8RTCHour = 0; g_stRTCInformation.u8RTCHour = 0;
g_stRTCInformation.u8RTCDayOfMonth = 1; g_stRTCInformation.u8RTCDayOfMonth = 1;
g_stRTCInformation.u8RTCMonth = 1; g_stRTCInformation.u8RTCMonth = 1;
g_stRTCInformation.u8RTCYear = 20; g_stRTCInformation.u8RTCYear = 20;
RTE_RTC_Init(g_stRTCInformation); RTE_RTC_Init(g_stRTCInformation); //100us
Menu_User_Init(); Menu_User_Init(); //100us
UDS_Startup_Init(); UDS_Startup_Init(); //50us
Can_Init(); Can_Init(); //300us
Protocol_KL30_Wakeup_Init(); Protocol_KL30_Wakeup_Init(); //50us
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
FaultCode_Init(); RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising); //50us+
TEMP_KL30_Init(); FaultCode_Init(); //50us
TEMP_KL30_Init(); //50us
// g_u32ISRtime.g_u32Starttime = g_u32ISRtime.g_u32Ntime;
// g_u32ISRtime.g_u8IAsrtimesta = SysTick->VAL;
// g_u32ISRtime.g_u32Endtime = g_u32ISRtime.g_u32Ntime;
// g_u32ISRtime.g_u8IAsrtimeend = SysTick->VAL;
} }
static void Power_Wakeup_Init(void) static void Power_Wakeup_Init(void)
...@@ -156,8 +168,8 @@ static void Power_Sleep_Init(void) ...@@ -156,8 +168,8 @@ static void Power_Sleep_Init(void)
TMM1_Stop(); TMM1_Stop();
TMM_All_Stop(); TMM_All_Stop();
RTE_ADC_DeInit(); RTE_ADC_DeInit();
Gpio_Init(Gpio_Sleep_Init);
AMT630H_Sleep(); AMT630H_Sleep();
Gpio_Init(Gpio_Sleep_Init);
Analog_Signal_Conv_Stop(); Analog_Signal_Conv_Stop();
RTE_UART_Sleep_Init(UART_CH2); RTE_UART_Sleep_Init(UART_CH2);
CGC_HSI_CFG_AS_FCLK(); /* 配置时钟生成控制器(cgc)以将内部高速振荡器(HSI)作为CPU系统时钟(FCLK)以及可能的其他硬件电路的时钟源。 */ CGC_HSI_CFG_AS_FCLK(); /* 配置时钟生成控制器(cgc)以将内部高速振荡器(HSI)作为CPU系统时钟(FCLK)以及可能的其他硬件电路的时钟源。 */
...@@ -211,7 +223,7 @@ static Power_Status_em Power_Stay_Protect(void) ...@@ -211,7 +223,7 @@ static Power_Status_em Power_Stay_Protect(void)
{ {
Power_Status_em u8PowerSts; Power_Status_em u8PowerSts;
// static uint8_t i; // static uint8_t i;
static uint8_t Delaycnt; // static uint8_t Delaycnt;
/* 关闭所有外设,坪保留AD采集,电溝状思切�? */ /* 关闭所有外设,坪保留AD采集,电溝状思切�? */
......
...@@ -43,7 +43,7 @@ typedef Power_Status_em (*pfunc_Power_ON)(void); ...@@ -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_SLEEP)(void);
typedef Power_Status_em (*pfunc_Power_LIM)(void); typedef Power_Status_em (*pfunc_Power_LIM)(void);
typedef struct typedef struct __attribute__((aligned(4)))
{ {
pfunPower_KL30_Init Pwr_KL30_Init; pfunPower_KL30_Init Pwr_KL30_Init;
pfunPower_IG_OFF_Init Pwr_IG_OFF_Init; pfunPower_IG_OFF_Init Pwr_IG_OFF_Init;
......
...@@ -11,7 +11,7 @@ typedef struct stRTESIICMasterHandler ...@@ -11,7 +11,7 @@ typedef struct stRTESIICMasterHandler
uint8_t u8Busy; uint8_t u8Busy;
uint8_t u8ReceivedACK; uint8_t u8ReceivedACK;
uint16_t u16Rsvd; uint16_t u16Rsvd;
}SIIC_M_Handler_st_t; } __attribute__((aligned(4))) SIIC_M_Handler_st_t;
typedef enum typedef enum
{ {
......
...@@ -47,7 +47,7 @@ typedef monitorlib_uint8_t (*Get_LineInStatus)(void); ...@@ -47,7 +47,7 @@ typedef monitorlib_uint8_t (*Get_LineInStatus)(void);
typedef void (*COMMON_Delay)(monitorlib_uint32_t mMs); typedef void (*COMMON_Delay)(monitorlib_uint32_t mMs);
typedef void (*pfunLogic)(void); typedef void (*pfunLogic)(void);
typedef struct typedef struct __attribute__((aligned(4)))
{ {
Get_Voltage_Vaild SysGet_KL30_Valid; Get_Voltage_Vaild SysGet_KL30_Valid;
Get_Voltage_Vaild SysGet_KL15_Valid; Get_Voltage_Vaild SysGet_KL15_Valid;
......
...@@ -67,7 +67,7 @@ typedef Tellib_uint32_t (*LED_PowerOFFTimer)(void); /**< 指示灯IG OFF时间 ...@@ -67,7 +67,7 @@ typedef Tellib_uint32_t (*LED_PowerOFFTimer)(void); /**< 指示灯IG OFF时间
* @brief 指示灯初始化结构体 \n * @brief 指示灯初始化结构体 \n
* 定义指示灯初始化结构体属性 * 定义指示灯初始化结构体属性
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
Tellib_uint32_t TotalLength; /**< 指示灯总数量 */ Tellib_uint32_t TotalLength; /**< 指示灯总数量 */
LED_PowerOFFTimer LED_PowerOFF_TimerCbk; /**< IG OFF下计时时间戳回调函数 */ LED_PowerOFFTimer LED_PowerOFF_TimerCbk; /**< IG OFF下计时时间戳回调函数 */
...@@ -78,7 +78,7 @@ typedef struct ...@@ -78,7 +78,7 @@ typedef struct
* @brief 指示灯属性结构体 \n * @brief 指示灯属性结构体 \n
* 定义指示灯结构体属性 * 定义指示灯结构体属性
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
Tellib_uint16_t LED_Index; /**< 指示灯序号 */ Tellib_uint16_t LED_Index; /**< 指示灯序号 */
Tellib_uint16_t isSelfCheck; /**< 指示灯是否执行自检 */ Tellib_uint16_t isSelfCheck; /**< 指示灯是否执行自检 */
......
...@@ -39,9 +39,10 @@ static Tellib_uint16_t LED_Bluetooth_Judgement(void); ...@@ -39,9 +39,10 @@ static Tellib_uint16_t LED_Bluetooth_Judgement(void);
static void LED_Bluetooth_Execution(Tellib_uint16_t led_status); static void LED_Bluetooth_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_E_Judgement(void); static Tellib_uint16_t LED_E_Judgement(void);
static void LED_E_Execution(Tellib_uint16_t led_status); static void LED_E_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_S_Judgement(void); // static Tellib_uint16_t LED_S_Judgement(void);
static void LED_S_Execution(Tellib_uint16_t led_status); // static void LED_S_Execution(Tellib_uint16_t led_status);
uint8_t u8CanId401Flag = 0; uint8_t u8CanId401Flag = 0;
__align(4)
const LED_Attribute_st LED_Attribute [ LED_Max ] = { const LED_Attribute_st LED_Attribute [ LED_Max ] = {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */ /* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...@@ -61,6 +62,7 @@ const LED_Attribute_st LED_Attribute [ LED_Max ] = { ...@@ -61,6 +62,7 @@ const LED_Attribute_st LED_Attribute [ LED_Max ] = {
{em_LED_Bluetooth, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Bluetooth_Judgement, LED_Bluetooth_Execution }, {em_LED_Bluetooth, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Bluetooth_Judgement, LED_Bluetooth_Execution },
{em_LED_E, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_E_Judgement, LED_E_Execution }, {em_LED_E, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_E_Judgement, LED_E_Execution },
}; };
__align(4)
Tellib_uint8_t Tel_Mem [ Tel_MEM_Block_Size * LED_Max + Tel_MEM_Block_Addition ]; Tellib_uint8_t Tel_Mem [ Tel_MEM_Block_Size * LED_Max + Tel_MEM_Block_Addition ];
void Telltales_Init(void) void Telltales_Init(void)
{ {
......
...@@ -139,7 +139,7 @@ typedef enum ...@@ -139,7 +139,7 @@ typedef enum
/**@struct RTE_GPIO_Config_st_t /**@struct RTE_GPIO_Config_st_t
* @brief GPIO端口的配置结构 \n * @brief GPIO端口的配置结构 \n
*/ */
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint16_t u16PinNum; /**< GPIO端口编号(RTE_GPIO_PORTxx_PINyy) */ uint16_t u16PinNum; /**< GPIO端口编号(RTE_GPIO_PORTxx_PINyy) */
uint16_t u16PinMode; /**< GPIO工作模式 */ uint16_t u16PinMode; /**< GPIO工作模式 */
......
...@@ -160,7 +160,7 @@ void RTE_RTC_Init(RTC_Information_st_t g_stRTCInformation) ...@@ -160,7 +160,7 @@ void RTE_RTC_Init(RTC_Information_st_t g_stRTCInformation)
RTC_InitStructure.RTC_1HZ_Output = DISABLE; //RTC1HZ diable output RTC_InitStructure.RTC_1HZ_Output = DISABLE; //RTC1HZ diable output
RTC_Init(&RTC_InitStructure); RTC_Init(&RTC_InitStructure);
ISR_Register(RTC_IRQn, rtc_interrupt); //RTC????��????��??��??�� // ISR_Register(RTC_IRQn, rtc_interrupt); //RTC????��????��??��??��
RTE_RTC_Start(); RTE_RTC_Start();
......
...@@ -37,7 +37,7 @@ typedef enum ...@@ -37,7 +37,7 @@ typedef enum
} RTC_Alarm_Days_en_t; } RTC_Alarm_Days_en_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint8_t u8RTCYear; /*00~~99 in Dec*/ uint8_t u8RTCYear; /*00~~99 in Dec*/
uint8_t u8RTCMonth; /*01~~12 in Dec*/ uint8_t u8RTCMonth; /*01~~12 in Dec*/
......
...@@ -3,10 +3,23 @@ ...@@ -3,10 +3,23 @@
#ifndef RTE_TICK_TIMER_H__ #ifndef RTE_TICK_TIMER_H__
#define RTE_TICK_TIMER_H__ #define RTE_TICK_TIMER_H__
typedef struct __attribute__((aligned(4)))
{
uint32_t g_u32Starttime;
uint32_t g_u32Endtime;
uint32_t g_u32Ntime;
uint8_t g_u8IAsrtimesta;
uint8_t g_u8IAsrtimeend;
}g_TestISRtime;
/* Tick timer interrupt call back function */ /* Tick timer interrupt call back function */
typedef void (*RTE_Tick_Timer_Call_Back_ptr_t)(void); typedef void (*RTE_Tick_Timer_Call_Back_ptr_t)(void);
extern void RTE_Tick_Timer_Start(uint32_t u32Interval, RTE_Tick_Timer_Call_Back_ptr_t pfnCallBack); extern void RTE_Tick_Timer_Start(uint32_t u32Interval, RTE_Tick_Timer_Call_Back_ptr_t pfnCallBack);
extern void RTE_Tick_Timer_Stop(void); extern void RTE_Tick_Timer_Stop(void);
extern void RTE_SysTick_Handler(void); extern void RTE_SysTick_Handler(void);
extern g_TestISRtime g_u32ISRtime;
#endif /* RTE_TICK_TIMER_H__ */ #endif /* RTE_TICK_TIMER_H__ */
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#define RTE_TICK_TIMER_CLK_SRC_FREQ (64000000UL) #define RTE_TICK_TIMER_CLK_SRC_FREQ (64000000UL)
#define RTE_SysTick_LOAD_RELOAD_Msk 0xFFFFFFUL #define RTE_SysTick_LOAD_RELOAD_Msk 0xFFFFFFUL
g_TestISRtime g_u32ISRtime;
RTE_Tick_Timer_Call_Back_ptr_t g_pfnRTETickTimerCallBackFunc = NULL; RTE_Tick_Timer_Call_Back_ptr_t g_pfnRTETickTimerCallBackFunc = NULL;
uint32_t u8Value_us =0; uint32_t u8Value_us =0;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "isr.h" #include "isr.h"
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint32_t u32Period[RTE_TIM40_PERIOD_FILTER_SUM]; uint32_t u32Period[RTE_TIM40_PERIOD_FILTER_SUM];
uint32_t u32Freq; uint32_t u32Freq;
...@@ -73,6 +73,7 @@ uint32_t RTE_ENGINE_Freq_Get(void) ...@@ -73,6 +73,7 @@ uint32_t RTE_ENGINE_Freq_Get(void)
return RTE_Frequency_Get(RTE_ENGINE_CAP_CH); return RTE_Frequency_Get(RTE_ENGINE_CAP_CH);
} }
__align(4)
const uint32_t TIM4_Clock[16U] = { const uint32_t TIM4_Clock[16U] = {
64000000UL, 64000000UL,
...@@ -220,7 +221,7 @@ void RTE_Calc_Freq(uint8_t u8ch) ...@@ -220,7 +221,7 @@ void RTE_Calc_Freq(uint8_t u8ch)
uint8_t i = 0U; uint8_t i = 0U;
uint16_t u16TDR; uint16_t u16TDR;
uint16_t u16TSR; uint16_t u16TSR;
uint8_t u8RollingCh = 0; // uint8_t u8RollingCh = 0;
if((u8ch < 0) || (u8ch >= RTE_TIM40_CH_SUM)) if((u8ch < 0) || (u8ch >= RTE_TIM40_CH_SUM))
{ {
...@@ -243,7 +244,7 @@ void RTE_Calc_Freq(uint8_t u8ch) ...@@ -243,7 +244,7 @@ void RTE_Calc_Freq(uint8_t u8ch)
case RTE_TIM40_CH1: case RTE_TIM40_CH1:
u16TDR = TM40->TDR[1U]; u16TDR = TM40->TDR[1U];
u16TSR = TM40->TSR[1U]; u16TSR = TM40->TSR[1U];
u8RollingCh = 0U; // u8RollingCh = 0U;
break; break;
case RTE_TIM40_CH2: case RTE_TIM40_CH2:
u16TDR = TM40->TDR[2U]; u16TDR = TM40->TDR[2U];
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "TrmerM.h" #include "TrmerM.h"
typedef struct typedef struct __attribute__((aligned(4)))
{ {
TIMERM_PWM_Counter_en_t counter; // 定时器选择 TIMERM_PWM_Counter_en_t counter; // 定时器选择
} Display_mode_Struct; } Display_mode_Struct;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "cgc.h" #include "cgc.h"
#include "gpio.h" #include "gpio.h"
#include "isr.h" #include "isr.h"
#include <string.h>
uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *penUARTCfg); uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *penUARTCfg);
...@@ -10,7 +11,7 @@ void RTE_UART_Sleep_Init(UART_Channel_en_t enUARTCh); ...@@ -10,7 +11,7 @@ void RTE_UART_Sleep_Init(UART_Channel_en_t enUARTCh);
/*******************************************************************/ /*******************************************************************/
/*******************************************************/ /*******************************************************/
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint32_t u32UARTCount; /*发送计数*/ uint32_t u32UARTCount; /*发送计数*/
uint32_t u32UARTLEN; /*发送数据总长*/ uint32_t u32UARTLEN; /*发送数据总长*/
...@@ -287,6 +288,7 @@ uint8_t UART_Ch3_Get_TX_Busy_Flag(void) ...@@ -287,6 +288,7 @@ uint8_t UART_Ch3_Get_TX_Busy_Flag(void)
} }
/* 一部代买码,暂时未使用,纯借鉴 */ /* 一部代买码,暂时未使用,纯借鉴 */
#define MAX_SERIAL_BUFF_SIZE 4096 #define MAX_SERIAL_BUFF_SIZE 4096
__align(4) /* 四字节对齐 */
uint8_t mwAmt630hSerialSendBuffer[MAX_SERIAL_BUFF_SIZE] = {0}; uint8_t mwAmt630hSerialSendBuffer[MAX_SERIAL_BUFF_SIZE] = {0};
uint16_t mwAmt630hSerialDataIndex = 0; uint16_t mwAmt630hSerialDataIndex = 0;
uint16_t mwAmt630hSerialSendCnts = 0; uint16_t mwAmt630hSerialSendCnts = 0;
......
...@@ -17,7 +17,7 @@ typedef enum ...@@ -17,7 +17,7 @@ typedef enum
typedef void (*UART_Confirm)(void); typedef void (*UART_Confirm)(void);
typedef void (*UART_Read_Msg)(uint16_t u16UARTData); typedef void (*UART_Read_Msg)(uint16_t u16UARTData);
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint32_t u32UARTChEn; /*通道是否使能*/ uint32_t u32UARTChEn; /*通道是否使能*/
uint32_t u32UARTbps; /*通道实际波特率*/ uint32_t u32UARTbps; /*通道实际波特率*/
......
#include <stddef.h> #include <stddef.h>
#include "Sys_Scheduler_Lib.h" #include "Sys_Scheduler_Lib.h"
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint32_t u32msRocBak; uint32_t u32msRocBak;
uint32_t u32Task2msCnt; uint32_t u32Task2msCnt;
...@@ -12,7 +12,7 @@ typedef struct ...@@ -12,7 +12,7 @@ typedef struct
uint32_t u32Task100msCnt; uint32_t u32Task100msCnt;
} Sys_Scheduler_st_t; } Sys_Scheduler_st_t;
typedef struct typedef struct __attribute__((aligned(4)))
{ {
uint32_t u32Pending; uint32_t u32Pending;
uint32_t u32usCounter; uint32_t u32usCounter;
......
...@@ -37,6 +37,7 @@ extern void Sys_Scheduler_ISR(void); ...@@ -37,6 +37,7 @@ extern void Sys_Scheduler_ISR(void);
extern void Sys_Pseudo_Real_Time_Tasks(void); extern void Sys_Pseudo_Real_Time_Tasks(void);
extern void Sys_2ms_Tasks(void); extern void Sys_2ms_Tasks(void);
extern void Sys_5ms_Tasks(void);
extern void Sys_10ms_Tasks(void); extern void Sys_10ms_Tasks(void);
extern void Sys_20ms_Tasks(void); extern void Sys_20ms_Tasks(void);
extern void Sys_50ms_Tasks(void); extern void Sys_50ms_Tasks(void);
......
...@@ -23,12 +23,12 @@ void Sys_2ms_Tasks(void) ...@@ -23,12 +23,12 @@ void Sys_2ms_Tasks(void)
// Check_MCU_Info_in_630H(); // Check_MCU_Info_in_630H();
DoCAN_Timer_Update(2000u); DoCAN_Timer_Update(2000u);
//Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);无外发 //Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);无外发
CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp, 2u);
} }
void Sys_5ms_Tasks(void) void Sys_5ms_Tasks(void)
{ {
Flash_Sync_Signal_Generation_Service(); Flash_Sync_Signal_Generation_Service();
CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp, 5u);
} }
void Sys_10ms_Tasks(void) void Sys_10ms_Tasks(void)
...@@ -38,7 +38,7 @@ void Sys_10ms_Tasks(void) ...@@ -38,7 +38,7 @@ void Sys_10ms_Tasks(void)
Line_In_Debounce_Service(10u); Line_In_Debounce_Service(10u);
My_Key_Service(); My_Key_Service();
Data_Mileage_Write_EEPROM(); Data_Mileage_Write_EEPROM();
Key_Clear_Time(); // Key_Clear_Time();
Key_TimeOut_Service(); Key_TimeOut_Service();
Fuel_R_Cal(10u); Fuel_R_Cal(10u);
Oil_R_Cal(10u); Oil_R_Cal(10u);
...@@ -80,7 +80,8 @@ void Sys_100ms_Tasks(void) ...@@ -80,7 +80,8 @@ void Sys_100ms_Tasks(void)
S3_ServerCNTT(); S3_ServerCNTT();
Get_DisTime_Service(); Get_DisTime_Service();
Fuel_Cal_Sevice(100u); Fuel_Cal_Sevice(100u);
// Services_Mileage_Callback(); Services_Mileage_Callback();
Set_Pro_Unique_Identifier(MCU_PartNumber,sizeof(MCU_PartNumber));
// Data_Mileage_Clear(); // Data_Mileage_Clear();
// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High); // RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);
//BackLight_Process(); //BackLight_Process();
...@@ -90,8 +91,10 @@ void Sys_100ms_Tasks(void) ...@@ -90,8 +91,10 @@ void Sys_100ms_Tasks(void)
} }
static uint16_t task_2ms = 0u; static uint16_t task_2ms = 0u;
static uint16_t task_100ms = 0u; static uint16_t task_100ms = 0u;
// uint8_t g_u8GPIOTurnOver = 0U;
void Sys_Exact_50us_Tasks(void) void Sys_Exact_50us_Tasks(void)
{ {
// g_u32ISRtime.g_u32Ntime ++;
static uint32_t task_1ms = 0u; static uint32_t task_1ms = 0u;
GenDelay_Tick(); GenDelay_Tick();
////DoCAN_Timer_Update(50u); ////DoCAN_Timer_Update(50u);
...@@ -112,6 +115,22 @@ void Sys_Exact_50us_Tasks(void) ...@@ -112,6 +115,22 @@ void Sys_Exact_50us_Tasks(void)
if(task_100ms >= 2000U) if(task_100ms >= 2000U)
{ {
task_100ms = 0U; task_100ms = 0U;
Services_Mileage_Callback(); if(Get_MileageInit_Status() == 0X5AA53AA3UL)
{
Data_Mileage_ISR();
}
} }
} // if(g_u8GPIOTurnOver)
\ No newline at end of file // {
// PORT->PM0 &= ~(1<<3);
// PORT->PSET0 = (1<<3);
// g_u8GPIOTurnOver = 0U;
// Gen_TimeDelay(10000u, 50u);
// }
// else
// {
// PORT->PM0 &= ~(1<<3);
// PORT->PCLR0 = (1<<3);
// g_u8GPIOTurnOver = 1U;
// }
}
...@@ -65,10 +65,6 @@ void Sys_Startup_Pre_Init(void) ...@@ -65,10 +65,6 @@ void Sys_Startup_Pre_Init(void)
void Sys_Startup_Init(void) void Sys_Startup_Init(void)
{ {
uint8_t u8StartupMode = 0U; uint8_t u8StartupMode = 0U;
RTE_WDT_Enable();
GenDelay_Init(RTE_WDT_Clear);
RTE_GPIO_Init();
Gpio_Init(Gpio_KL30_Init);
Gen_TimeDelay(10000u, 50u); Gen_TimeDelay(10000u, 50u);
PwrMemInit( ); PwrMemInit( );
Power_Management_Init(u8StartupMode); Power_Management_Init(u8StartupMode);
...@@ -80,6 +76,8 @@ void Sys_Startup_Init(void) ...@@ -80,6 +76,8 @@ void Sys_Startup_Init(void)
int main(void) int main(void)
{ {
Sys_Startup_Pre_Init(); Sys_Startup_Pre_Init();
RTE_WDT_Enable();
GenDelay_Init(RTE_WDT_Clear);
Sys_Scheduler_Init(); Sys_Scheduler_Init();
Sys_Startup_Init(); Sys_Startup_Init();
......
...@@ -83,19 +83,19 @@ uint8_t MCU_PartNumber[20] = {'3', '7', '1', '0', '0', '0', '-', '7', '5', '0', ...@@ -83,19 +83,19 @@ uint8_t MCU_PartNumber[20] = {'3', '7', '1', '0', '0', '0', '-', '7', '5', '0',
/* internal program info */ /* internal program info */
const uint8_t DID_1024[13] = const uint8_t DID_1024[13] =
{ {
((internal_version / 100UL) + 0x30UL), (uint8_t)((internal_version / 100UL) + 0x30UL),
'.', '.',
(((internal_version / 10UL) % 10UL) + 0x30UL), (uint8_t)(((internal_version / 10UL) % 10UL) + 0x30UL),
((internal_version % 10UL) + 0x30UL), (uint8_t)((internal_version % 10UL) + 0x30UL),
'_', '_',
((internal_date / 10000000UL) + 0x30), (uint8_t)((internal_date / 10000000UL) + 0x30),
(((internal_date / 1000000UL) % 10UL) + 0x30), (uint8_t)(((internal_date / 1000000UL) % 10UL) + 0x30),
(((internal_date / 100000UL) % 10UL) + 0x30), (uint8_t)(((internal_date / 100000UL) % 10UL) + 0x30),
(((internal_date / 10000UL) % 10UL) + 0x30), (uint8_t)(((internal_date / 10000UL) % 10UL) + 0x30),
(((internal_date / 1000UL) % 10UL) + 0x30), (uint8_t)(((internal_date / 1000UL) % 10UL) + 0x30),
(((internal_date / 100UL) % 10UL) + 0x30), (uint8_t)(((internal_date / 100UL) % 10UL) + 0x30),
(((internal_date / 10UL) % 10UL) + 0x30), (uint8_t)(((internal_date / 10UL) % 10UL) + 0x30),
((internal_date % 10UL) + 0x30) (uint8_t)((internal_date % 10UL) + 0x30)
}; };
/*写App有效性标志*/ /*写App有效性标志*/
...@@ -134,7 +134,7 @@ void S3_ServerCNTT(void) ...@@ -134,7 +134,7 @@ void S3_ServerCNTT(void)
if(Service27_DelayTimer >= 100U) if(Service27_DelayTimer >= 100U)
{ {
Service27_DelayTimer_Enable = 0U; Service27_DelayTimer_Enable = 0U;
Attemptcnt -= AttemptMaxCnt - 1U; Attemptcnt = (uint8_t)(AttemptMaxCnt - 1U);
Service27_DelayTimer = 0U; Service27_DelayTimer = 0U;
} }
else else
...@@ -680,12 +680,12 @@ void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A ...@@ -680,12 +680,12 @@ void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
case 0x5000U: // 读UUID case 0x5000U: // 读UUID
(void)memcpy(&UDS_ISO14229_Transfer[2], Diag_Write_Data.DID_5000, sizeof(Diag_Write_Data.DID_5000)); (void)memcpy(&UDS_ISO14229_Transfer[2], Diag_Write_Data.DID_5000, sizeof(Diag_Write_Data.DID_5000));
UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, 2 + sizeof(Diag_Write_Data.DID_5000), UDS_ISO14229_Transfer); UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, (uint16_t)(2 + sizeof(Diag_Write_Data.DID_5000)), UDS_ISO14229_Transfer);
break; break;
case 0x1024: // 读内部版本号 case 0x1024: // 读内部版本号
(void)memcpy(&UDS_ISO14229_Transfer[2], DID_1024, sizeof(DID_1024)); (void)memcpy(&UDS_ISO14229_Transfer[2], DID_1024, sizeof(DID_1024));
UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, 2 + sizeof(DID_1024), UDS_ISO14229_Transfer); UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, (uint16_t)(2 + sizeof(DID_1024)), UDS_ISO14229_Transfer);
break; break;
// case 0x2024: // ESP32内部版本号 // case 0x2024: // ESP32内部版本号
......
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
/****************************************************************************** /******************************************************************************
program version program version
*******************************************************************************/ *******************************************************************************/
#define SWV 0x109 // 0x100 = 1.00 software version 软件版本号 #define SWV 0x100 // 0x100 = 1.00 software version 软件版本号
#define HWV 0x120 // 0x100 = 1.00 hardware version 硬件版本号 #define HWV 0x120 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x105 // 0x100 = 1.00 bootloader version boot程序版本号 #define BTV 0x105 // 0x100 = 1.00 bootloader version boot程序版本号
#define internal_version (109UL) /* 内部版本号 105 -> 1.05 */ #define internal_version (110UL) /* 内部版本号 105 -> 1.05 */
#define internal_date (20241111UL) /* 内部版本日期 20240805 -> 2024.08.05 */ #define internal_date (20241129UL) /* 内部版本日期 20240805 -> 2024.08.05 */
/** /**
*DFlash *DFlash
...@@ -349,6 +349,7 @@ typedef struct ...@@ -349,6 +349,7 @@ typedef struct
// uint8_t fill_data[17]; /* 用于保证该结构体长度是4的倍数 */ // uint8_t fill_data[17]; /* 用于保证该结构体长度是4的倍数 */
} Diag_Write_Data_t; } Diag_Write_Data_t;
extern Diag_Write_Data_t Diag_Write_Data; extern Diag_Write_Data_t Diag_Write_Data;
extern uint8_t MCU_PartNumber[20];
extern void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); extern void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); extern void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
......
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