基本功能代码完成
This commit is contained in:
parent
d91b8980d1
commit
eea1f07eb2
@ -7,7 +7,7 @@
|
||||
|
||||
CAN_NW_STATE euNwState;
|
||||
|
||||
unsigned char ucNwSendPduType; //网络管理控制发送选择 0:关闭发送 1:发送APP报文 2:发送网络管理APP报文
|
||||
unsigned char ucNwSendPduType; //网络管理控制发送选择 0:关闭发送 1:发送APP报文 2:发送网络管理APP报文
|
||||
unsigned int uiNwTimCnt;
|
||||
unsigned int uiNwToutCnt;
|
||||
unsigned int uiNwRMSCnt;
|
||||
@ -54,15 +54,15 @@ void CanNwInit(void)
|
||||
ucNwNetIdelFlg = 0;
|
||||
ucPreLocWkpStu = PASSIVE_WAKEUP;
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
ucNetActiveFlg = 0;//网络管理使能
|
||||
ucNetActiveFlg = 0;//网络管理使能
|
||||
|
||||
Can_Nw_Init();
|
||||
}
|
||||
|
||||
/*
|
||||
函数名:void CanNwHandle(void)
|
||||
调度周期时间:10ms
|
||||
相关说明:网络管理程序,包含唤醒检测,网络管理状态机切换,网络空闲检测
|
||||
函数名:void CanNwHandle(void)
|
||||
调度周期时间:10ms
|
||||
相关说明:网络管理程序,包含唤醒检测,网络管理状态机切换,网络空闲检测
|
||||
*/
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ void CanNwHandle(void)
|
||||
if(FlgTemp == 0)
|
||||
{
|
||||
FlgTemp = 1;
|
||||
C0CTRH &= ~0x0300; // 设置正常模式
|
||||
C0CTRH &= ~0x0300; // 设置正常模式
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -88,7 +88,7 @@ void CanNwHandle(void)
|
||||
FlgTemp = 0;
|
||||
if(FlgTemp1 == 0)
|
||||
{
|
||||
C0CTRH |= 0x0300; // 设置监听模式
|
||||
C0CTRH |= 0x0300; // 设置监听模式
|
||||
FlgTemp1 = 1;
|
||||
}
|
||||
}
|
||||
@ -109,13 +109,13 @@ void CanNwHandle(void)
|
||||
if((ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)||(ucActiveWakeupBit == REMOTE_ACTIVE_WAKEUP))
|
||||
{
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
euNwState = CAN_NW_RMS_SLEEP; //睡眠模式到重复消息模式
|
||||
//设置100ms周期发送NW_PDU
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
euNwState = CAN_NW_RMS_SLEEP; //睡眠模式到重复消息模式
|
||||
//设置100ms周期发送NW_PDU
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0;
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
uiNwPduCycCnt = 0;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP) //本地唤醒进入立即发送网络管理报文模式
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP) //本地唤醒进入立即发送网络管理报文模式
|
||||
{
|
||||
ImmediateNM_count = 0;
|
||||
uiSetNwPduCycVal = IMMEDIATENM_CYCLE_TIMER_THR;
|
||||
@ -149,34 +149,34 @@ void CanNwHandle(void)
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
}
|
||||
else /*if(ucActiveWakeupBit == REMOTE_ACTIVE_WAKEUP)*/
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
//if(uiNwLocWkpOffCnt == NM_TIMEOUT)
|
||||
if(uiNwRMSCnt == NM_TIMEOUT)
|
||||
{
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
uiNwTimCnt = 500-uiNwPduCycCnt;
|
||||
ucNwSendPduType = SEND_APP_PDU;
|
||||
}
|
||||
@ -193,34 +193,34 @@ void CanNwHandle(void)
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
}
|
||||
else /*if(ucActiveWakeupBit == REMOTE_ACTIVE_WAKEUP)*/
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
/*
|
||||
if(uiNwLocWkpOffCnt == NM_TIMEOUT)
|
||||
{
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
uiNwTimCnt = 500-uiNwPduCycCnt;;
|
||||
ucNwSendPduType = SEND_APP_PDU;
|
||||
}
|
||||
@ -228,7 +228,7 @@ void CanNwHandle(void)
|
||||
//SW030BT03
|
||||
if(uiNwRMSCnt == NM_TIMEOUT)
|
||||
{
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
uiNwTimCnt = 500-uiNwPduCycCnt;
|
||||
ucNwSendPduType = SEND_APP_PDU;
|
||||
}
|
||||
@ -244,35 +244,35 @@ void CanNwHandle(void)
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
|
||||
}
|
||||
}
|
||||
else /*if(ucActiveWakeupBit == REMOTE_ACTIVE_WAKEUP)*/
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
/*
|
||||
if(uiNwLocWkpOffCnt == NM_TIMEOUT)
|
||||
{
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
uiNwTimCnt = 500-uiNwPduCycCnt;;
|
||||
ucNwSendPduType = SEND_APP_PDU;
|
||||
}
|
||||
@ -280,7 +280,7 @@ void CanNwHandle(void)
|
||||
//SW030BT03
|
||||
if(uiNwRMSCnt == NM_TIMEOUT)
|
||||
{
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
uiNwTimCnt = 500-uiNwPduCycCnt;
|
||||
ucNwSendPduType = SEND_APP_PDU;
|
||||
}
|
||||
@ -296,34 +296,34 @@ void CanNwHandle(void)
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
}
|
||||
else /*if(ucActiveWakeupBit == REMOTE_ACTIVE_WAKEUP)*/
|
||||
{
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
if(uiNwRMSCnt == NM_TIMEOUT) //1S超时进入正常模式
|
||||
{
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
euNwState = CAN_NW_NOS_REPEAT_MESSAGE; //重复状态模式进入正常模式
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0; //网络管理定时器重置为“0”
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR; //设置200ms周期发送NW_PDU
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
//if(uiNwTimCnt > REPEAT_MESSAGE_TIMER_THR) //唤醒信号超时1S后
|
||||
/*
|
||||
if(uiNwLocWkpOffCnt == NM_TIMEOUT)
|
||||
{
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
uiNwTimCnt = 0;
|
||||
ucNwSendPduType = SEND_APP_PDU;
|
||||
}
|
||||
@ -331,7 +331,7 @@ void CanNwHandle(void)
|
||||
//SW030BT03
|
||||
if(uiNwRMSCnt == NM_TIMEOUT)
|
||||
{
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
euNwState = CAN_NW_READY_SLEEP; //重复状态进入准备睡眠模式
|
||||
uiNwTimCnt = 500-uiNwPduCycCnt;
|
||||
ucNwSendPduType = SEND_APP_PDU;
|
||||
}
|
||||
@ -359,12 +359,12 @@ void CanNwHandle(void)
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)
|
||||
{
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
else /*if(ucActiveWakeupBit == REMOTE_ACTIVE_WAKEUP)*/
|
||||
{
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
|
||||
}
|
||||
@ -404,12 +404,12 @@ void CanNwHandle(void)
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)
|
||||
{
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
}
|
||||
else /*if(ucActiveWakeupBit == REMOTE_ACTIVE_WAKEUP)*/
|
||||
{
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
|
||||
}
|
||||
@ -434,7 +434,7 @@ void CanNwHandle(void)
|
||||
{
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
euNwState = CAN_NW_NOS_READY_SLEEP;
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0;
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR;
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
@ -463,7 +463,7 @@ void CanNwHandle(void)
|
||||
RSSDiagReq = 0;
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
euNwState = CAN_NW_NOS_READY_SLEEP;
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiNwTimCnt = 0;
|
||||
uiSetNwPduCycVal = NM_NORMAL_CYCLE_TIMER_THR;
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
@ -497,12 +497,12 @@ void CanNwHandle(void)
|
||||
{
|
||||
uiNwLocWkpOffCnt = NM_TIMEOUT_TIMER_THR;
|
||||
euNwState = CAN_NW_RMS_PREPARE_SLEEP;
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiSetNwPduCycVal = REPEAT_NW_CYCLE_TIMER_THR; //设置100ms周期发送NW_PDU
|
||||
uiNwRMSCnt = REPEAT_MESSAGE_TIMER_THR; //设置1S超时后进入正常模式定时器
|
||||
uiSetNwPduCycVal = REPEAT_NW_CYCLE_TIMER_THR; //设置100ms周期发送NW_PDU
|
||||
uiNwTimCnt = 0;
|
||||
ucNwSendPduType = SEND_NWAPP_PDU;
|
||||
uiNwPduCycCnt = 0;
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP) //本地唤醒进入立即发送网络管理报文模式
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP) //本地唤醒进入立即发送网络管理报文模式
|
||||
{
|
||||
ImmediateNM_count = 0;
|
||||
uiSetNwPduCycVal = IMMEDIATENM_CYCLE_TIMER_THR;
|
||||
@ -518,7 +518,7 @@ void CanNwHandle(void)
|
||||
if(uiNwTimCnt > WAIT_BUS_SLEEP_TIMER_THR)
|
||||
{
|
||||
|
||||
//满足进入睡眠条件后 执行睡眠程序,注意唤醒后状态机必须切换到 "euNwState = CAN_NW_RESERVED"
|
||||
//满足进入睡眠条件后 执行睡眠程序,注意唤醒后状态机必须切换到 "euNwState = CAN_NW_RESERVED"
|
||||
if(ucNwNetIdelFlg == 1)
|
||||
{
|
||||
uiNwTimCnt = 0;
|
||||
@ -526,7 +526,7 @@ void CanNwHandle(void)
|
||||
|
||||
FlgTemp = 0;
|
||||
FlgTemp1 = 0;
|
||||
C0CTRH |= 0x0300; // 设置监听模式
|
||||
C0CTRH |= 0x0300; // 设置监听模式
|
||||
|
||||
SleepDetect();
|
||||
}
|
||||
@ -556,7 +556,7 @@ void CanNwHandle(void)
|
||||
TxCanNwMsg_6B7.Msg_Part.RCP3_RMR=1;
|
||||
else
|
||||
TxCanNwMsg_6B7.Msg_Part.RCP3_RMR=0;
|
||||
*/ //20190707一直是0
|
||||
*/ //20190707一直是0
|
||||
TxCanNwMsg_6B7.Msg_Part.RCP3_RMR=0;
|
||||
|
||||
if(ucActiveWakeupBit == LOCAL_ACTIVE_WAKEUP)
|
||||
@ -620,7 +620,7 @@ unsigned char CanNwWakeupSourceCheck(unsigned char LocalSource,unsigned char *Re
|
||||
static unsigned char ucRemWkpTemp = 0u;
|
||||
unsigned char ucRtnTemp;
|
||||
ucRtnTemp = PASSIVE_WAKEUP;
|
||||
if(ucNwPowerUpFlg == 0u) //上电初始化后进入循环后网络管理定时器清"0"
|
||||
if(ucNwPowerUpFlg == 0u) //上电初始化后进入循环后网络管理定时器清"0"
|
||||
{
|
||||
ucNwPowerUpFlg = 1u;
|
||||
uiNwTimCnt = 0u;
|
||||
@ -628,7 +628,7 @@ unsigned char CanNwWakeupSourceCheck(unsigned char LocalSource,unsigned char *Re
|
||||
}
|
||||
else
|
||||
{
|
||||
if(uiNwTimCnt > (NM_NORMAL_CYCLE_TIMER_THR+REPEAT_NW_CYCLE_TIMER_THR)||(*RemoteSource == 1)) //300ms检测一次远程标志位
|
||||
if(uiNwTimCnt > (NM_NORMAL_CYCLE_TIMER_THR+REPEAT_NW_CYCLE_TIMER_THR)||(*RemoteSource == 1)) //300ms检测一次远程标志位
|
||||
{
|
||||
if(*RemoteSource == 1)
|
||||
{
|
||||
|
File diff suppressed because one or more lines are too long
@ -663,6 +663,13 @@
|
||||
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
|
||||
<ParentItem>9acb8dfa-c536-43d2-adb6-96ad9ab90ba1</ParentItem>
|
||||
</Instance>
|
||||
<Instance Guid="0533410d-aaf8-4eb5-94fc-9508128c48ff">
|
||||
<Name>CRC.c</Name>
|
||||
<Type>File</Type>
|
||||
<RelativePath>user\CRC.c</RelativePath>
|
||||
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
|
||||
<ParentItem>9acb8dfa-c536-43d2-adb6-96ad9ab90ba1</ParentItem>
|
||||
</Instance>
|
||||
</Class>
|
||||
<Class Guid="fb98844b-2c27-4275-9804-f6e63e204da0">
|
||||
<Instance Guid="fb98844b-2c27-4275-9804-f6e63e204da0">
|
||||
@ -817,7 +824,9 @@
|
||||
<SourceItemType39>CSource</SourceItemType39>
|
||||
<SourceItemGuid40>f288e9d7-9649-4d48-a164-a4a16245dd2e</SourceItemGuid40>
|
||||
<SourceItemType40>CSource</SourceItemType40>
|
||||
<SourceItemCount>41</SourceItemCount>
|
||||
<SourceItemGuid41>0533410d-aaf8-4eb5-94fc-9508128c48ff</SourceItemGuid41>
|
||||
<SourceItemType41>CSource</SourceItemType41>
|
||||
<SourceItemCount>42</SourceItemCount>
|
||||
<LastDeviceChangedCounter>6</LastDeviceChangedCounter>
|
||||
</Instance>
|
||||
<Instance Guid="6bb7060d-7e24-4135-bd9b-7db166417523">
|
||||
@ -1214,7 +1223,7 @@ user
|
||||
<LinkOptionShowCFI-DefaultValue>False</LinkOptionShowCFI-DefaultValue>
|
||||
<LinkOptionRrmValue-DefaultValue />
|
||||
<IsLockedByUser>False</IsLockedByUser>
|
||||
<TimeTagModified--0>-8585129119329483950</TimeTagModified--0>
|
||||
<TimeTagModified--0>-8584851705356297016</TimeTagModified--0>
|
||||
<LinkOptionAutoSectionLayout-0>False</LinkOptionAutoSectionLayout-0>
|
||||
<LinkOptionCpu-0>False</LinkOptionCpu-0>
|
||||
<LinkOptionDebug-0>Debug</LinkOptionDebug-0>
|
||||
@ -1279,7 +1288,7 @@ user
|
||||
<LinkOptionPostLinkCommands-0 />
|
||||
<LinkOptionShowTotalSize-0>True</LinkOptionShowTotalSize-0>
|
||||
<LinkOptionSymbolForbid-0 />
|
||||
<LinkOptionUserOptByteValue-0>E933E8</LinkOptionUserOptByteValue-0>
|
||||
<LinkOptionUserOptByteValue-0>7833E8</LinkOptionUserOptByteValue-0>
|
||||
<LinkOptionCFIAddFunc-0 />
|
||||
<LinkOptionChangeMessageWarningNumber-0 />
|
||||
<LinkOptionOtherAdditionalOptions-0 />
|
||||
@ -1807,6 +1816,10 @@ user
|
||||
<ItemAddTime>637917687457637381</ItemAddTime>
|
||||
<ItemAddTimeCount>0</ItemAddTimeCount>
|
||||
</Instance>
|
||||
<Instance Guid="0533410d-aaf8-4eb5-94fc-9508128c48ff">
|
||||
<ItemAddTime>638520611476415794</ItemAddTime>
|
||||
<ItemAddTimeCount>0</ItemAddTimeCount>
|
||||
</Instance>
|
||||
<Instance Guid="0b7e78c3-aadd-45ee-9f9d-ffac6141eeb2">
|
||||
<TimeTagModified-SourceItem0--0>-8586968545862092427</TimeTagModified-SourceItem0--0>
|
||||
<SourceItem0-IsLockedByUser>False</SourceItem0-IsLockedByUser>
|
||||
@ -1966,6 +1979,10 @@ user
|
||||
<SourceItem40-IsLockedByUser>False</SourceItem40-IsLockedByUser>
|
||||
<SourceItem40-BuildingTarget-0>True</SourceItem40-BuildingTarget-0>
|
||||
<SourceItem40-IndividualCompileOption-0>False</SourceItem40-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem41--0>-8584851713378360014</TimeTagModified-SourceItem41--0>
|
||||
<SourceItem41-IsLockedByUser>False</SourceItem41-IsLockedByUser>
|
||||
<SourceItem41-BuildingTarget-0>True</SourceItem41-BuildingTarget-0>
|
||||
<SourceItem41-IndividualCompileOption-0>False</SourceItem41-IndividualCompileOption-0>
|
||||
</Instance>
|
||||
<Instance Guid="e4582a76-90da-4988-9864-24db24826845">
|
||||
<TimeTagModified-SourceItem14--0>-8586968545212665282</TimeTagModified-SourceItem14--0>
|
||||
@ -2800,8 +2817,8 @@ user
|
||||
<ADC />
|
||||
</Effect>
|
||||
</VDDValue>
|
||||
<AD_ADPC_USEDPIN Name="AD_ADPC_USEDPIN" Text="ANI0," />
|
||||
<AD_ADS_USEDPIN Name="AD_ADS_USEDPIN" Text="ANI0," />
|
||||
<AD_ADPC_USEDPIN Name="AD_ADPC_USEDPIN" Text="" />
|
||||
<AD_ADS_USEDPIN Name="AD_ADS_USEDPIN" Text="" />
|
||||
<ADPCForPort3 Name="ADPCForPort3" Value="2" Comment="ADPCForPort3" />
|
||||
<ADPCForPort8 Name="ADPCForPort8" Value="3" Comment="ADPCForPort8" />
|
||||
<ADPCForPort9 Name="ADPCForPort9" Value="255" Comment="ADPCForPort9" />
|
||||
@ -2944,7 +2961,7 @@ user
|
||||
</RTC1HZ>
|
||||
<RXD0 Name="RXD0" Text="disable" />
|
||||
<ProjectName Name="PrjName" Text="ECU_APP" />
|
||||
<ProjectPath Name="PrjPath" Text="F:\FCB_project\temp\QJTYKG\CODE\ECU_APP" />
|
||||
<ProjectPath Name="PrjPath" Text="F:\FCB_project\temp\HS550\code\ECU_APP" />
|
||||
<ProjectKind Name="PrjKind" Text="Project78K0R" />
|
||||
<DeviceName Name="DeviceName" Fixed="" Text="RL78F13" />
|
||||
<MCUName Name="MCUName" Text="RL78F13_32pin" />
|
||||
@ -2961,7 +2978,7 @@ user
|
||||
<StartAddressOfOnChipDebugOptionBytes Name="GOStart" Text="1FE00" />
|
||||
<SizeOfOnChipDebugOptionBytesArea Name="GOSizeValue" Text="512" />
|
||||
<UserOptionBytes Name="GB" Text="1" />
|
||||
<UserOptionBytesValue Name="GBValue" Text="E933E8" />
|
||||
<UserOptionBytesValue Name="GBValue" Text="7833E8" />
|
||||
<RAMStartAddress Chip="R5F10AGG,R5F10ALG,R5F10AMG,R5F10BAG,R5F10BBG,R5F10BGG,R5F10BLG,R5F10BMG" Name="RAMStartAddress" Fixed="" Text="000FDF00" />
|
||||
<RAMEndAddress Name="RAMEndAddress" Fixed="" Text="000FFEFF" />
|
||||
<ROMEndAddress Chip="R5F10AGG,R5F10ALG,R5F10AMG,R5F10BAG,R5F10BBG,R5F10BGG,R5F10BLG,R5F10BMG" Name="ROMEndAddress" Fixed="" Text="0001FFFF" />
|
||||
@ -3039,7 +3056,7 @@ user
|
||||
</Port1>
|
||||
<Port3 Chip="RL78F13_20pin,RL78F13_30pin,RL78F13_32pin">
|
||||
<P30 Name="P30/TI01/TO01/TRDIOD1/_SSI00/INTP2/SNZOUT0" TTL="true" PITHL="true" Pullup="true" AltFunc="P30" Point="I/O" />
|
||||
<P33 Name="P33/AVREFP/ANI00" AltFunc="ANI0" Point="I/O" />
|
||||
<P33 Name="P33/AVREFP/ANI00" AltFunc="" Point="I/O" />
|
||||
<P34 Name="P34/AVREFM/ANI01" AltFunc="P34" Point="I/O" />
|
||||
</Port3>
|
||||
<Port4 Chip="RL78F13_30pin,RL78F13_32pin,RL78F13_48pin" Pullup="true">
|
||||
@ -3864,17 +3881,17 @@ user
|
||||
<r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="1" />
|
||||
</TAU>
|
||||
<WDT>
|
||||
<r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="0">
|
||||
<r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="1">
|
||||
<Type R_WDT_Create="void R_WDT_Create(void)" R_WDT_Restart="void R_WDT_Restart(void)" />
|
||||
<R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="0" Init="1" InitMode="" />
|
||||
<R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="0" />
|
||||
<R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="1" Init="1" InitMode="" />
|
||||
<R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="1" />
|
||||
</r_cg_wdt.c>
|
||||
<r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="0">
|
||||
<r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="1">
|
||||
<Type R_WDT_Create_UserInit="void R_WDT_Create_UserInit(void)" r_wdt_interrupt="__interrupt static void r_wdt_interrupt(void)" />
|
||||
<R_WDT_Create_UserInit UserName="R_WDT_Create_UserInit" LibName="R_WDT_Create_UserInit" InUse="0" />
|
||||
<r_wdt_interrupt UserName="r_wdt_interrupt" INTHandle="" LibName="r_wdt_interrupt" InUse="0" />
|
||||
</r_cg_wdt_user.c>
|
||||
<r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="0" />
|
||||
<r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="1" />
|
||||
</WDT>
|
||||
<RTC>
|
||||
<r_cg_rtc.c UserName="r_cg_rtc.c" LibName=".c" InUse="0">
|
||||
@ -4036,26 +4053,26 @@ user
|
||||
</FUNC>
|
||||
<TAG>
|
||||
<GlobleUserTag>
|
||||
<cg_crc_area Name="cg_crc_area" Value="00" />
|
||||
<cg_security9 Name="cg_security9" Value="00" />
|
||||
<cg_security7 Name="cg_security7" Value="00" />
|
||||
<pior_value4 Name="pior_value4" Value="00" />
|
||||
<pior_value7 Name="pior_value7" Value="00" />
|
||||
<cg_security5 Name="cg_security5" Value="00" />
|
||||
<ocdstart Name="ocdstart" Value="1FE00" />
|
||||
<cg_security3 Name="cg_security3" Value="00" />
|
||||
<cg_security0 Name="cg_security0" Value="00" />
|
||||
<pior_value5 Name="pior_value5" Value="00" />
|
||||
<cg_security1 Name="cg_security1" Value="00" />
|
||||
<wdt_option Name="wdt_option" Value="E9" />
|
||||
<wdt_option Name="wdt_option" Value="78" />
|
||||
<clock_option Name="clock_option" Value="E8" />
|
||||
<cg_security2 Name="cg_security2" Value="00" />
|
||||
<cg_option Name="cg_option" Value="04" />
|
||||
<cg_security8 Name="cg_security8" Value="00" />
|
||||
<cg_security6 Name="cg_security6" Value="00" />
|
||||
<cg_security4 Name="cg_security4" Value="00" />
|
||||
<cg_security2 Name="cg_security2" Value="00" />
|
||||
<cg_crc_area Name="cg_crc_area" Value="00" />
|
||||
<cg_iawctl_value Name="cg_iawctl_value" Value="00" />
|
||||
<lvi_option Name="lvi_option" Value="33" />
|
||||
<pior_value7 Name="pior_value7" Value="00" />
|
||||
<pior_value4 Name="pior_value4" Value="00" />
|
||||
</GlobleUserTag>
|
||||
</TAG>
|
||||
</DIR>
|
||||
@ -4090,8 +4107,8 @@ user
|
||||
<TMRD0 SetFlag="" MacroName="TMRD" Channel="0" TabEnable="True" />
|
||||
<TMRD1 SetFlag="" MacroName="TMRD" Channel="1" TabEnable="True" />
|
||||
</TAU>
|
||||
<WDT Prepared="true" SetFlag="False" HelpID="watchdogtimer" NeedRefresh="False">
|
||||
<WDT SetFlag="False" MacroName="WDT" />
|
||||
<WDT Prepared="true" SetFlag="True" HelpID="watchdogtimer" NeedRefresh="False">
|
||||
<WDT SetFlag="True" MacroName="WDT" />
|
||||
</WDT>
|
||||
<RTC SetFlag="False" HelpID="rtc" NeedRefresh="False">
|
||||
<RTC MacroName="RTC" SetFlag="False" />
|
||||
@ -4490,7 +4507,7 @@ user
|
||||
<setting name="ADC_ONESHOT_SELECT_MODE" value="true" />
|
||||
<setting name="ADC_CONTINUOUS_SCAN_MODE" value="false" />
|
||||
<setting name="ADC_ONESHOT_SCAN_MODE" value="false" />
|
||||
<setting name="ADC_ANALOG_INPUT_SELECTION" value="7" />
|
||||
<setting name="ADC_ANALOG_INPUT_SELECTION" value="8" />
|
||||
<setting name="ANALOG_INPUT_24" value="false" />
|
||||
<setting name="ANALOG_INPUT_25" value="false" />
|
||||
<setting name="ANALOG_INPUT_26" value="true" />
|
||||
@ -4602,13 +4619,13 @@ user
|
||||
<setting name="Function" value="Unused" />
|
||||
</TMRD1>
|
||||
<WDT>
|
||||
<setting name="WDT_MODULE_USED" value="false" />
|
||||
<setting name="WDT_MODULE_UNUSE" value="true" />
|
||||
<setting name="WDT_MODULE_USED" value="true" />
|
||||
<setting name="WDT_MODULE_UNUSE" value="false" />
|
||||
<setting name="WDT_OVERFLOW_TIME" value="4" />
|
||||
<setting name="WDT_WINDOW_OPEN_TIME" value="2" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="true" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_STOP" value="false" />
|
||||
<setting name="WDT_INTERRUPT_USED" value="true" />
|
||||
<setting name="WDT_WINDOW_OPEN_TIME" value="0" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="false" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_STOP" value="true" />
|
||||
<setting name="WDT_INTERRUPT_USED" value="false" />
|
||||
<setting name="WDT_INTERRUPT_PRIORITY" value="3" />
|
||||
</WDT>
|
||||
<RTC>
|
||||
|
@ -114,6 +114,7 @@
|
||||
<Path>user\appTask.c</Path>
|
||||
<Path>user\can_user.c</Path>
|
||||
<Path>user\hwCtrl.c</Path>
|
||||
<Path>user\CRC.c</Path>
|
||||
</Category>
|
||||
</Files>
|
||||
<DebugOptions>
|
||||
@ -165,6 +166,7 @@
|
||||
<Path>DefaultBuild\appTask.obj</Path>
|
||||
<Path>DefaultBuild\can_user.obj</Path>
|
||||
<Path>DefaultBuild\hwCtrl.obj</Path>
|
||||
<Path>DefaultBuild\CRC.obj</Path>
|
||||
<Path>DataFlash\pfdl.lib</Path>
|
||||
</LinkOrder>
|
||||
<CommonOptions>
|
||||
@ -222,7 +224,7 @@
|
||||
<Option>-LIBrary=%MicomToolPath%\CC-RL\V1.11.00\lib\malloc_n.lib</Option>
|
||||
<Option>-LIBrary=%MicomToolPath%\CC-RL\V1.11.00\lib\rl78em4r.lib</Option>
|
||||
<Option>-OCDBG=04</Option>
|
||||
<Option>-USER_OPT_BYTE=E933E8</Option>
|
||||
<Option>-USER_OPT_BYTE=7833E8</Option>
|
||||
<Option>-LISt=%BuildModeName%\%ProjectName%.map</Option>
|
||||
<Option>-SHow=Reference,Xreference,Total_size,STRUCT</Option>
|
||||
<Option>-STARt=VectorRemapingAddr_n,.const,.text,.RLIB,.SLIB,PFDL_COD,.textf,.constf,.data,.sdata/0A000,DID_TBL_f/19C00,KAM_SEG_n/FE500,.dataR,.bss/FE510,.sdataR,.sbss/FFE20</Option>
|
||||
@ -331,8 +333,8 @@
|
||||
<ADC />
|
||||
</Effect>
|
||||
</VDDValue>
|
||||
<AD_ADPC_USEDPIN Name="AD_ADPC_USEDPIN" Text="ANI0," />
|
||||
<AD_ADS_USEDPIN Name="AD_ADS_USEDPIN" Text="ANI0," />
|
||||
<AD_ADPC_USEDPIN Name="AD_ADPC_USEDPIN" Text="" />
|
||||
<AD_ADS_USEDPIN Name="AD_ADS_USEDPIN" Text="" />
|
||||
<ADPCForPort3 Name="ADPCForPort3" Value="2" Comment="ADPCForPort3" />
|
||||
<ADPCForPort8 Name="ADPCForPort8" Value="3" Comment="ADPCForPort8" />
|
||||
<ADPCForPort9 Name="ADPCForPort9" Value="255" Comment="ADPCForPort9" />
|
||||
@ -475,7 +477,7 @@
|
||||
</RTC1HZ>
|
||||
<RXD0 Name="RXD0" Text="disable" />
|
||||
<ProjectName Name="PrjName" Text="ECU_APP" />
|
||||
<ProjectPath Name="PrjPath" Text="F:\FCB_project\temp\QJTYKG\CODE\ECU_APP" />
|
||||
<ProjectPath Name="PrjPath" Text="F:\FCB_project\temp\HS550\code\ECU_APP" />
|
||||
<ProjectKind Name="PrjKind" Text="Project78K0R" />
|
||||
<DeviceName Name="DeviceName" Fixed="" Text="RL78F13" />
|
||||
<MCUName Name="MCUName" Text="RL78F13_32pin" />
|
||||
@ -492,7 +494,7 @@
|
||||
<StartAddressOfOnChipDebugOptionBytes Name="GOStart" Text="1FE00" />
|
||||
<SizeOfOnChipDebugOptionBytesArea Name="GOSizeValue" Text="512" />
|
||||
<UserOptionBytes Name="GB" Text="1" />
|
||||
<UserOptionBytesValue Name="GBValue" Text="E933E8" />
|
||||
<UserOptionBytesValue Name="GBValue" Text="7833E8" />
|
||||
<RAMStartAddress Chip="R5F10AGG,R5F10ALG,R5F10AMG,R5F10BAG,R5F10BBG,R5F10BGG,R5F10BLG,R5F10BMG" Name="RAMStartAddress" Fixed="" Text="000FDF00" />
|
||||
<RAMEndAddress Name="RAMEndAddress" Fixed="" Text="000FFEFF" />
|
||||
<ROMEndAddress Chip="R5F10AGG,R5F10ALG,R5F10AMG,R5F10BAG,R5F10BBG,R5F10BGG,R5F10BLG,R5F10BMG" Name="ROMEndAddress" Fixed="" Text="0001FFFF" />
|
||||
@ -570,7 +572,7 @@
|
||||
</Port1>
|
||||
<Port3 Chip="RL78F13_20pin,RL78F13_30pin,RL78F13_32pin">
|
||||
<P30 Name="P30/TI01/TO01/TRDIOD1/_SSI00/INTP2/SNZOUT0" TTL="true" PITHL="true" Pullup="true" AltFunc="P30" Point="I/O" />
|
||||
<P33 Name="P33/AVREFP/ANI00" AltFunc="ANI0" Point="I/O" />
|
||||
<P33 Name="P33/AVREFP/ANI00" AltFunc="" Point="I/O" />
|
||||
<P34 Name="P34/AVREFM/ANI01" AltFunc="P34" Point="I/O" />
|
||||
</Port3>
|
||||
<Port4 Chip="RL78F13_30pin,RL78F13_32pin,RL78F13_48pin" Pullup="true">
|
||||
@ -1395,17 +1397,17 @@
|
||||
<r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="1" />
|
||||
</TAU>
|
||||
<WDT>
|
||||
<r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="0">
|
||||
<r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="1">
|
||||
<Type R_WDT_Create="void R_WDT_Create(void)" R_WDT_Restart="void R_WDT_Restart(void)" />
|
||||
<R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="0" Init="1" InitMode="" />
|
||||
<R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="0" />
|
||||
<R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="1" Init="1" InitMode="" />
|
||||
<R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="1" />
|
||||
</r_cg_wdt.c>
|
||||
<r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="0">
|
||||
<r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="1">
|
||||
<Type R_WDT_Create_UserInit="void R_WDT_Create_UserInit(void)" r_wdt_interrupt="__interrupt static void r_wdt_interrupt(void)" />
|
||||
<R_WDT_Create_UserInit UserName="R_WDT_Create_UserInit" LibName="R_WDT_Create_UserInit" InUse="0" />
|
||||
<r_wdt_interrupt UserName="r_wdt_interrupt" INTHandle="" LibName="r_wdt_interrupt" InUse="0" />
|
||||
</r_cg_wdt_user.c>
|
||||
<r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="0" />
|
||||
<r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="1" />
|
||||
</WDT>
|
||||
<RTC>
|
||||
<r_cg_rtc.c UserName="r_cg_rtc.c" LibName=".c" InUse="0">
|
||||
@ -1567,26 +1569,26 @@
|
||||
</FUNC>
|
||||
<TAG>
|
||||
<GlobleUserTag>
|
||||
<cg_crc_area Name="cg_crc_area" Value="00" />
|
||||
<cg_security9 Name="cg_security9" Value="00" />
|
||||
<cg_security7 Name="cg_security7" Value="00" />
|
||||
<pior_value4 Name="pior_value4" Value="00" />
|
||||
<pior_value7 Name="pior_value7" Value="00" />
|
||||
<cg_security5 Name="cg_security5" Value="00" />
|
||||
<ocdstart Name="ocdstart" Value="1FE00" />
|
||||
<cg_security3 Name="cg_security3" Value="00" />
|
||||
<cg_security0 Name="cg_security0" Value="00" />
|
||||
<pior_value5 Name="pior_value5" Value="00" />
|
||||
<cg_security1 Name="cg_security1" Value="00" />
|
||||
<wdt_option Name="wdt_option" Value="E9" />
|
||||
<wdt_option Name="wdt_option" Value="78" />
|
||||
<clock_option Name="clock_option" Value="E8" />
|
||||
<cg_security2 Name="cg_security2" Value="00" />
|
||||
<cg_option Name="cg_option" Value="04" />
|
||||
<cg_security8 Name="cg_security8" Value="00" />
|
||||
<cg_security6 Name="cg_security6" Value="00" />
|
||||
<cg_security4 Name="cg_security4" Value="00" />
|
||||
<cg_security2 Name="cg_security2" Value="00" />
|
||||
<cg_crc_area Name="cg_crc_area" Value="00" />
|
||||
<cg_iawctl_value Name="cg_iawctl_value" Value="00" />
|
||||
<lvi_option Name="lvi_option" Value="33" />
|
||||
<pior_value7 Name="pior_value7" Value="00" />
|
||||
<pior_value4 Name="pior_value4" Value="00" />
|
||||
</GlobleUserTag>
|
||||
</TAG>
|
||||
</DIR>
|
||||
@ -1621,8 +1623,8 @@
|
||||
<TMRD0 SetFlag="" MacroName="TMRD" Channel="0" TabEnable="True" />
|
||||
<TMRD1 SetFlag="" MacroName="TMRD" Channel="1" TabEnable="True" />
|
||||
</TAU>
|
||||
<WDT Prepared="true" SetFlag="False" HelpID="watchdogtimer" NeedRefresh="False">
|
||||
<WDT SetFlag="False" MacroName="WDT" />
|
||||
<WDT Prepared="true" SetFlag="True" HelpID="watchdogtimer" NeedRefresh="False">
|
||||
<WDT SetFlag="True" MacroName="WDT" />
|
||||
</WDT>
|
||||
<RTC SetFlag="False" HelpID="rtc" NeedRefresh="False">
|
||||
<RTC MacroName="RTC" SetFlag="False" />
|
||||
@ -2021,7 +2023,7 @@
|
||||
<setting name="ADC_ONESHOT_SELECT_MODE" value="true" />
|
||||
<setting name="ADC_CONTINUOUS_SCAN_MODE" value="false" />
|
||||
<setting name="ADC_ONESHOT_SCAN_MODE" value="false" />
|
||||
<setting name="ADC_ANALOG_INPUT_SELECTION" value="7" />
|
||||
<setting name="ADC_ANALOG_INPUT_SELECTION" value="8" />
|
||||
<setting name="ANALOG_INPUT_24" value="false" />
|
||||
<setting name="ANALOG_INPUT_25" value="false" />
|
||||
<setting name="ANALOG_INPUT_26" value="true" />
|
||||
@ -2133,13 +2135,13 @@
|
||||
<setting name="Function" value="Unused" />
|
||||
</TMRD1>
|
||||
<WDT>
|
||||
<setting name="WDT_MODULE_USED" value="false" />
|
||||
<setting name="WDT_MODULE_UNUSE" value="true" />
|
||||
<setting name="WDT_MODULE_USED" value="true" />
|
||||
<setting name="WDT_MODULE_UNUSE" value="false" />
|
||||
<setting name="WDT_OVERFLOW_TIME" value="4" />
|
||||
<setting name="WDT_WINDOW_OPEN_TIME" value="2" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="true" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_STOP" value="false" />
|
||||
<setting name="WDT_INTERRUPT_USED" value="true" />
|
||||
<setting name="WDT_WINDOW_OPEN_TIME" value="0" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="false" />
|
||||
<setting name="WDT_HALT_STOP_OPERATION_STOP" value="true" />
|
||||
<setting name="WDT_INTERRUPT_USED" value="false" />
|
||||
<setting name="WDT_INTERRUPT_PRIORITY" value="3" />
|
||||
</WDT>
|
||||
<RTC>
|
||||
|
4105
ECU_APP/OutPut/ECU_APP.S19
Normal file
4105
ECU_APP/OutPut/ECU_APP.S19
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,36 +1,18 @@
|
||||
QualityReport
|
||||
2023年7月26日 11:06:43
|
||||
2024年5月23日 13:59:33
|
||||
|
||||
------ Start build(ECU_APP, DefaultBuild) ------
|
||||
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe r_main.c diagnose\extern.c user\appTask.c user\can_user.c user\hwCtrl.c -cpu=S3 -obj_path=DefaultBuild "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF" -g -g_line -I diagnose\DTC -I diagnose\CanTrcv -I sys -I . -I rscan_driver -I diagnose -I DataFlash -I CanNw -I diagnose\CanTp -I diagnose\CanIf -I user -D DEBUG1 -c -msg_lang=english
|
||||
r_main.c(116):W0523077:Called function should have prototype
|
||||
r_main.c(162):W0523076:Function declarations should have prototype
|
||||
diagnose\extern.c(107):W0520940:Missing return statement at end of non-void function "GetVoltage"
|
||||
diagnose\extern.c(135):W0520940:Missing return statement at end of non-void function "GetMotorLockStatus"
|
||||
diagnose\extern.c(181):W0520111:Statement is unreachable
|
||||
diagnose\extern.c(322):W0520111:Statement is unreachable
|
||||
diagnose\extern.c(326):W0520111:Statement is unreachable
|
||||
diagnose\extern.c(330):W0520111:Statement is unreachable
|
||||
diagnose\extern.c(334):W0520111:Statement is unreachable
|
||||
diagnose\extern.c(505):W0520940:Missing return statement at end of non-void function "GetCanBusOffErr"
|
||||
diagnose\extern.c(523):W0520940:Missing return statement at end of non-void function "GetBcmCommFault"
|
||||
diagnose\extern.c(540):W0520940:Missing return statement at end of non-void function "GetAcpCommFault"
|
||||
user\appTask.c(40):W0520172:External/internal linkage conflict with previous declaration
|
||||
user\appTask.c(178):W0523082:Pointer to the object of even alignment holds the odd address
|
||||
user\appTask.c(182):W0520513:A value of type "MotorStateEE_Type __near *" cannot be assigned to an entity of type "uint8_t *"
|
||||
user\appTask.c(220):W0520513:A value of type "MotorStateEE_Type __near *" cannot be assigned to an entity of type "uint8_t *"
|
||||
user\appTask.c(463):W0523077:Called function should have prototype
|
||||
user\appTask.c(517):W0523077:Called function should have prototype
|
||||
user\can_user.c(97):W0520550:Variable "re_flag" was set but never used
|
||||
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\ECU_APP.clnk
|
||||
W0561016:The evaluation version of CC-RL V1 is valid for the remaining 51 days. After that, link size limit (64 Kbyte) will be applied. Please consider purchasing the product.
|
||||
RAMDATA SECTION: 00000c81 Byte(s)
|
||||
ROMDATA SECTION: 00000684 Byte(s)
|
||||
PROGRAM SECTION: 00004e2a Byte(s)
|
||||
W0561016:The evaluation version of CC-RL V1 is valid for the remaining 51 days. After that, link size limit (64 Kbyte) will be applied. Please consider purchasing the product.
|
||||
W0561016:The evaluation version of CC-RL V1 is valid for the remaining 51 days. After that, link size limit (64 Kbyte) will be applied. Please consider purchasing the product.
|
||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe r_cg_timer_user.c r_cg_adc_user.c -cpu=S3 -obj_path=DefaultBuild "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF" -g -g_line -I diagnose\DTC -I diagnose\CanTrcv -I sys -I . -I rscan_driver -I diagnose -I DataFlash -I CanNw -I diagnose\CanTp -I diagnose\CanIf -I user -D DEBUG1 -c -msg_lang=english
|
||||
r_cg_timer_user.c(141):W0520167:Argument of type "uint16_t __near *" is incompatible with parameter of type "unsigned int *__near"
|
||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\ECU_APP.clnk
|
||||
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||
RAMDATA SECTION: 00000bf3 Byte(s)
|
||||
ROMDATA SECTION: 00000710 Byte(s)
|
||||
PROGRAM SECTION: 00004dc0 Byte(s)
|
||||
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||
Renesas Optimizing Linker Completed
|
||||
------ Build ended(Error:0, Warning:22)(ECU_APP, DefaultBuild) ------
|
||||
------ Build ended(Error:0, Warning:4)(ECU_APP, DefaultBuild) ------
|
||||
|
||||
--- CommandFile 1 ---
|
||||
DefaultBuild\ECU_APP.clnk :
|
||||
@ -73,18 +55,19 @@ DefaultBuild\ECU_APP.clnk :
|
||||
-Input=DefaultBuild\appTask.obj
|
||||
-Input=DefaultBuild\can_user.obj
|
||||
-Input=DefaultBuild\hwCtrl.obj
|
||||
-Input=DefaultBuild\CRC.obj
|
||||
-LIBrary=DataFlash\pfdl.lib
|
||||
-SECURITY_ID=00000000000000000000
|
||||
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||
-DEBug
|
||||
-NOCOmpress
|
||||
-NOOPtimize
|
||||
-OUtput=DefaultBuild\ECU_APP.abs
|
||||
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\rl78em4s.lib
|
||||
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\malloc_n.lib
|
||||
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\rl78em4r.lib
|
||||
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\rl78em4s.lib
|
||||
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\malloc_n.lib
|
||||
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\rl78em4r.lib
|
||||
-OCDBG=04
|
||||
-USER_OPT_BYTE=E933E8
|
||||
-USER_OPT_BYTE=7833E8
|
||||
-LISt=DefaultBuild\ECU_APP.map
|
||||
-SHow=Reference,Xreference,Total_size,STRUCT
|
||||
-STARt=VectorRemapingAddr_n,.const,.text,.RLIB,.SLIB,PFDL_COD,.textf,.constf,.data,.sdata/0A000,DID_TBL_f/19C00,KAM_SEG_n/FE500,.dataR,.bss/FE510,.sdataR,.sbss/FFE20
|
||||
@ -95,7 +78,7 @@ DefaultBuild\ECU_APP.clnk :
|
||||
-NOLOgo
|
||||
-end
|
||||
-Input=DefaultBuild\ECU_APP.abs
|
||||
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||
-OUtput=DefaultBuild\ECU_APP.mot
|
||||
-FOrm=Stype
|
||||
-REcord=S3
|
||||
@ -103,7 +86,7 @@ DefaultBuild\ECU_APP.clnk :
|
||||
-Message
|
||||
-end
|
||||
-Input=DefaultBuild\ECU_APP.abs
|
||||
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||
-OUtput=output\ECU_APP.S19= A000-19FFF
|
||||
-FOrm=Stype
|
||||
-REcord=S3
|
||||
@ -114,9 +97,9 @@ DefaultBuild\ECU_APP.clnk :
|
||||
|
||||
|
||||
--- SHA1 hash value of output files ---
|
||||
F:\FCBproject\temp\QJTYKG\CODE\ECU_APP\DefaultBuild\ECU_APP.abs: 79db622caa86b994641be67d3aa82522d4cb95cc
|
||||
F:\FCBproject\temp\QJTYKG\CODE\ECU_APP\DefaultBuild\ECU_APP.mot: 340ae0515cf569f397fe44aa552d235e6a187b05
|
||||
F:\FCBproject\temp\QJTYKG\CODE\ECU_APP\output\ECU_APP.S19: 587a934cc6678aa60b01b051e671845db64c7758
|
||||
F:\FCB_project\temp\HS550\code\ECU_APP\DefaultBuild\ECU_APP.abs: ead2ac07fe9de18da2d71bb5d35e0dc3e70a09c0
|
||||
F:\FCB_project\temp\HS550\code\ECU_APP\DefaultBuild\ECU_APP.mot: d78aacba1409b08a0bfa0ac3d420a02a0e485239
|
||||
F:\FCB_project\temp\HS550\code\ECU_APP\output\ECU_APP.S19: 8544f1d360fa9f2af931fa882df65fd53f64d163
|
||||
|
||||
|
||||
--- System Information ---
|
||||
@ -141,16 +124,16 @@ F:\FCBproject\temp\QJTYKG\CODE\ECU_APP\output\ECU_APP.S19: 587a934cc6678aa60b01b
|
||||
*Product License
|
||||
|
||||
*Execution Place
|
||||
C:\Program Files (x86)\Renesas Electronics\CS+\CC
|
||||
E:\Program Files (x86)\renesas\CS+\CC
|
||||
*Memory Usage
|
||||
*Private Working Set
|
||||
184 MB
|
||||
418 MB
|
||||
*Number of GDI Objects
|
||||
1873
|
||||
2438
|
||||
*Number of USER Objects
|
||||
891
|
||||
1166
|
||||
*Opened Files
|
||||
0 editors, 0 files, 0 KB
|
||||
5 editors, 5 files, 36 KB
|
||||
|
||||
--- Build Tool Plug-in Information ---
|
||||
RH850 Build tool CC-RH Plug-in
|
||||
@ -279,7 +262,7 @@ Device Information Common Interface
|
||||
DeviceInformation.dll
|
||||
|
||||
--- Main Project Information ---
|
||||
F:\FCBproject\temp\QJTYKG\CODE\ECU_APP\ECU_APP.mtpj
|
||||
F:\FCB_project\temp\HS550\code\ECU_APP\ECU_APP.mtpj
|
||||
Microcontroller Information
|
||||
*R5F10BBG
|
||||
*File Name: Version
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for ADC module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for ADC module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef ADC_H
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for ADC module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for CGC module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for CGC module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef CGC_H
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for CGC module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements general head file.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef STATUS_H
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for PORT module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for PORT module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef PORT_H
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for PORT module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -59,8 +59,6 @@ extern volatile uint8_t * gp_iica0_tx_address; /* iica0 send buffer addr
|
||||
extern volatile uint16_t g_iica0_tx_cnt; /* iica0 send data count */
|
||||
/* Start user code for global. Do not edit comment generated here */
|
||||
|
||||
extern volatile uint8_t flag_IIC_SendEnd;
|
||||
extern volatile uint8_t flag_IIC_ReceiveEnd;
|
||||
/* End user code. Do not edit comment generated here */
|
||||
|
||||
/***********************************************************************************************************************
|
||||
@ -200,7 +198,6 @@ static void r_iica0_callback_master_receiveend(void)
|
||||
{
|
||||
SPT0 = 1U;
|
||||
/* Start user code. Do not edit comment generated here */
|
||||
flag_IIC_ReceiveEnd = 1;
|
||||
/* End user code. Do not edit comment generated here */
|
||||
}
|
||||
|
||||
@ -214,7 +211,6 @@ static void r_iica0_callback_master_sendend(void)
|
||||
{
|
||||
SPT0 = 1U;
|
||||
/* Start user code. Do not edit comment generated here */
|
||||
flag_IIC_SendEnd = 1;
|
||||
/* End user code. Do not edit comment generated here */
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for TAU module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for TAU module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef TAU_H
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for TAU module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
@ -145,7 +145,7 @@ void Timer_Pro(void)
|
||||
Count_Down_Timer_16Bit(&DiagCnt);
|
||||
|
||||
uiNwTimCnt++;
|
||||
uiNwToutCnt++; //网络管理定时器
|
||||
uiNwToutCnt++; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
||||
if(uiNwRMSCnt > 0)
|
||||
uiNwRMSCnt--;
|
||||
if(uiNwLocWkpOffCnt > 0)
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file includes user definition.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef _USER_DEF_H
|
||||
@ -61,7 +61,7 @@ typedef struct{
|
||||
#define DID_F180_ADDR 0x19C20
|
||||
#define DID_F193_ADDR 0x19C00
|
||||
|
||||
#define DIAGNOSE_STD_V_H (0x03) /* 客户诊断标准版本号 */
|
||||
#define DIAGNOSE_STD_V_H (0x03) /* å®¢æˆ·è¯Šæ–æ ‡å‡†ç‰ˆæœ¬å<EFBFBD>?*/
|
||||
#define DIAGNOSE_STD_V_L (0x02)
|
||||
|
||||
#define DIAGNOSE_PARAMETER_V_H (0x01) /* 诊断调查表版本号 */
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for WDT module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
@ -57,10 +57,6 @@ void R_WDT_Create(void)
|
||||
{
|
||||
WDTIMK = 1U; /* disable INTWDTI interrupt */
|
||||
WDTIIF = 0U; /* clear INTWDTI interrupt flag */
|
||||
/* Set INTWDTI low priority */
|
||||
WDTIPR1 = 1U;
|
||||
WDTIPR0 = 1U;
|
||||
WDTIMK = 0U; /* enable INTWDTI interrupt */
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for WDT module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef WDT_H
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements device driver for WDT module.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
@ -38,7 +38,6 @@ Includes
|
||||
/***********************************************************************************************************************
|
||||
Pragma directive
|
||||
***********************************************************************************************************************/
|
||||
#pragma interrupt r_wdt_interrupt(vect=INTWDTI)
|
||||
/* Start user code for pragma. Do not edit comment generated here */
|
||||
/* End user code. Do not edit comment generated here */
|
||||
|
||||
@ -48,17 +47,5 @@ Global variables and functions
|
||||
/* Start user code for global. Do not edit comment generated here */
|
||||
/* End user code. Do not edit comment generated here */
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: r_wdt_interrupt
|
||||
* Description : This function is INTWDTI interrupt service routine.
|
||||
* Arguments : None
|
||||
* Return Value : None
|
||||
***********************************************************************************************************************/
|
||||
static void __near r_wdt_interrupt(void)
|
||||
{
|
||||
/* Start user code. Do not edit comment generated here */
|
||||
/* End user code. Do not edit comment generated here */
|
||||
}
|
||||
|
||||
/* Start user code for adding. Do not edit comment generated here */
|
||||
/* End user code. Do not edit comment generated here */
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements main function.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
@ -34,6 +34,7 @@ Includes
|
||||
#include "r_cg_port.h"
|
||||
#include "r_cg_adc.h"
|
||||
#include "r_cg_timer.h"
|
||||
#include "r_cg_wdt.h"
|
||||
/* Start user code for include. Do not edit comment generated here */
|
||||
#include "r_rl78_can_drv.h"
|
||||
#include "r_rl78_can_sfr.h"
|
||||
@ -74,40 +75,11 @@ void main(void)
|
||||
{
|
||||
R_MAIN_UserInit();
|
||||
/* Start user code. Do not edit comment generated here */
|
||||
//ADCE = 1U; //ADM0????????¡§???1?????????A/D??????????????¡§?????????
|
||||
|
||||
/*
|
||||
POWER_UP_DELAY_CNT=POWER_UP_DELAY_TIME; //????????????¨¦??¨¦?????????????¡§??????
|
||||
POWER_UP_STATUS=1;
|
||||
EEL_READ(); //????????¡ã???¨¦?????
|
||||
R_TAU0_Channel0_Start();
|
||||
R_TAU0_Channel2_Start();
|
||||
|
||||
TB9102_Enable=1;
|
||||
TB9102_MODE=1;
|
||||
RecFreSetOld=0xff; //????¡ì?????????????????????¡ì????
|
||||
ModeSetOld=0xff;
|
||||
TempSetOld=0xff;
|
||||
Can_Msg_Change_1(); //can??????????¡ì????
|
||||
*/
|
||||
/*
|
||||
R_TAU0_Channel0_Start();//timer
|
||||
|
||||
|
||||
|
||||
|
||||
C0CTRH &= ~0x0300; // ?????????????¡§????
|
||||
TransmitCAN_Message(0x7FB,8,KamData.RspData); //???????????????????
|
||||
|
||||
C0CTRH &= ~0x0300; // ?????????????¡§????
|
||||
|
||||
|
||||
|
||||
*/
|
||||
if(KamData.AckReq == ACK_REQ)
|
||||
{
|
||||
//FlgTemp = 1;
|
||||
C0CTRH &= ~0x0300; // ?????????????¡§????
|
||||
C0CTRH &= ~0x0300; //
|
||||
TransmitCAN_Message(CANTP_RESP_CANID,8,KamData.RspData); //???????????????????
|
||||
}
|
||||
value_init();
|
||||
@ -135,7 +107,7 @@ void R_MAIN_UserInit(void)
|
||||
InitCanTp_Parameter();
|
||||
CAN_Pin_init();
|
||||
CAN_TX_MESSAGE_INIT();
|
||||
CanNwInit();//¨¦??????????????¨¦??????????????CanNwInit(); ???¨¦????¡§CanUserInit(); ???¨¦??????¡ì?????????????CAN???????????¡ã??????
|
||||
CanNwInit();//
|
||||
R_TAU0_Channel0_Start();
|
||||
CAN_STB = 0;
|
||||
CanUserInit();
|
||||
@ -144,7 +116,7 @@ void R_MAIN_UserInit(void)
|
||||
R_ADC_Start();
|
||||
R_TAU0_Channel1_Start();
|
||||
|
||||
//C0CTRHH = 0x03; //????¡ì????¨¦????¡è????????????????¡§????
|
||||
//C0CTRHH = 0x03;
|
||||
//C0CTRLL = 0x00;
|
||||
|
||||
EI();
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Device(s) : R5F10BBG
|
||||
* Tool-Chain : CCRL
|
||||
* Description : This file implements system initializing function.
|
||||
* Creation Date: 2023-07-07
|
||||
* Creation Date: 2024-05-23
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
@ -34,6 +34,7 @@ Includes
|
||||
#include "r_cg_port.h"
|
||||
#include "r_cg_adc.h"
|
||||
#include "r_cg_timer.h"
|
||||
#include "r_cg_wdt.h"
|
||||
/* Start user code for include. Do not edit comment generated here */
|
||||
/* End user code. Do not edit comment generated here */
|
||||
#include "r_cg_userdefine.h"
|
||||
@ -67,6 +68,7 @@ void R_Systeminit(void)
|
||||
R_PORT_Create();
|
||||
R_ADC_Create();
|
||||
R_TAU0_Create();
|
||||
R_WDT_Create();
|
||||
|
||||
/* Set invalid memory access detection control */
|
||||
IAWCTL = 0x00U;
|
||||
|
@ -79,11 +79,11 @@ void __near RSCAN_INTCANGRECC_interrupt(void)
|
||||
if ((RxCanMessage.IDL == CANTP_ADDR_PHY_REQ) || (RxCanMessage.IDL == CANTP_ADDR_FUNC_REQ))
|
||||
{
|
||||
if (RxCanMessage.IDL == CANTP_ADDR_FUNC_REQ && RxCanMessage.DB[1] == 0x3E && RxCanMessage.DB[2] == 0x80)
|
||||
resetS3Server(); /*重置S3server计时*/
|
||||
resetS3Server(); /*重置S3server计时*/
|
||||
else
|
||||
RxIndicationCanIf_Messages(0, RxCanMessage.IDL, RxCanMessage.DLC, RxCanMessage.DB);
|
||||
DiagMsgRcvFlag = 1;
|
||||
ucNwNetIdelCheck = 1; //网络空闲检测 300ms如果没有置位 默认为空闲
|
||||
ucNwNetIdelCheck = 1; //网络空闲检测 300ms如果没有置位 默认为空闲
|
||||
}
|
||||
|
||||
if ((RxCanMessage.IDL >= 0x0400) && (RxCanMessage.IDL <= 0x047F))
|
||||
@ -91,7 +91,7 @@ void __near RSCAN_INTCANGRECC_interrupt(void)
|
||||
{
|
||||
ucRemoteWakupFlg = 1u;
|
||||
RepeatMessageReq = RxCanMessage.DB[1] & 0x01;
|
||||
ucNwNetIdelCheck = 1; //网络空闲检测 300ms如果没有置位 默认为空闲
|
||||
ucNwNetIdelCheck = 1; //网络空闲检测 300ms如果没有置位 默认为空闲
|
||||
}
|
||||
|
||||
if (RxCanMessage.IDL == 0x0403)
|
||||
@ -99,7 +99,7 @@ void __near RSCAN_INTCANGRECC_interrupt(void)
|
||||
|
||||
if (App28sTxRxStatus & 0x02 != 0) // Rx enable
|
||||
{
|
||||
Copy_Array_to_Array(CAN_403.Msg_Byte, RxCanMessage.DB, 8);
|
||||
//Copy_Array_to_Array(CAN_403.Msg_Byte, RxCanMessage.DB, 8);
|
||||
}
|
||||
}
|
||||
if (RxCanMessage.IDL == 0x026D)
|
||||
|
116
ECU_APP/user/CRC.c
Normal file
116
ECU_APP/user/CRC.c
Normal file
@ -0,0 +1,116 @@
|
||||
|
||||
#include "crc.h"
|
||||
//#include <stdio.h> //用于验证和生成CRC_Table
|
||||
|
||||
static const unsigned char crc_table[] =
|
||||
{
|
||||
0x00, 0x1d, 0x3a, 0x27, 0x74, 0x69, 0x4e, 0x53, 0xe8, 0xf5, 0xd2, 0xcf, 0x9c, 0x81, 0xa6, 0xbb,
|
||||
0xcd, 0xd0, 0xf7, 0xea, 0xb9, 0xa4, 0x83, 0x9e, 0x25, 0x38, 0x1f, 0x02, 0x51, 0x4c, 0x6b, 0x76,
|
||||
0x87, 0x9a, 0xbd, 0xa0, 0xf3, 0xee, 0xc9, 0xd4, 0x6f, 0x72, 0x55, 0x48, 0x1b, 0x06, 0x21, 0x3c,
|
||||
0x4a, 0x57, 0x70, 0x6d, 0x3e, 0x23, 0x04, 0x19, 0xa2, 0xbf, 0x98, 0x85, 0xd6, 0xcb, 0xec, 0xf1,
|
||||
0x13, 0x0e, 0x29, 0x34, 0x67, 0x7a, 0x5d, 0x40, 0xfb, 0xe6, 0xc1, 0xdc, 0x8f, 0x92, 0xb5, 0xa8,
|
||||
0xde, 0xc3, 0xe4, 0xf9, 0xaa, 0xb7, 0x90, 0x8d, 0x36, 0x2b, 0x0c, 0x11, 0x42, 0x5f, 0x78, 0x65,
|
||||
0x94, 0x89, 0xae, 0xb3, 0xe0, 0xfd, 0xda, 0xc7, 0x7c, 0x61, 0x46, 0x5b, 0x08, 0x15, 0x32, 0x2f,
|
||||
0x59, 0x44, 0x63, 0x7e, 0x2d, 0x30, 0x17, 0x0a, 0xb1, 0xac, 0x8b, 0x96, 0xc5, 0xd8, 0xff, 0xe2,
|
||||
0x26, 0x3b, 0x1c, 0x01, 0x52, 0x4f, 0x68, 0x75, 0xce, 0xd3, 0xf4, 0xe9, 0xba, 0xa7, 0x80, 0x9d,
|
||||
0xeb, 0xf6, 0xd1, 0xcc, 0x9f, 0x82, 0xa5, 0xb8, 0x03, 0x1e, 0x39, 0x24, 0x77, 0x6a, 0x4d, 0x50,
|
||||
0xa1, 0xbc, 0x9b, 0x86, 0xd5, 0xc8, 0xef, 0xf2, 0x49, 0x54, 0x73, 0x6e, 0x3d, 0x20, 0x07, 0x1a,
|
||||
0x6c, 0x71, 0x56, 0x4b, 0x18, 0x05, 0x22, 0x3f, 0x84, 0x99, 0xbe, 0xa3, 0xf0, 0xed, 0xca, 0xd7,
|
||||
0x35, 0x28, 0x0f, 0x12, 0x41, 0x5c, 0x7b, 0x66, 0xdd, 0xc0, 0xe7, 0xfa, 0xa9, 0xb4, 0x93, 0x8e,
|
||||
0xf8, 0xe5, 0xc2, 0xdf, 0x8c, 0x91, 0xb6, 0xab, 0x10, 0x0d, 0x2a, 0x37, 0x64, 0x79, 0x5e, 0x43,
|
||||
0xb2, 0xaf, 0x88, 0x95, 0xc6, 0xdb, 0xfc, 0xe1, 0x5a, 0x47, 0x60, 0x7d, 0x2e, 0x33, 0x14, 0x09,
|
||||
0x7f, 0x62, 0x45, 0x58, 0x0b, 0x16, 0x31, 0x2c, 0x97, 0x8a, 0xad, 0xb0, 0xe3, 0xfe, 0xd9, 0xc4
|
||||
};
|
||||
|
||||
unsigned char CRC_Calc(unsigned char * dataptr,unsigned char len)
|
||||
{
|
||||
unsigned char i;
|
||||
unsigned char crc=0xFF; // 计算的初始crc值
|
||||
|
||||
while(len--)
|
||||
{
|
||||
crc ^= *dataptr++; // 每次先与需要计算的数据异或,计算完指向下一数据
|
||||
for (i=0; i<8; i++) // 下面这段计算过程与计算一个字节crc一样
|
||||
{
|
||||
if (crc & 0x80) // 判断最高位是否为1
|
||||
// 最高位为1,不需要异或,往左移一位,然后与0x31异或
|
||||
// 0x31(多项式:x8+x5+x4+1,100110001),最高位不需要异或,直接去掉
|
||||
crc = (crc << 1) ^ 0x1D;
|
||||
else
|
||||
crc = (crc << 1);
|
||||
}
|
||||
}
|
||||
|
||||
return (crc^0XFF);
|
||||
}
|
||||
|
||||
|
||||
unsigned char CRC_Calc_Table(unsigned char * dataptr,unsigned char len)
|
||||
{
|
||||
unsigned char crc = 0xFF;
|
||||
|
||||
while (len--)
|
||||
{
|
||||
crc = crc_table[crc ^ *dataptr++];
|
||||
}
|
||||
return (crc^0XFF);
|
||||
}
|
||||
|
||||
|
||||
//以下程序用于验证和生成CRC_Table
|
||||
/*
|
||||
unsigned char cal_table_high_first(unsigned char value)
|
||||
{
|
||||
unsigned char i, crc;
|
||||
|
||||
crc = value;
|
||||
//数据往左移了8位,需要计算8次
|
||||
for (i=0; i<8; i++)
|
||||
{
|
||||
if (crc & 0x80) //判断最高位是否为1
|
||||
{
|
||||
//最高位为1,不需要异或,往左移一位,然后与0x31异或
|
||||
//0x31(多项式:x8+x5+x4+1,100110001),最高位不需要异或,直接去掉
|
||||
crc = (crc << 1) ^ 0x1D; }
|
||||
else
|
||||
{
|
||||
//最高位为0时,不需要异或,整体数据往左移一位
|
||||
crc = (crc << 1);
|
||||
}
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
//计算crc_Table
|
||||
void create_crc_table(void)
|
||||
{
|
||||
unsigned short i;
|
||||
unsigned char j;
|
||||
|
||||
for (i=0; i<=0xFF; i++)
|
||||
{
|
||||
if (0 == (i%16))
|
||||
printf("\n");
|
||||
|
||||
j = i&0xFF;
|
||||
printf("0x%.2x, ", cal_table_high_first (j)); //依次计算每个字节的crc校验值
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned char TestArr[] = {0x00,0x15,0x22,0x11,0xff,0x13,0x66};
|
||||
unsigned char crc;
|
||||
printf("crc_data = {0x00,0x15,0x22,0x11,0xff,0x13,0x66}\n");
|
||||
crc = CRC_Calc(TestArr,7);
|
||||
printf("CRC_Calc = 0x%x \n",crc);
|
||||
crc = CRC_Calc_Table(TestArr,7);
|
||||
printf("CRC_Calc_Table = 0x%x \n",crc);
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
@ -16,18 +16,17 @@
|
||||
|
||||
typedef enum
|
||||
{
|
||||
KEYID_1,
|
||||
KEYID_2,
|
||||
KEYID_3,
|
||||
|
||||
KEYID_4,
|
||||
KEYID_5,
|
||||
KEYID_6,
|
||||
KEYID_7,
|
||||
KEYID_8,
|
||||
KEYID_9,
|
||||
KEYID_1_P125,
|
||||
KEYID_2_P34,
|
||||
KEYID_3_P81,
|
||||
KEYID_4_P82,
|
||||
KEYID_5_P83,
|
||||
KEYID_6_P80,
|
||||
KEYID_7_P63,
|
||||
KEYID_8_P17,
|
||||
KEYID_9_P30,
|
||||
KEY_NUM,
|
||||
}KEYID_Type
|
||||
}KEYID_Type;
|
||||
|
||||
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "appTask.h"
|
||||
#include "appTask.h"
|
||||
#include "iodefine.h"
|
||||
#include "extern.h"
|
||||
#include "r_cg_adc.h"
|
||||
#include "r_cg_intc.h"
|
||||
#include "PINdef.h"
|
||||
#include "hwCtrl.h"
|
||||
|
||||
#include "crc.h"
|
||||
#include "pfdl.h"
|
||||
|
||||
u8 can_data_init_flag = 0;
|
||||
@ -17,9 +17,6 @@ unsigned char rollingcounter = 0;
|
||||
unsigned char IGN_Voltage_error_flag, IGN_Voltage_error_count;
|
||||
|
||||
|
||||
volatile uint8_t flag_IIC_SendEnd;
|
||||
volatile uint8_t flag_IIC_ReceiveEnd;
|
||||
|
||||
unsigned char Timer_1ms_flag;
|
||||
unsigned char Timer_5ms_flag;
|
||||
unsigned char Timer_10ms_flag;
|
||||
@ -37,16 +34,12 @@ unsigned int uiBusOffCnt; // ms
|
||||
unsigned char ucBusOffModeState; // 0:Normal 1~4:Fast Rec 5:Slow Rec
|
||||
unsigned char BusoffFlag;
|
||||
/***************************************************/
|
||||
static unsigned int EEL_SAVE_CNT_DOWN_TIMER;
|
||||
static uint8_t EEL_SAVE_ENABLE;
|
||||
|
||||
MotorStateEE_Type MotorStateEE;
|
||||
MotorStateEE_Type *pEE;
|
||||
|
||||
|
||||
|
||||
uint16_t VehicleSpeedRaw,VehicleSpeed;
|
||||
|
||||
uint8_t lockstate,sbrstate,sbrWarnState;
|
||||
uint8_t nouse;//Relocation value is odd number
|
||||
|
||||
|
||||
@ -75,34 +68,20 @@ void Apply_task(void)
|
||||
BusOff_Detect();
|
||||
}
|
||||
KeyScan();
|
||||
if (EEL_SAVE_CNT_DOWN_TIMER > 0)
|
||||
{
|
||||
EEL_SAVE_CNT_DOWN_TIMER--;
|
||||
}
|
||||
Can_Msg_Change();
|
||||
//IGN_Detect();
|
||||
//CanNwHandle();
|
||||
|
||||
}
|
||||
if (Timer_5ms_flag == 1)
|
||||
{
|
||||
Timer_5ms_flag = 0;
|
||||
CAN_RX_Data_Handle();
|
||||
/*
|
||||
if (IGN_On == 1 && ucActiveWakeupBit != PASSIVE_WAKEUP)
|
||||
KeyScan();
|
||||
*/
|
||||
|
||||
Can_Msg_Change();
|
||||
KeyPro();
|
||||
// IGN_Detect();
|
||||
|
||||
}
|
||||
|
||||
if (Timer_10ms_flag == 1)
|
||||
{
|
||||
Timer_10ms_flag = 0;
|
||||
|
||||
// BAT_Voltage_Detect();
|
||||
// CanNwHandle();
|
||||
}
|
||||
if (Timer_20ms_flag == 1)
|
||||
{
|
||||
@ -113,7 +92,7 @@ void Apply_task(void)
|
||||
if (Timer_50ms_flag == 1)
|
||||
{
|
||||
Timer_50ms_flag = 0;
|
||||
//EEL_WRITE();
|
||||
|
||||
TxTestMsg();
|
||||
//SleepDetect();//TODO
|
||||
}
|
||||
@ -130,110 +109,62 @@ void KeyPro(void)//5ms
|
||||
|
||||
void Can_Msg_Change(void)//
|
||||
{
|
||||
uint8_t i,checksum;
|
||||
uint8_t i;
|
||||
|
||||
#if 0
|
||||
CAN_50A.Msg_Bit.ZXFW = GetKeyState(KEYID_ZXFW);
|
||||
CAN_50A.Msg_Bit.DFS = GetKeyState(KEYID_DFS );
|
||||
CAN_50A.Msg_Bit.DFJ = GetKeyState(KEYID_DFJ );
|
||||
CAN_50A.Msg_Bit.WBJR = GetKeyState(KEYID_WBJR);
|
||||
CAN_50A.Msg_Bit.ZYJR = GetKeyState(KEYID_ZYJR);
|
||||
CAN_50A.Msg_Bit.YD = GetKeyState(KEYID_YD );
|
||||
CAN_50A.Msg_Bit.MS = GetKeyState(KEYID_MS );
|
||||
CAN_50A.Msg_Bit.YBFH = GetKeyState(KEYID_YBFH);
|
||||
#endif
|
||||
#if NOW_BOARD == LEFT_BOARD
|
||||
CAN_50A.Msg_Bit.JS = GetKeyState(KEYID_JS );
|
||||
CAN_50A.Msg_Bit.YJ = GetKeyState(KEYID_YJ );
|
||||
CAN_50A.Msg_Bit.LB = GetKeyState(KEYID_LB );
|
||||
CAN_50A.Msg_Bit.CC = GetKeyState(KEYID_CC );
|
||||
CAN_50A.Msg_Bit.ZZ = GetKeyState(KEYID_ZZ );
|
||||
CAN_50A.Msg_Bit.YZ = GetKeyState(KEYID_YZ );
|
||||
#endif
|
||||
#if NOW_BOARD == RIGHT_BOARD
|
||||
CAN_50A.Msg_Bit.TCS = GetKeyState(KEYID_TCS );
|
||||
CAN_50A.Msg_Bit.XH = GetKeyState(KEYID_XH );
|
||||
CAN_50A.Msg_Bit.QD = GetKeyState(KEYID_QD );
|
||||
CAN_50A.Msg_Bit.DD = GetKeyState(KEYID_DD );
|
||||
CAN_50A.Msg_Bit.YBS = GetKeyState(KEYID_YBS );
|
||||
CAN_50A.Msg_Bit.YBX = GetKeyState(KEYID_YBX );
|
||||
|
||||
#endif
|
||||
CAN_50A.Msg_Bit.rolling = rollingcounter;
|
||||
checksum = 0;
|
||||
for (i = 0; i < 7; i++)
|
||||
if (IGN_Voltage_error_flag != 0)
|
||||
{
|
||||
checksum += CAN_50A.Msg_Byte[i];
|
||||
}
|
||||
|
||||
CAN_50A.Msg_Bit.checksum = checksum;
|
||||
}
|
||||
|
||||
static uint8_t EEL_BUF[50];
|
||||
void EEL_READ(void)
|
||||
{
|
||||
uint16_t checksum;
|
||||
uint8_t *src,*des,i;
|
||||
ReadFlashData(EEL_BUF, 0x000F1000, sizeof(MotorStateEE));
|
||||
pEE = (MotorStateEE_Type *)EEL_BUF;
|
||||
checksum = pEE->kbsoft1 + pEE->kbsoft2 + pEE->kbnow + pEE->zysoft1 + pEE->zysoft2 + pEE->zynow;
|
||||
if (pEE ->start == 0x55AA && pEE->stop == 0xAA55 && checksum == pEE->checksum)
|
||||
{
|
||||
des = &MotorStateEE;
|
||||
src = EEL_BUF;
|
||||
for (i = 0; i < sizeof(MotorStateEE); i++)
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
des[i] = src[i];
|
||||
CAN_101.Msg_Byte[i] = 0x00;
|
||||
CAN_220.Msg_Byte[i] = 0x00;
|
||||
}
|
||||
CAN_101.Msg_Bit.checksum = CRC_Calc_Table(CAN_101.Msg_Byte, 7);
|
||||
CAN_220.Msg_Bit.checksum = CRC_Calc_Table(CAN_220.Msg_Byte, 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
MotorStateEE.start = 0x55AA;
|
||||
MotorStateEE.stop = 0xAA55;
|
||||
MotorStateEE.kbnow = 0x8000;
|
||||
MotorStateEE.kbsoft1 = 0;
|
||||
MotorStateEE.kbsoft2 = 0;
|
||||
MotorStateEE.zynow = 0x8000;
|
||||
MotorStateEE.zysoft1 = 0;
|
||||
MotorStateEE.zysoft2 = 0;
|
||||
EEL_Write_Enable_Check();
|
||||
CAN_101.Msg_Bit.TCS_TractionControl = GetKeyState(KEYID_4_P82);
|
||||
CAN_101.Msg_Bit.reverse11 = GetKeyState(KEYID_9_P30);
|
||||
CAN_101.Msg_Bit.reverse12 = GetKeyState(KEYID_7_P63);
|
||||
CAN_101.Msg_Bit.HandleHeating = GetKeyState(KEYID_5_P83);
|
||||
CAN_101.Msg_Bit.DifferentialLock = GetKeyState(KEYID_1_P125);
|
||||
CAN_101.Msg_Bit.RightSteering = GetKeyState(KEYID_2_P34);
|
||||
CAN_101.Msg_Bit.EngineIgnitionStopControl = GetKeyState(KEYID_3_P81);
|
||||
CAN_101.Msg_Bit.CrankingMotor = GetKeyState(KEYID_6_P80);
|
||||
CAN_101.Msg_Bit.DIST_SET = GetKeyState(KEYID_8_P17);
|
||||
CAN_101.Msg_Bit.checksum = CRC_Calc_Table(CAN_101.Msg_Byte, 7);
|
||||
|
||||
CAN_220.Msg_Bit.SwitchButton_NearOrFarLight = GetKeyState(KEYID_4_P82);
|
||||
CAN_220.Msg_Bit.FogLampSwitch = GetKeyState(KEYID_1_P125);
|
||||
CAN_220.Msg_Bit.HeadLampSwitch = GetKeyState(KEYID_3_P81);
|
||||
CAN_220.Msg_Bit.FAxle_2_4WD_DifLock = GetKeyState(KEYID_6_P80);
|
||||
CAN_220.Msg_Bit.Trumpet = GetKeyState(KEYID_7_P63);
|
||||
CAN_220.Msg_Bit.LeftSteering = GetKeyState(KEYID_9_P30);
|
||||
CAN_220.Msg_Bit.WarningAgainstDanger = GetKeyState(KEYID_8_P17);
|
||||
CAN_220.Msg_Bit.TurnOnTheHeater = GetKeyState(KEYID_2_P34);
|
||||
CAN_220.Msg_Bit.MODEL_SEL = GetKeyState(KEYID_5_P83);
|
||||
CAN_220.Msg_Bit.checksum = CRC_Calc_Table(CAN_220.Msg_Byte, 7);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void EEL_READ(void)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
#define SC_500MS_PC_1MS 500
|
||||
|
||||
void EEL_WRITE(void)
|
||||
{
|
||||
static unsigned char EEL_SAVE_REQUIRE_FLAG=0;
|
||||
uint8_t i,*p;
|
||||
if (EEL_SAVE_ENABLE)
|
||||
{
|
||||
EEL_SAVE_REQUIRE_FLAG = 1;
|
||||
EEL_SAVE_CNT_DOWN_TIMER = SC_500MS_PC_1MS;
|
||||
EEL_SAVE_ENABLE = 0;
|
||||
}
|
||||
|
||||
if (0 == EEL_SAVE_CNT_DOWN_TIMER && 1 == EEL_SAVE_REQUIRE_FLAG)
|
||||
{
|
||||
MotorStateEE.checksum = MotorStateEE.kbsoft1 + MotorStateEE.kbsoft2 + MotorStateEE.kbnow + MotorStateEE.zysoft1 + MotorStateEE.zysoft2 + MotorStateEE.zynow;
|
||||
p = &MotorStateEE;
|
||||
for (i = 0; i < sizeof(MotorStateEE); i++)
|
||||
{
|
||||
EEL_BUF[i] = p[i];
|
||||
}
|
||||
|
||||
if(WriteDataflash(EEL_BUF,0x000F1000,sizeof(MotorStateEE)) == 0x11)
|
||||
{
|
||||
EEL_SAVE_REQUIRE_FLAG=0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void EEL_Write_Enable_Check(void)
|
||||
{
|
||||
EEL_SAVE_ENABLE = 1;
|
||||
|
||||
}
|
||||
|
||||
void DID_data_save_init(void)
|
||||
@ -437,20 +368,15 @@ void value_init(void)
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
CAN_50A.Msg_Byte[i] = 0;
|
||||
CAN_101.Msg_Byte[i] = 0;
|
||||
CAN_220.Msg_Byte[i] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
void CAN_RX_Data_Handle(void)
|
||||
{
|
||||
|
||||
VehicleSpeedRaw = CAN_403.Msg_Bit.VCU_VehSpd1;
|
||||
VehicleSpeedRaw <<= 8;
|
||||
VehicleSpeedRaw |= CAN_403.Msg_Bit.VCU_VehSpd2;
|
||||
VehicleSpeedRaw <<= 2;
|
||||
VehicleSpeedRaw |= CAN_403.Msg_Bit.VCU_VehSpd3;
|
||||
|
||||
VehicleSpeed = VehicleSpeedRaw>>4;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
#include "r_cg_macrodriver.h"
|
||||
|
||||
#include "r_cg_timer.h"
|
||||
#include "r_cg_userdefine.h"
|
||||
#include "r_rl78_can_sfr.h"
|
||||
#include "r_rl78_can_drv.h"
|
||||
@ -14,18 +14,6 @@
|
||||
|
||||
|
||||
/***********************************************/
|
||||
typedef struct{
|
||||
unsigned int start;
|
||||
unsigned int zysoft1;
|
||||
unsigned int zysoft2;
|
||||
unsigned int zynow;
|
||||
unsigned int kbsoft1;
|
||||
unsigned int kbsoft2;
|
||||
unsigned int kbnow;
|
||||
unsigned int checksum;
|
||||
unsigned int stop;
|
||||
}MotorStateEE_Type;
|
||||
extern MotorStateEE_Type MotorStateEE;
|
||||
|
||||
|
||||
|
||||
@ -36,8 +24,7 @@ extern MotorStateEE_Type MotorStateEE;
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned int u16;
|
||||
|
||||
extern unsigned char TB9102_Enable,TB9102_Disable_count;
|
||||
extern unsigned char Motor_init_15s_count;
|
||||
|
||||
|
||||
extern u16 ad[8];
|
||||
extern u8 ad_voltage_fact[8];
|
||||
@ -45,20 +32,11 @@ extern u8 ad_voltage_fact[8];
|
||||
|
||||
extern unsigned long Can_1ms_count_alive;
|
||||
|
||||
extern u8 RES_CYC_SET,RES_RDEF_SET,RES_CYC_SET_last;
|
||||
extern u8 RES_MODE_SET,RES_MODE_SET_last;
|
||||
extern u8 LAST_FAN_SET;
|
||||
|
||||
extern unsigned int EEL_SAVE_CNT_DOWN_TIMER;
|
||||
|
||||
extern unsigned char AppliTick;
|
||||
extern unsigned char AppliSchedule;
|
||||
extern u8 RDEF_OUT_FLAG,RDEF_CNT;
|
||||
extern u16 key_dither;
|
||||
extern u16 RecurrenceRunTime;
|
||||
|
||||
extern unsigned char OFF_state,OFF_to_Fre,OFF_Fan_0,OFF_AC_off,OFF_Temp_0;
|
||||
extern unsigned char FrontDef,FrontDef_to_Fre,FrontDef_AC_on,FrontDef_Fan_6;
|
||||
|
||||
|
||||
/*********************Network Manage****************************/
|
||||
extern unsigned char ucIgnStus;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "hwCtrl.h"
|
||||
|
||||
|
||||
#define C_100MS_1MS 20
|
||||
#define C_100MS_1MS 100
|
||||
|
||||
unsigned char App28sTxRxStatus = 3;
|
||||
unsigned char Nw28sTxRxStatus = 3;
|
||||
@ -32,9 +32,9 @@ unsigned char Can_2F_SET_run = 0;
|
||||
unsigned char DiagnosticSession_Present = 1; //
|
||||
unsigned char Tx_Rx_Enable = 3; // 0:none 1:Tx 2:Rx 3:Tx Rx
|
||||
|
||||
Can_Msg_Type_50A CAN_50A;
|
||||
Can_Msg_Type_403 CAN_403;
|
||||
Can_Msg_Type_26D CAN_26D;
|
||||
Can_Msg_Type_101 CAN_101;
|
||||
Can_Msg_Type_220 CAN_220;
|
||||
|
||||
extern uint16_t g_adval[12];
|
||||
|
||||
extern uint16_t ZYMotorLocation;
|
||||
@ -53,7 +53,7 @@ void Copy_Array_to_Array(unsigned char *dest, unsigned char *src, unsigned char
|
||||
|
||||
void Can_Msg_Change_Bcm(void)
|
||||
{
|
||||
Copy_Array_to_Array(TxCanMessage.DB, CAN_50A.Msg_Byte, 8);
|
||||
Copy_Array_to_Array(TxCanMessage.DB, CAN_101.Msg_Byte, 8);
|
||||
}
|
||||
|
||||
void CAN_TX_MESSAGE_INIT(void)
|
||||
@ -63,9 +63,9 @@ void CAN_TX_MESSAGE_INIT(void)
|
||||
TxCanMessage.RTR = 0; /* RTR 0:Data 1:Remote */
|
||||
TxCanMessage.THDSE = 0; /* Transmit History Data Store Enable */
|
||||
#if NOW_BOARD == LEFT_BOARD
|
||||
TxCanMessage.IDL = 0x50A; /* ID Data (low) */
|
||||
TxCanMessage.IDL = 0x220; /* ID Data (low) */
|
||||
#else
|
||||
TxCanMessage.IDL = 0x50B; /* ID Data (low) */
|
||||
TxCanMessage.IDL = 0x101; /* ID Data (low) */
|
||||
#endif
|
||||
TxCanMessage.IDH = 0; /* ID Data (high) */
|
||||
TxCanMessage.DLC = 8; /* DLC Data */
|
||||
@ -94,7 +94,7 @@ void ClearTxCounter(void)
|
||||
extern unsigned char rollingcounter;
|
||||
void TxServe(void)
|
||||
{
|
||||
Can_RtnType re_flag;
|
||||
//Can_RtnType re_flag;
|
||||
static unsigned char sucNwSendCnt = 0;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@ -142,17 +142,11 @@ void TxServe(void)
|
||||
{
|
||||
|
||||
Can_Msg_Change_Bcm();
|
||||
re_flag = R_CAN_TrmByTRFIFO0_CH0(&TxCanMessage);
|
||||
R_CAN_TrmByTRFIFO0_CH0(&TxCanMessage);
|
||||
|
||||
//TxTestMsg();
|
||||
air_req_timer = C_100MS_1MS;
|
||||
|
||||
rollingcounter++;
|
||||
if (rollingcounter > 15)
|
||||
{
|
||||
rollingcounter = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,54 +93,93 @@ typedef union{
|
||||
}Msg_Bit;
|
||||
}Can_Msg_Type_403;
|
||||
|
||||
|
||||
|
||||
typedef union{
|
||||
unsigned int Msg_Word[4];
|
||||
unsigned char Msg_Byte[8];
|
||||
struct{
|
||||
//BYTE 1
|
||||
unsigned char LB:1; //喇叭开关
|
||||
unsigned char ZZ:1; //左转向开关
|
||||
unsigned char YZ:1; //右转向开关
|
||||
unsigned char ZXFW:1; //转向复位开关
|
||||
unsigned char JS:1; //警示开关
|
||||
unsigned char YJ:1; //远近光开关
|
||||
unsigned char CC:1; //超车开关
|
||||
unsigned char DD:1; //大灯开关
|
||||
unsigned char reverse10:4;
|
||||
unsigned char SwitchButton_NearOrFarLight:1; //(P82)远近光切换按钮
|
||||
unsigned char reverse11:1;
|
||||
unsigned char FogLampSwitch:1; //(P125)雾灯开关
|
||||
unsigned char HeadLampSwitch:1; //(P81)自动感应大灯开关
|
||||
|
||||
//BYTE 2
|
||||
unsigned char DFS:1; //挡风玻璃调节开关(升)
|
||||
unsigned char DFJ:1; //挡风玻璃调节开关(降)
|
||||
unsigned char MS:1; //仪表确认开关(模式选择)
|
||||
unsigned char YBFH:1; //仪表返回开关
|
||||
unsigned char YBS:1; //仪表调节开关(上)
|
||||
unsigned char YBX:1; //仪表调节开关(下)
|
||||
unsigned char QD:1; //启动开关
|
||||
unsigned char XH:1; //熄火开关
|
||||
unsigned char FAxle_2_4WD_DifLock:1; //(P80)前桥2/4WD、差速锁开关
|
||||
unsigned char reverse20:3;
|
||||
unsigned char Trumpet:1; //(P63)喇叭
|
||||
unsigned char reverse21:3;
|
||||
|
||||
//BYTE 3
|
||||
unsigned char WBJR:1;//握把加热开关
|
||||
unsigned char ZYJR:1;//座椅加热开关
|
||||
unsigned char YD:1;//夜灯开关
|
||||
unsigned char TCS:1;//TCS
|
||||
unsigned char reverse1:4;//
|
||||
//BYTE 4/5/6
|
||||
unsigned char reverse2:8;//
|
||||
unsigned char LeftSteering:1;//(P30)左转向
|
||||
unsigned char reverse30:7;//
|
||||
|
||||
//BYTE 4
|
||||
unsigned char WarningAgainstDanger:1;//(P17)应急灯开关
|
||||
unsigned char TurnOnTheHeater:1;//(P34)座椅加热
|
||||
unsigned char reverse40:2;//
|
||||
unsigned char MODEL_SEL:1;//(P83)MODE
|
||||
unsigned char reverse41:3;//
|
||||
//BYTE 5/6/7
|
||||
unsigned char reverse5:8;//
|
||||
unsigned char reverse6:8;//
|
||||
unsigned char reverse7:8;//
|
||||
//BYTE 8
|
||||
unsigned char checksum:8;//
|
||||
}Msg_Bit;
|
||||
}Can_Msg_Type_220;
|
||||
|
||||
typedef union{
|
||||
unsigned int Msg_Word[4];
|
||||
unsigned char Msg_Byte[8];
|
||||
struct{
|
||||
//BYTE 1 bit 0
|
||||
unsigned char reverse10:3; //喇叭开关
|
||||
unsigned char TCS_TractionControl:1; //左转向开关
|
||||
unsigned char reverse11:1; //(P30)预留15
|
||||
unsigned char reverse12:1; //(P63)预留16
|
||||
unsigned char reverse13:2; //
|
||||
|
||||
//BYTE 2 bit 8
|
||||
unsigned char reverse20:2; //
|
||||
unsigned char HandleHeating:1; //(P83)手把加热
|
||||
unsigned char reverse21:3; //
|
||||
unsigned char DifferentialLock:1; //(P125)后桥差速锁开关
|
||||
unsigned char reverse22:1; //
|
||||
|
||||
//BYTE 3 bit 16
|
||||
unsigned char reverse3:8;//
|
||||
unsigned char reverse4:8;//
|
||||
//BYTE 7
|
||||
unsigned char rolling:4;//报文计数器
|
||||
unsigned char reverse5:4;//
|
||||
|
||||
//BYTE 4 bit 24
|
||||
unsigned char reverse40:5;//
|
||||
unsigned char RightSteering:1;//(P34)右转向
|
||||
unsigned char reverse41:2;//
|
||||
|
||||
//BYTE 5 bit 32
|
||||
unsigned char reverse50:4;//
|
||||
unsigned char EngineIgnitionStopControl:1;//(P81)熄火
|
||||
unsigned char reverse1:3;//
|
||||
|
||||
//BYTE 6 bit 40
|
||||
unsigned char CrankingMotor:1;//(P80)启动
|
||||
unsigned char DIST_SET:1;//(P17)SET
|
||||
unsigned char reverse60:6;//
|
||||
|
||||
//BYTE 7 bit 48
|
||||
unsigned char reverse7:8;//
|
||||
//BYTE 8
|
||||
unsigned char checksum:8;//5
|
||||
}Msg_Bit;
|
||||
}Can_Msg_Type_50A;
|
||||
}Can_Msg_Type_101;
|
||||
|
||||
|
||||
extern Can_Msg_Type_50A CAN_50A;
|
||||
extern Can_Msg_Type_403 CAN_403;
|
||||
extern Can_Msg_Type_26D CAN_26D;
|
||||
extern unsigned int CAN_LostCount;
|
||||
|
||||
|
||||
|
||||
|
||||
extern Can_Msg_Type_101 CAN_101;
|
||||
extern Can_Msg_Type_220 CAN_220;
|
||||
|
||||
|
||||
|
||||
|
23
ECU_APP/user/crc.h
Normal file
23
ECU_APP/user/crc.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef __CRC_H__
|
||||
#define __CRC_H__
|
||||
|
||||
|
||||
unsigned char CRC_Calc(unsigned char * dataptr,unsigned char len);
|
||||
unsigned char CRC_Calc_Table(unsigned char * dataptr,unsigned char len);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -24,7 +24,7 @@ void ClearKeyState(void)
|
||||
}
|
||||
void setKeyPressFlag(uint8_t id)
|
||||
{
|
||||
id--;
|
||||
|
||||
if (id < KEY_NUM)
|
||||
{
|
||||
keyPressFlag[id] = KEY_PRESSED;
|
||||
@ -32,7 +32,7 @@ void setKeyPressFlag(uint8_t id)
|
||||
}
|
||||
void setKeyReleaseFlag(uint8_t id)
|
||||
{
|
||||
id--;
|
||||
|
||||
if (id < KEY_NUM)
|
||||
{
|
||||
keyReleaseFlag[id] = KEY_PRESSED;
|
||||
@ -41,7 +41,7 @@ void setKeyReleaseFlag(uint8_t id)
|
||||
uint8_t getKeyPressFlag(uint8_t id)
|
||||
{
|
||||
uint8_t retVal = KEY_NOPRESSED;
|
||||
id--;
|
||||
|
||||
if (id < KEY_NUM)
|
||||
{
|
||||
retVal = keyPressFlag[id];
|
||||
@ -52,7 +52,7 @@ uint8_t getKeyPressFlag(uint8_t id)
|
||||
uint8_t getKeyReleaseFlag(uint8_t id)
|
||||
{
|
||||
uint8_t retVal = KEY_NOPRESSED;
|
||||
id--;
|
||||
|
||||
if (id < KEY_NUM)
|
||||
{
|
||||
retVal = keyReleaseFlag[id];
|
||||
@ -66,7 +66,7 @@ void KeyScan(void)//1ms
|
||||
uint8_t i,key;
|
||||
for (i = 0; i < KEY_NUM; i++)
|
||||
{
|
||||
key = GetIOState(i+1);
|
||||
key = GetIOState(i);
|
||||
if (key == KEY_PRESSED)
|
||||
{
|
||||
keydelay[i]++;
|
||||
@ -98,31 +98,31 @@ uint8_t GetIOState(uint8_t keyno)
|
||||
switch (keyno)
|
||||
{
|
||||
//KEY
|
||||
case KEYID_1 :
|
||||
case KEYID_1_P125 :
|
||||
return KEY_1==0?1:0;
|
||||
|
||||
case KEYID_2 :
|
||||
case KEYID_2_P34 :
|
||||
return KEY_2==0?1:0;
|
||||
|
||||
case KEYID_3 :
|
||||
case KEYID_3_P81 :
|
||||
return KEY_3==0?1:0;
|
||||
|
||||
case KEYID_4 :
|
||||
case KEYID_4_P82 :
|
||||
return KEY_4==0?1:0;
|
||||
|
||||
case KEYID_5 :
|
||||
case KEYID_5_P83 :
|
||||
return KEY_5==0?1:0;
|
||||
|
||||
case KEYID_6 :
|
||||
case KEYID_6_P80 :
|
||||
return KEY_6==0?1:0;
|
||||
|
||||
case KEYID_7 :
|
||||
case KEYID_7_P63 :
|
||||
return KEY_7==0?1:0;
|
||||
|
||||
case KEYID_8 :
|
||||
case KEYID_8_P17 :
|
||||
return KEY_8==0?1:0;
|
||||
|
||||
case KEYID_9 :
|
||||
case KEYID_9_P30 :
|
||||
return KEY_9==0?1:0;
|
||||
|
||||
default:
|
||||
@ -132,9 +132,9 @@ uint8_t GetIOState(uint8_t keyno)
|
||||
|
||||
uint8_t GetKeyState(uint8_t keyno)
|
||||
{
|
||||
if (keyno > 0 && keyno <= KEY_NUM)
|
||||
if (keyno < KEY_NUM)
|
||||
{
|
||||
return keystate[keyno-1];
|
||||
return keystate[keyno];
|
||||
}
|
||||
return KEY_NOPRESSED;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user