|
@@ -39,6 +39,7 @@ extern volatile BOOL Sleep_flag;
|
|
|
extern AppNVMDataType AppNVMData;
|
|
|
extern AppDataBody AppDataInfo;
|
|
|
extern UINT8 WorkFlag;
|
|
|
+extern UINT8 UDSSwitch;
|
|
|
//全局变量输出区
|
|
|
BOOL UartBattInfoRecvFlag = false;
|
|
|
QueueHandle_t UartWriteCmdHandle = NULL;
|
|
@@ -70,7 +71,7 @@ void battSOCDisplay(void);
|
|
|
void battErrorStateDisplay(void);
|
|
|
void battWarningStateDisplay(void);
|
|
|
void battLockStateDisplay(UINT8 lockState);
|
|
|
-void relayPWMControl(void);
|
|
|
+void relayControlFunc(float DutyRatio,UINT8 BuzzerPeriod);
|
|
|
void SP_BMS_Update_Service(void);
|
|
|
BOOL BattHeaterSwitch(UINT8* heaterSwitch);
|
|
|
UINT16 encryptionAlgorithm (UINT16 plainText);
|
|
@@ -109,9 +110,12 @@ static void UartTask(void* arg)
|
|
|
memset(&(UartReadMsg.UartFlag),0x00,sizeof(UartReadMsgType));
|
|
|
if(UartWriteCmdHandle == NULL)//Uart控制命令传输指针
|
|
|
{
|
|
|
- UartWriteCmdHandle = osMessageQueueNew(3,sizeof(Uart_Write_Data_Type), NULL);
|
|
|
+ UartWriteCmdHandle = osMessageQueueNew(1,sizeof(Uart_Write_Data_Type), NULL);
|
|
|
}
|
|
|
//上电起始控制区域
|
|
|
+ UINT8 ret = 0x00,Ringtimes = 0;
|
|
|
+ UINT8 HeatSwitch = 0;
|
|
|
+
|
|
|
while (1)
|
|
|
{
|
|
|
switch (gProcess_Uart_Task)
|
|
@@ -133,23 +137,38 @@ static void UartTask(void* arg)
|
|
|
osDelay(100);
|
|
|
if(Sleep_flag)
|
|
|
{
|
|
|
+ Ringtimes = 0;
|
|
|
PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_SLEEP);
|
|
|
+ break;
|
|
|
}
|
|
|
else if(Timer_count%10==0)
|
|
|
{
|
|
|
#ifdef USING_PRINTF1
|
|
|
printf("[%d]Uart Timer 1s:%d,uartReadSuccessFlag:%d\n",__LINE__,Timer_count,uartReadSuccessFlag);
|
|
|
#endif
|
|
|
- if(osMessageQueueGet(UartWriteCmdHandle,&UartWriteData,0,0)==osOK)
|
|
|
+ if(osMessageQueueGet(UartWriteCmdHandle,&UartWriteData,0,0)==osOK && uartReadSuccessFlag==TRUE)
|
|
|
{
|
|
|
- #ifdef USING_PRINTF1
|
|
|
- printf("[%d]UartWriteCmdHandle :%x\n",__LINE__,UartWriteData.WriteCmd);
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("[%d]UartWriteCmdHandle :%x-%X%X\n",__LINE__,UartWriteData.WriteCmd,UartWriteData.Data[0],UartWriteData.Data[1]);
|
|
|
#endif
|
|
|
+ Ringtimes = 0;
|
|
|
PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_WRITE);
|
|
|
+ break;
|
|
|
}
|
|
|
else
|
|
|
- PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_READ);
|
|
|
+ {
|
|
|
+ PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_READ);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ if(maxCellVol>4400&&maxCellVol<6000)//继电器测试
|
|
|
+ {
|
|
|
+ AppDataInfo.RelayControl=TRUE;
|
|
|
+ }
|
|
|
+ else if(maxCellVol<4000)
|
|
|
+ {
|
|
|
+ AppDataInfo.RelayControl=FALSE;
|
|
|
+ }
|
|
|
if(UartReadMsg.Header[2]>0)
|
|
|
{
|
|
|
uartReadSuccessFlag = true;
|
|
@@ -173,6 +192,41 @@ static void UartTask(void* arg)
|
|
|
{
|
|
|
battWarningStateDisplay();
|
|
|
}
|
|
|
+ if(AppNVMData.isBattLocked==FALSE && ret==0x01)
|
|
|
+ {
|
|
|
+ relayControlFunc(0.8,5);//表示1s响2次,占比80%
|
|
|
+ Ringtimes++;
|
|
|
+ if(Ringtimes>=15)
|
|
|
+ {
|
|
|
+ relayControl(FALSE);
|
|
|
+ ret = 0;
|
|
|
+ Ringtimes = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (AppNVMData.isBattLocked==TRUE && ret==0x01)
|
|
|
+ {
|
|
|
+ relayControlFunc(0.8,5);//表示1s响2次,占比80%
|
|
|
+ Ringtimes++;
|
|
|
+ if(Ringtimes>=10)
|
|
|
+ {
|
|
|
+ relayControl(FALSE);
|
|
|
+ ret = 0;
|
|
|
+ Ringtimes = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(UDSSwitch==1 && Ringtimes<=50)
|
|
|
+ {
|
|
|
+ relayControlFunc(0.8,5);//表示1s响2次,占比80%
|
|
|
+ Ringtimes++;
|
|
|
+ }
|
|
|
+ else if(BuzzerControl==TRUE)
|
|
|
+ {
|
|
|
+ relayControlFunc(0.8,5);//表示1s响2次,占比80%
|
|
|
+ }
|
|
|
+ if(Ringtimes>=50)
|
|
|
+ {
|
|
|
+ relayControl(FALSE);
|
|
|
+ }
|
|
|
}
|
|
|
currentTimerCount = Timer_count;
|
|
|
if(BMS_Fota_update_flag)
|
|
@@ -180,31 +234,56 @@ static void UartTask(void* arg)
|
|
|
if(WorkFlag==0x00)
|
|
|
{
|
|
|
PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_UPDATE);
|
|
|
+ break;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- if(AppNVMData.isBattLocked==TRUE && ((UartReadMsg.data[(0x09+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2+1])>>1)&0x03!=0x00 && Timer_count%10==0)//try to lock
|
|
|
+ if(battWorkState ==0x00 && AppNVMData.isBattLocked==TRUE && ((UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1])&0x03)!=0x02)//try to lock lock the discharge
|
|
|
{
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("[%d]try to lock:%X-%X\n",__LINE__,AppNVMData.isBattLocked,(UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1])&0x03);
|
|
|
+ #endif
|
|
|
UartWriteData.WriteCmd = 0x01;
|
|
|
- UartWriteData.Data[0] = 0x00;
|
|
|
- UartWriteData.Data[1] = 0x00;
|
|
|
- osMessageQueuePut(UartWriteCmdHandle,&UartWriteData,0,1000);
|
|
|
- PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_READ);
|
|
|
+ UartWriteData.Data[0] = 0x00|(UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2]);
|
|
|
+ UartWriteData.Data[1] = 0x02;
|
|
|
+ osMessageQueuePut(UartWriteCmdHandle,&UartWriteData,0,0);
|
|
|
}
|
|
|
- else if (AppNVMData.isBattLocked==FALSE && ((UartReadMsg.data[(0x09+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2+1])>>1)&0x03==0x00 && Timer_count%10==0 ) // try to unlock
|
|
|
+ else if (battWorkState ==0x00 && AppNVMData.isBattLocked==FALSE && ((UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1])&0x03)!=0x03) // try to unlock
|
|
|
{
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("[%d]try to unlock:%X-%X\n",__LINE__,AppNVMData.isBattLocked,(UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1])&0x03);
|
|
|
+ #endif
|
|
|
UartWriteData.WriteCmd = 0x01;
|
|
|
- UartWriteData.Data[0] = 0x00;
|
|
|
+ UartWriteData.Data[0] = 0x00|(UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2]);
|
|
|
UartWriteData.Data[1] = 0x03;
|
|
|
- osMessageQueuePut(UartWriteCmdHandle,&UartWriteData,0,1000);
|
|
|
- PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_READ);
|
|
|
+ osMessageQueuePut(UartWriteCmdHandle,&UartWriteData,0,0);
|
|
|
+ }
|
|
|
+ if(AppDataInfo.RelayControl==TRUE && ((UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2])&0x80)==0x00)//继电器断开
|
|
|
+ {
|
|
|
+ UartWriteData.WriteCmd = 0x03;
|
|
|
+ UartWriteData.Data[0] = 0x80;
|
|
|
+ UartWriteData.Data[1] = 0x00|(UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1]);
|
|
|
+ osMessageQueuePut(UartWriteCmdHandle,&UartWriteData,0,0);
|
|
|
+ }
|
|
|
+ else if(AppDataInfo.RelayControl==FALSE && ((UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2])&0x80)==0x80)//继电器闭合
|
|
|
+ {
|
|
|
+ UartWriteData.WriteCmd = 0x03;
|
|
|
+ UartWriteData.Data[0] = 0x00;
|
|
|
+ UartWriteData.Data[1] = 0x00|(UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1]);
|
|
|
+ osMessageQueuePut(UartWriteCmdHandle,&UartWriteData,0,0);
|
|
|
+ }
|
|
|
+ if(BattHeaterSwitch(&HeatSwitch)==TRUE)
|
|
|
+ {
|
|
|
+ UartWriteData.WriteCmd = 0x02;
|
|
|
+ UartWriteData.Data[0] = 0x00;
|
|
|
+ UartWriteData.Data[1] = HeatSwitch&0xFF;
|
|
|
+ osMessageQueuePut(UartWriteCmdHandle,&UartWriteData,0,0);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
case PROCESS_UART_STATE_READ:
|
|
|
{
|
|
|
UINT16 CRC_chk_buffer;
|
|
|
- Reg_Num = 0x21+BATT_CELL_VOL_NUM+BATT_TEMP_NUM + 2;//按照协议里面的0x21+X+N的结束地址
|
|
|
+ Reg_Num = 0x21+BATT_CELL_VOL_NUM+BATT_TEMP_NUM + BATT_OTHER_TEMP_NUM;//按照协议里面的0x21+X+N的结束地址
|
|
|
Uart_Read_Msg.Bms_Address = BMS_ADDRESS_CODE;
|
|
|
Uart_Read_Msg.Bms_Funcode = UART_READ_CODE;
|
|
|
Uart_Read_Msg.Reg_Begin_H = 0x00;
|
|
@@ -238,19 +317,15 @@ static void UartTask(void* arg)
|
|
|
BattChrgEndFlag=FALSE;
|
|
|
}
|
|
|
#ifdef USING_PRINTF1
|
|
|
- printf("\nUart_Recv_buffer: ");
|
|
|
- for(int i=0;i<Uart_Recv_LEN;i++)
|
|
|
- {
|
|
|
- printf("%x ",*((UINT8 *)&UartReadMsg.Header+i));
|
|
|
- }
|
|
|
- printf("\n");
|
|
|
- #endif
|
|
|
+ printf("[%d]lock:%X,permit:%X,Mos:%x\n",__LINE__,AppNVMData.isBattLocked,(UartReadMsg.data[(0x1B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1])&0x03,((UartReadMsg.data[(0x09+BATT_CELL_VOL_NUM+BATT_OTHER_TEMP_NUM)*2+1])>>1)&0x03);
|
|
|
+ #endif
|
|
|
break;
|
|
|
}
|
|
|
case PROCESS_UART_STATE_WRITE:
|
|
|
{
|
|
|
- Uart_WriteCmd_func(UartWriteData);
|
|
|
- PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_IDLE);
|
|
|
+ ret = Uart_WriteCmd_func(UartWriteData);
|
|
|
+ osDelay(500);
|
|
|
+ PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_READ);
|
|
|
break;
|
|
|
}
|
|
|
case PROCESS_UART_STATE_UPDATE:
|
|
@@ -343,12 +418,15 @@ static BOOL uartBattInfoDecode(UINT8* dataPtr)
|
|
|
battI = Batt_current*AppDataInfo.BattCurrentNegFlag + 0x2710;
|
|
|
//bit0 ~ bit31 represent cell0 ~ cell31
|
|
|
battBalanceoInfo = dataPtr[(0x06+BATT_CELL_VOL_NUM+TEMP_NUM)*2+1] | (dataPtr[(0x06+BATT_CELL_VOL_NUM+TEMP_NUM)*2] <<8) + (dataPtr[(0x07+BATT_CELL_VOL_NUM+TEMP_NUM)*2+1]<<16) | (dataPtr[(0x07+BATT_CELL_VOL_NUM+TEMP_NUM)*2] <<24);
|
|
|
-
|
|
|
+ // chargerConnectState = (dataPtr[(0x03+BATT_CELL_VOL_NUM)*2+1])&0x04;//充电器连接状态,0表示未连接,1表示已连接
|
|
|
bmsHwVersion = dataPtr[(0x08+BATT_CELL_VOL_NUM+TEMP_NUM)*2+1];
|
|
|
bmsSwVersion = dataPtr[(0x08+BATT_CELL_VOL_NUM+TEMP_NUM)*2];
|
|
|
|
|
|
temp = ((dataPtr[(0x09+BATT_CELL_VOL_NUM+TEMP_NUM)*2+1])>>1)&0x03;
|
|
|
battMOSSwitchState = ((temp&0x01)<<1)|((temp&0x02)>>1);
|
|
|
+ #ifdef USING_PRINTF1
|
|
|
+ printf("[%d]battMOSSwitchState :%x\n",__LINE__,battMOSSwitchState);
|
|
|
+ #endif
|
|
|
if(AppNVMData.isBattLocked==TRUE)
|
|
|
{
|
|
|
battMOSSwitchState = battMOSSwitchState |(0x01<<2);
|
|
@@ -364,6 +442,7 @@ static BOOL uartBattInfoDecode(UINT8* dataPtr)
|
|
|
battPackVol =((dataPtr[(0x18+BATT_CELL_VOL_NUM+TEMP_NUM)*2])<<8|(dataPtr[(0x18+BATT_CELL_VOL_NUM+TEMP_NUM)*2+1]))/10; //uint 100mV
|
|
|
maxCellVol = (dataPtr[(0x19+BATT_CELL_VOL_NUM+TEMP_NUM)*2] << 8) | dataPtr[(0x19+BATT_CELL_VOL_NUM+TEMP_NUM)*2 + 1];
|
|
|
minCellVol = (dataPtr[(0x1A+BATT_CELL_VOL_NUM+TEMP_NUM)*2] << 8) | dataPtr[(0x1A+BATT_CELL_VOL_NUM+TEMP_NUM)*2 + 1];
|
|
|
+ RelayControlState = (dataPtr[(0x1B+BATT_CELL_VOL_NUM+TEMP_NUM)*2])&0x80;
|
|
|
battHeatEnableState = dataPtr[(0x1C+BATT_CELL_VOL_NUM+TEMP_NUM)*2+1]&0x01;
|
|
|
|
|
|
maxCellTemp = 0x00;
|
|
@@ -446,6 +525,9 @@ UINT8 Uart_WriteCmd_func(Uart_Write_Data_Type UartWriteData)
|
|
|
UINT16 CRC_chk_buffer;
|
|
|
UINT8 timeout = 0x00;
|
|
|
UINT8 Uart_Recv_Buffer[8];
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("\nUart_WriteCmd_func: %x ",UartWriteData.WriteCmd);
|
|
|
+ #endif
|
|
|
switch (UartWriteData.WriteCmd)
|
|
|
{
|
|
|
case 0x01://是否锁定
|
|
@@ -478,6 +560,22 @@ UINT8 Uart_WriteCmd_func(Uart_Write_Data_Type UartWriteData)
|
|
|
CRC_chk_buffer = crc_chk((UINT8 *)&Uart_Write_Msg,sizeof(Uart_Write_Msg)-2);
|
|
|
Uart_Write_Msg.CRC_L = CRC_chk_buffer;
|
|
|
Uart_Write_Msg.CRC_H = CRC_chk_buffer>>8;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 0x03://是否继电器控制
|
|
|
+ {
|
|
|
+ RegAddress = 0x1B + BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM;
|
|
|
+ Uart_Write_Msg.Bms_Address = BMS_ADDRESS_CODE;
|
|
|
+ Uart_Write_Msg.Bms_Funcode = UART_WRITE_CODE;
|
|
|
+ Uart_Write_Msg.Reg_Begin_H = RegAddress>>8;
|
|
|
+ Uart_Write_Msg.Reg_Begin_L = RegAddress;
|
|
|
+ Uart_Write_Msg.Reg_Num_H = 0x00;
|
|
|
+ Uart_Write_Msg.Reg_Num_L = 0x01;
|
|
|
+ Uart_Write_Msg.Data_Count = 0x02;//要写入的字节数
|
|
|
+ memcpy(Uart_Write_Msg.Data,UartWriteData.Data,2);
|
|
|
+ CRC_chk_buffer = crc_chk((UINT8 *)&Uart_Write_Msg,sizeof(Uart_Write_Msg)-2);
|
|
|
+ Uart_Write_Msg.CRC_L = CRC_chk_buffer;
|
|
|
+ Uart_Write_Msg.CRC_H = CRC_chk_buffer>>8;
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
@@ -488,7 +586,7 @@ UINT8 Uart_WriteCmd_func(Uart_Write_Data_Type UartWriteData)
|
|
|
}
|
|
|
}
|
|
|
USARTdrv->Send((UINT8 *)&Uart_Write_Msg,sizeof(Uart_Write_Msg));
|
|
|
- #ifdef USING_PRINTF1
|
|
|
+ #ifdef USING_PRINTF
|
|
|
printf("Uart_Send_buffer: ");
|
|
|
for(int i=0;i<sizeof(Uart_Write_Msg);i++)
|
|
|
{
|
|
@@ -510,7 +608,7 @@ UINT8 Uart_WriteCmd_func(Uart_Write_Data_Type UartWriteData)
|
|
|
}
|
|
|
if (isRecvComplete == true)
|
|
|
{
|
|
|
- #ifdef USING_PRINTF1
|
|
|
+ #ifdef USING_PRINTF
|
|
|
printf("Uart_Rece_buffer: ");
|
|
|
for(int i=0;i<8;i++)
|
|
|
{
|
|
@@ -641,21 +739,22 @@ BOOL BattHeaterSwitch(UINT8* heaterSwitch)
|
|
|
UINT8 i =0;
|
|
|
UINT8 currentSwitchState = 0;
|
|
|
//get the current switch state and the cell temp
|
|
|
- currentSwitchState = battMOSSwitchState & 0x01;
|
|
|
- if(currentSwitchState==0) //当前状态为关闭,判断是否应该开启
|
|
|
+ currentSwitchState = battHeatEnableState&0x01;
|
|
|
+
|
|
|
+ if(currentSwitchState==0) //当前状态为关闭,判断是否应该开启
|
|
|
{
|
|
|
- if(minCellTemp<=5+40 && maxCellTemp<25+40 && battSOC>=12)//温度偏移为40
|
|
|
+ if(minCellTemp<5+40 && minCellTemp>=-29+40 && maxCellTemp<25+40)//温度偏移为40
|
|
|
{
|
|
|
*heaterSwitch = 1;
|
|
|
isNeedtoSwitch = true;
|
|
|
}
|
|
|
}
|
|
|
- else //当前状态为开启,判断是否应该关闭
|
|
|
+ else //当前状态为开启,判断是否应该关闭
|
|
|
{
|
|
|
- if(minCellTemp>10+40 || maxCellTemp>30+40 || battSOC<10)
|
|
|
+ if(minCellTemp>=10+40 || maxCellTemp>=30+40)
|
|
|
{
|
|
|
*heaterSwitch = 0;
|
|
|
- isNeedtoSwitch= true;
|
|
|
+ isNeedtoSwitch = true;
|
|
|
}
|
|
|
}
|
|
|
return isNeedtoSwitch;
|
|
@@ -870,8 +969,12 @@ void battErrorStateDisplay()
|
|
|
{
|
|
|
|
|
|
errorLightTimer++;
|
|
|
-
|
|
|
- if(battWarningState != 0)
|
|
|
+ if(battWorkState == 0x02) //充电模式下,如果只有“SOC低故障”,那么就不显示故障灯 zhengchao20210713 add
|
|
|
+ {
|
|
|
+ if((((battWarningState >> 10) & 0x01) == 0x01) && ((battWarningState & 0xFFFFFBFF) == 0x00))
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(battWarningState != 0 )
|
|
|
{
|
|
|
if(errorLightTimer<(UINT8)(errorLEDFlashPeriod*errorDutyRatio))
|
|
|
{
|
|
@@ -1005,30 +1108,26 @@ void battLockStateDisplay(UINT8 lockState)
|
|
|
}
|
|
|
errorLightTimer++;
|
|
|
}
|
|
|
-
|
|
|
-void relayPWMControl()
|
|
|
+void relayControlFunc(float DutyRatio,UINT8 BuzzerPeriod)
|
|
|
{
|
|
|
- static UINT8 timerCount=0;
|
|
|
- //printf("timerCout=%d\n",timerCount);
|
|
|
- if(timerCount<2)
|
|
|
+ static UINT8 BuzzerTimer = 0;
|
|
|
+ BuzzerTimer++;
|
|
|
+ if(BuzzerTimer<(UINT8)(BuzzerPeriod*DutyRatio))
|
|
|
{
|
|
|
relayControl(TRUE);
|
|
|
- timerCount++;
|
|
|
}
|
|
|
- else if(timerCount>=2 && timerCount<5)
|
|
|
+ else if(BuzzerTimer>=(UINT8)(BuzzerPeriod*DutyRatio) && BuzzerTimer<BuzzerPeriod)
|
|
|
{
|
|
|
relayControl(FALSE);
|
|
|
- timerCount++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
relayControl(FALSE);
|
|
|
- timerCount = 0;
|
|
|
+ BuzzerTimer = 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
UINT8 decryptionAlgorithm (UINT16 cipherText)
|
|
|
{
|
|
|
UINT16 plainText = 1;
|