Commit 67f2a9c0 authored by 王雅楠's avatar 王雅楠

Merge branch 'zhengping' of http://tyw-server.synology.me:12345/shihao/haojin750tft into zhengping

parents 4ded9752 ff712839
...@@ -22,3 +22,4 @@ Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/Listings/HaoJin750TFT.map ...@@ -22,3 +22,4 @@ Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/Listings/HaoJin750TFT.map
/Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/Listings/HaoJin750TFT.map /Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/Listings/HaoJin750TFT.map
/Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/*.uvoptx /Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/*.uvoptx
/Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/JLinkLog.txt /Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/JLinkLog.txt
/Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/JLinkLog.txt
...@@ -6,7 +6,7 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp; ...@@ -6,7 +6,7 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] = const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] =
{ {
{0} {0}
}; };
const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
......
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
#include "Components.h" #include "Components.h"
#include "CAN_Signal\CAN_Lib.h" #include "CAN_Signal\CAN_Lib.h"
extern st_CanMsgOp CAN_CH0_CanMsgOp; extern st_CanMsgOp CAN_CH0_CanMsgOp;
extern st_CanMsgTxOp CAN_CH0_CanMsgTxOp; extern st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
typedef enum typedef enum
...@@ -23,7 +21,7 @@ typedef enum ...@@ -23,7 +21,7 @@ typedef enum
typedef enum typedef enum
{ {
TEST, TEST,
CAN_CH0_ID_SEND_TOTAL, CAN_CH0_ID_SEND_TOTAL,
} CAN_CH0_CAN_MSG_SEND_ID_t; } CAN_CH0_CAN_MSG_SEND_ID_t;
......
This diff is collapsed.
// #ifndef _CAN_USER_H_ #ifndef _CAN_USER_H_
// #define _CAN_USER_H_ #define _CAN_USER_H_
// #include "RTE.h" #include "RTE.h"
// #include "Components.h" #include "Components.h"
// /****************************************************************************** /******************************************************************************
// Bus-off Bus-off
// ******************************************************************************/ ******************************************************************************/
// #define RSCAN0_BUS_STABLE 0x00U #define RSCAN0_BUS_STABLE 0x00U
// #define RSCAN0_BUS_OFF_LV1 0x01U #define RSCAN0_BUS_OFF_LV1 0x01U
// #define RSCAN0_BUS_OFF_LV2 0x02U #define RSCAN0_BUS_OFF_LV2 0x02U
// #define RSCAN00_BUS_LIMP 0x03U #define RSCAN00_BUS_LIMP 0x03U
// /****************************************************************************** /******************************************************************************
// Bus-off 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
// { {
// uint8_t Status; uint8_t Status;
// uint8_t Timer; uint8_t Timer;
// uint8_t Cnt; uint8_t Cnt;
// uint8_t ReportDTCCnt; uint8_t ReportDTCCnt;
// } RSCAN0BusoffMonitorStruct; } RSCAN0BusoffMonitorStruct;
// extern void Can_Tx_Apply_Buff(void); extern void Can_Tx_Apply_Buff(void);
// extern void Can_RX_Apply_Buff(void); extern void Can_RX_Apply_Buff(void);
// extern void Can_BusOff_Recover(uint8_t deltaTime); extern void Can_BusOff_Recover(uint8_t deltaTime);
// extern void COM_CAN_Init(void); extern void COM_CAN_Init(void);
// extern void Can_Init(void); extern void Can_Init(void);
// extern void Can_Rx_Cak(CanTxRxMsg *Msg); extern void Can_Rx_Cak(CanTxRxMsg *Msg);
// extern void Busoff(void); extern void Busoff(void);
// extern uint8_t COM_APP_Process(st_CAN_Msg *Msg); extern uint8_t COM_APP_Process(st_CAN_Msg *Msg);
// extern void Can_Write(st_CAN_Msg *Msg); extern void Can_Write(st_CAN_Msg *Msg);
// #endif #endif
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
uint32_t PowerIgnOnTimeLine; uint32_t PowerIgnOnTimeLine;
uint32_t PowerIgnOffTimeLine; uint32_t PowerIgnOffTimeLine;
static uint32_t PowerSocTimeLine; static uint32_t PowerSocTimeLine;
......
...@@ -82,8 +82,7 @@ void Data_Vehicle_Speed_Processing_Service(void) ...@@ -82,8 +82,7 @@ void Data_Vehicle_Speed_Processing_Service(void)
if ((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_101_Msg_Count) == CAN_SIG_LOST) || (Vehicle_Speed > 0XFF)) if ((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_101_Msg_Count) == CAN_SIG_LOST) || (Vehicle_Speed > 0XFF))
{ {
/* 先判断掉线 */ /* 先判断掉线 */
//if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x101_Msg_Count) == CAN_SIG_LOST) if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_101_Msg_Count) == CAN_SIG_LOST)
if(1)
{ {
DataVSpeedValid = 0; DataVSpeedValid = 0;
DataVSpeedActual = 0; DataVSpeedActual = 0;
......
...@@ -28,5 +28,7 @@ ...@@ -28,5 +28,7 @@
#include "Data_VSpeed.h" #include "Data_VSpeed.h"
#include "BackLight.h" #include "BackLight.h"
#include "RTC\RTE_RTC.h" #include "RTC\RTE_RTC.h"
#include "CAN_Signal\CAN_Lib.h"
#include "CAN_CH0_CAN_Communication_Matrix.h"
#endif #endif
...@@ -5,63 +5,156 @@ ...@@ -5,63 +5,156 @@
const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] = const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{ {
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_TurnLeft, }, {LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Turn_Left, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_TurnRight, }, {LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Turn_Right, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 60U, 20U, Get_LINE_IN_HighBeam, }, {LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 60U, 20U, Get_LINE_IN_High_Beam, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Auto_Start_Stop, }, {LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Efi_Fault, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_ABS, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Auto_Start_Stop, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Oil_Pressure_Alert, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Voltage, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Fuel_Level_Low, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_E, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_S, },
}; };
Linelib_uint8_t Get_LINE_IN_Turn_Left(void)
Linelib_uint8_t Get_LINE_IN_TurnLeft(void)
{ {
Linelib_uint8_t ret = 0U; Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(LeftTurn_P_In)) if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{ {
ret = 1u; ret = 1u;
} }
//else else
{ {
ret = 0UL; ret = 0UL;
} }
return ret; return ret;
} }
Linelib_uint8_t Get_LINE_IN_Turn_Right(void)
Linelib_uint8_t Get_LINE_IN_TurnRight(void)
{ {
Linelib_uint8_t ret = 0U; Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(RightTurn_P_In)) if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{ {
ret = 1u; ret = 1u;
} }
//else else
{ {
ret = 0UL; ret = 0UL;
} }
return ret; return ret;
} }
Linelib_uint8_t Get_LINE_IN_High_Beam(void)
Linelib_uint8_t Get_LINE_IN_HighBeam(void)
{ {
Linelib_uint8_t ret = 0U; Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(HighBeam_P_In)) if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{ {
ret = 1u; ret = 1u;
} }
//else else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Efi_Fault(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_ABS(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{ {
ret = 0UL; ret = 0UL;
} }
return ret; return ret;
} }
Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void) Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void)
{ {
Linelib_uint8_t ret = 0U; Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(START_STOP_P_IN)) if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Voltage(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Fuel_Level_Low(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_E(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_S(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{ {
ret = 1u; ret = 1u;
} }
//else else
{ {
ret = 0UL; ret = 0UL;
} }
...@@ -74,7 +167,7 @@ Linelib_uint8_t LINE_IN_Men[LINE_IN_MAX * LINE_IN_BLOCK_SIZE]; ...@@ -74,7 +167,7 @@ Linelib_uint8_t LINE_IN_Men[LINE_IN_MAX * LINE_IN_BLOCK_SIZE];
static Linelib_uint16_t LINE_GET_PWR(void) static Linelib_uint16_t LINE_GET_PWR(void)
{ {
Linelib_uint16_t Res; Linelib_uint16_t Res;
//Res = Common_Get_IG_Sts() & 0x00FFu; Res = Common_Get_IG_Sts() & 0x00FFu;
return Res; return Res;
} }
......
...@@ -5,19 +5,31 @@ ...@@ -5,19 +5,31 @@
typedef enum typedef enum
{ {
LINE_IN_TurnLeft = 0, LINE_IN_Turn_Left,
LINE_IN_TurnRight, LINE_IN_Turn_Right,
LINE_IN_HighBeam, LINE_IN_High_Beam,
LINE_IN_Auto_Start_Stop, LINE_IN_Efi_Fault,
LINE_IN_ABS,
LINE_IN_Auto_Start_Stop,
LINE_IN_Oil_Pressure_Alert,
LINE_IN_Voltage,
LINE_IN_Fuel_Level_Low,
LINE_IN_E,
LINE_IN_S,
LINE_IN_MAX, LINE_IN_MAX,
} LINE_IN_Enum_t; } LINE_IN_Enum_t;
extern void LINE_IN_Init(void); extern void LINE_IN_Init(void);
Linelib_uint8_t Get_LINE_IN_TurnLeft(void); Linelib_uint8_t Get_LINE_IN_Turn_Left(void);
Linelib_uint8_t Get_LINE_IN_TurnRight(void); Linelib_uint8_t Get_LINE_IN_Turn_Right(void);
Linelib_uint8_t Get_LINE_IN_HighBeam(void); Linelib_uint8_t Get_LINE_IN_High_Beam(void);
Linelib_uint8_t Get_LINE_IN_Efi_Fault(void);
Linelib_uint8_t Get_LINE_IN_ABS(void);
Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void); Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void);
Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void);
Linelib_uint8_t Get_LINE_IN_Voltage(void);
Linelib_uint8_t Get_LINE_IN_Fuel_Level_Low(void);
Linelib_uint8_t Get_LINE_IN_E(void);
Linelib_uint8_t Get_LINE_IN_S(void);
#endif #endif
...@@ -53,7 +53,7 @@ static void Power_KL30_Init(void) ...@@ -53,7 +53,7 @@ static void Power_KL30_Init(void)
Data_User_Mileage_KL30Init(); Data_User_Mileage_KL30Init();
Fuel_KL30_Init(); Fuel_KL30_Init();
Amt630hInit(); Amt630hInit();
//Telltales_Init(); Telltales_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
g_stRTCInformation.u8RTCSecond = 0; g_stRTCInformation.u8RTCSecond = 0;
...@@ -62,16 +62,15 @@ static void Power_KL30_Init(void) ...@@ -62,16 +62,15 @@ static void Power_KL30_Init(void)
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);
Menu_User_Init(); Menu_User_Init();
Can_Init();
Protocol_KL30_Wakeup_Init(); Protocol_KL30_Wakeup_Init();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising); RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
} }
//extern uint32_t PowerIgnOffTimeLine;
static void Power_Wakeup_Init(void) static void Power_Wakeup_Init(void)
{ {
// PowerIgnOffTimeLine = 0;
Gpio_Init(Gpio_WakeUp_Init); Gpio_Init(Gpio_WakeUp_Init);
eeprom_StoreInfo_Init(); eeprom_StoreInfo_Init();
Analog_Signal_Conv_Init(); Analog_Signal_Conv_Init();
...@@ -86,9 +85,10 @@ static void Power_Wakeup_Init(void) ...@@ -86,9 +85,10 @@ static void Power_Wakeup_Init(void)
Amt630hInit(); Amt630hInit();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
//Telltales_Init(); Telltales_Init();
Key_KL30_Init_EXample(); Key_KL30_Init_EXample();
Menu_User_WAKEUP(); Menu_User_WAKEUP();
Can_Init();
Protocol_KL30_Wakeup_Init(); Protocol_KL30_Wakeup_Init();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising); RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
} }
...@@ -184,6 +184,7 @@ static Power_Status_em Power_Stay_Protect(void) ...@@ -184,6 +184,7 @@ static Power_Status_em Power_Stay_Protect(void)
/* 关闭所有外设,坪保留AD采集,电溝状思切�? */ /* 关闭所有外设,坪保留AD采集,电溝状思切�? */
{ {
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
} }
u8PowerSts = EM_IGN_OFF_Init; u8PowerSts = EM_IGN_OFF_Init;
/* 电溝模弝正常 */ /* 电溝模弝正常 */
...@@ -196,6 +197,7 @@ static Power_Status_em Power_Stay_Protect(void) ...@@ -196,6 +197,7 @@ static Power_Status_em Power_Stay_Protect(void)
if ( SYS_OPR_STAT_RUN ) if ( SYS_OPR_STAT_RUN )
{ {
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
return u8PowerSts; return u8PowerSts;
} }
......
//#ifndef TELLTALES_USER_H #ifndef TELLTALES_USER_H
//#define TELLTALES_USER_H #define TELLTALES_USER_H
typedef enum
{
//typedef enum em_LED_Turn_Left,
//{ em_LED_Turn_Right,
// em_LED_High_Beam, em_LED_High_Beam,
// em_LED_Efi_Fault, em_LED_Efi_Fault,
// em_LED_Auto_Start_Stop, em_LED_ABS,
// em_LED_Voltage, em_LED_Auto_Start_Stop,
// em_LED_Fuel, em_LED_Oil_Pressure_Alert,
// em_LED_Atmosphere, em_LED_TCS,
// em_LED_HEV,
em_LED_Voltage,
// LED_Max , em_LED_Fuel_Level_Low,
//} LED_Idx_t; em_LED_Coolant_Temperature,
em_LED_WIFI,
//extern Tellib_uint8_t Auto_Start_Stop ; em_LED_Bluetooth,
//void Telltales_Init(void); em_LED_E,
em_LED_S,
//Tellib_uint8_t Telltales_Voltage_Date(void);
//#endif LED_Max ,
} LED_Idx_t;
extern Tellib_uint8_t Auto_Start_Stop ;
void Telltales_Init(void);
Tellib_uint8_t Telltales_Voltage_Date(void);
#endif
...@@ -6,8 +6,21 @@ ...@@ -6,8 +6,21 @@
CANMSG_Type* CANMSG; CANMSG_Type* CANMSG;
CanTxRxMsg CAN_RecvMsg; CanTxRxMsg CAN_RecvMsg;
CANBuffList_t CanBufList = {0};
can_rx_callback can_rx_handler = NULL; can_rx_callback can_rx_handler = NULL;
uint8_t Read_RingBuff(CanTxRxMsg *data)
{
if (CanBufList.length == 0)
{
return 0;
}
*data = CanBufList.data[CanBufList.Head];
CanBufList.Head = (CanBufList.Head + 1) % LIST_BUF_MAX_NUM;
CanBufList.length--;
return 1;
}
/** /**
* @brief CAN就收完成回调 * @brief CAN就收完成回调
* *
...@@ -20,8 +33,8 @@ static void can_recv_handler(void *msg) ...@@ -20,8 +33,8 @@ static void can_recv_handler(void *msg)
if (CAN_GetFlagStatus(CAN0, CAN_FLAG_REC) != RESET) if (CAN_GetFlagStatus(CAN0, CAN_FLAG_REC) != RESET)
{ {
CAN_ClearFlag(CAN0, CAN_FLAG_REC); CAN_ClearFlag(CAN0, CAN_FLAG_REC);
// CANMSG = CAN_Get_CANxMSGy(CAN0); CAN_Receive_IT(CAN0, &CanBufList);
// CAN_Receive_IT(CAN0, &CAN_RecvMsg); Read_RingBuff(&CAN_RecvMsg);
if (can_rx_handler != NULL) if (can_rx_handler != NULL)
{ {
...@@ -31,9 +44,9 @@ static void can_recv_handler(void *msg) ...@@ -31,9 +44,9 @@ static void can_recv_handler(void *msg)
} }
/** /**
* @brief CAN初始? * @brief CAN初始?
* *
* @param config CAN初始结构体指? * @param config CAN初始结构体指?
* @return uint8_t 0成功 1失败 * @return uint8_t 0成功 1失败
*/ */
uint8_t rte_can_init(can_config_st_t *config) uint8_t rte_can_init(can_config_st_t *config)
...@@ -98,7 +111,7 @@ uint8_t rte_can_init(can_config_st_t *config) ...@@ -98,7 +111,7 @@ uint8_t rte_can_init(can_config_st_t *config)
/** /**
* @brief can反初始化 * @brief can反初始化
* @param CANx CAN0 ? CAN1 * @param CANx CAN0 ? CAN1
* *
* @return uint8_t 0成功 1失败 * @return uint8_t 0成功 1失败
*/ */
...@@ -124,10 +137,10 @@ uint8_t rte_can_deinit(CAN_CH ch) ...@@ -124,10 +137,10 @@ uint8_t rte_can_deinit(CAN_CH ch)
/** /**
* @brief 获取CAN是否BusOff * @brief 获取CAN是否BusOff
* @param CANx CAN0 ? CAN1 * @param CANx CAN0 ? CAN1
* *
* @return uint8_t 0 没有busoff * @return uint8_t 0 没有busoff
* 1 错误的操? 2 busoff * 1 错误的操? 2 busoff
*/ */
uint8_t get_can_busoff(CAN_CH ch) uint8_t get_can_busoff(CAN_CH ch)
{ {
...@@ -151,9 +164,9 @@ uint8_t get_can_busoff(CAN_CH ch) ...@@ -151,9 +164,9 @@ uint8_t get_can_busoff(CAN_CH ch)
} }
/** /**
* @brief 从busoff状态恢? * @brief 从busoff状态恢?
* *
* @param CANx CAN0 ? CAN1 * @param CANx CAN0 ? CAN1
* @return uint8_t 0成功 1失败 * @return uint8_t 0成功 1失败
*/ */
uint8_t reset_busoff(CAN_CH ch) uint8_t reset_busoff(CAN_CH ch)
...@@ -189,7 +202,7 @@ uint8_t reset_busoff(CAN_CH ch) ...@@ -189,7 +202,7 @@ uint8_t reset_busoff(CAN_CH ch)
return 0; return 0;
} }
/* 下面是一些例? 自己? /* 下面是一些例�? 自己�?
CAN_SendMsg.Id = 0x00aa0432; CAN_SendMsg.Id = 0x00aa0432;
CAN_SendMsg.IDE = CAN_Id_Extended; CAN_SendMsg.IDE = CAN_Id_Extended;
CAN_SendMsg.CacheType = CAN_CacheType_Tx; CAN_SendMsg.CacheType = CAN_CacheType_Tx;
......
...@@ -11,24 +11,21 @@ uint32_t RTE_SystemCoreClock; ...@@ -11,24 +11,21 @@ uint32_t RTE_SystemCoreClock;
extern uint32_t SystemCoreClock; extern uint32_t SystemCoreClock;
void RTE_CLOCK_Select_Start(void) void RTE_CLOCK_Select_Start(void)
{ {
////uint32_t msCnt;
#ifdef USED_FX_FCLK #ifdef USED_FX_FCLK
/* config clock */ CGC_Osc_Setting(OSC_OSCILLATOR,OSC_UNDER_10M,OSC_OSCILLATOR,OSC_NORMAL_POWER);
CGC_HSEConfig(OSC_OSCILLATOR,OSC_UNDER_10M); CGC_PLL_Setting(PLL_SR_fMX,PLL_DIV_2,PLL_MUL_16);
CGC_PLL_Setting(PLL_SR_fMX,PLL_DIV_2,PLL_MUL_16); CGC_PLL_CFG_AS_FCLK();
CGC_PLL_CFG_AS_FCLK(); delay_init(64000000);
SystemCoreClockUpdate(); SystemCoreClock = 64000000UL;
RTE_SystemCoreClock = SystemCoreClock;
delay_init(64000000);
SystemCoreClock = 64000000UL;
#endif #endif
#ifdef USED_FHOCO_FCLK #ifdef USED_FHOCO_FCLK
SystemCoreClockUpdate(); SystemCoreClockUpdate();
msCnt = SystemCoreClock / 1000; msCnt = SystemCoreClock / 1000;
SysTick_Config(msCnt); SysTick_Config(msCnt);
delay_init(SystemCoreClock); delay_init(SystemCoreClock);
#endif #endif
} }
......
...@@ -15,6 +15,8 @@ void Sys_2ms_Tasks(void) ...@@ -15,6 +15,8 @@ void Sys_2ms_Tasks(void)
Sys_Status_Update_Service(); Sys_Status_Update_Service();
Analog_Signal_Conv_Service(); Analog_Signal_Conv_Service();
AMT630H_Main(); AMT630H_Main();
//Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);无外发
CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp, 2u);
} }
void Sys_5ms_Tasks(void) void Sys_5ms_Tasks(void)
...@@ -24,6 +26,7 @@ void Sys_5ms_Tasks(void) ...@@ -24,6 +26,7 @@ void Sys_5ms_Tasks(void)
void Sys_10ms_Tasks(void) void Sys_10ms_Tasks(void)
{ {
Line_In_Debounce_Service(10u);
Key_Service(); Key_Service();
Key_Clear_Time(); Key_Clear_Time();
Key_TimeOut_Service(); Key_TimeOut_Service();
...@@ -38,6 +41,7 @@ void Sys_20ms_Tasks(void) ...@@ -38,6 +41,7 @@ void Sys_20ms_Tasks(void)
void Sys_50ms_Tasks(void) void Sys_50ms_Tasks(void)
{ {
Telltales_Management();
g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information(); g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information();
} }
......
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