Commit 834da060 authored by 何锐's avatar 何锐

feat:修改发送位置

parent a0618ba2
......@@ -204,11 +204,6 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
{
sendflag_92 = 0;
WMHCommFramePackedTransmit(EM_WMH_COMM_SEND_MSG_ICM_0x92);
if(get_data80 == 1)
{
get_data80 = 0;
Can_Msg_Tx_Overwrite(&CAN_CH4_CanMsgTxOp,0u,1u,1000u);
}
}
}
}
......
......@@ -4,6 +4,7 @@
#include "TYW_stdint.h"
#include "string.h"
#include "Task.h"
#include "CAN_Communication_Matrix.h"
const WMH_COMM_INIT_FRAME_T WMHCommRecvInitList[EM_WMH_COMM_RECV_MSG_TOTAL] = {
{0x80u, 1000u, COMM_DATA_UNION_WI_BOX_LENGTH_0X80, 5000u, 1u, WMHCommDataWiBox_0x80.Bytes, WMHCommFrameCallBack_WiBox_0x80, WMHCommFrameTimeoutFunc_WiBox80, WMHCommFrameCheckSumFunc},
};
......@@ -80,8 +81,8 @@ void WMHCommFrameUnpacked(uint8_t *data, uint32_t length)
if (WMHCommRecvInitList[i].FrameCallBackFunc != NULL_P) {
WMHCommRecvInitList[i].FrameCallBackFunc();
}
get_data80 = 1;
WMHCommRecvMessageTimeout[i] = WMHCommRecvInitList[i].TimeoutMax;
Can_Msg_Tx_Overwrite(&CAN_CH4_CanMsgTxOp,0u,1u,1000u);
}
}
......
......@@ -45,7 +45,7 @@ static const MW_WMH_COMM_SEQUENTIAL_T mwWMHCommSequentialParams[EM_WMH_COMM_FRAM
}
#else
// EM_WMH_COMM_FRAME_START
{
{ //low high
{ 20000, 2000, }, // Standard
{ 20400, 2200, }, // UpperLimit
{ 19600, 1800, }, // LowerLimit
......@@ -116,58 +116,74 @@ void mwWMHCommRecvIsr_wibox(uint32_t tmpCnts)
uint16_t n = (uint16_t)EM_WMH_COMM_PIN_RX_ID_wibox;
uint8_t tmpVal = WMH_COIN;
if ((mwWMHCommSerialBuffer[n].Valid == 0)
&& (mwWMHCommFrame[EM_WMH_COMM_PIN_TX_IDX] == EM_WMH_COMM_FRAME_STANDBAY)
)
if ((mwWMHCommSerialBuffer[n].Valid == 0) && (mwWMHCommFrame[EM_WMH_COMM_PIN_TX_IDX] == EM_WMH_COMM_FRAME_STANDBAY))
{
if (tmpVal == 0) {
if (mwWMHCommFrameTimerCnts[n].HighLevelTime > 0) {
if (tmpVal == 0)
{
if (mwWMHCommFrameTimerCnts[n].HighLevelTime > 0)
{
mwWMHCommFrameTimerCnts[n].HighLevelTime = 0;
mwWMHCommFrameTimerCnts[n].LowLevelTime = 0;
}
mwWMHCommFrameTimerCnts[n].LowLevelTime += tmpCnts;
if (mwWMHCommFrameTimerCnts[n].LowLevelTime >= 50000) {
if (mwWMHCommFrameTimerCnts[n].LowLevelTime >= 50000)
{
mwWMHCommFrame[n] = EM_WMH_COMM_FRAME_STANDBAY;
mwWMHCommSerialBuffer[n].Byte = 0;
mwWMHCommSerialBuffer[n].Bit = 0;
mwWMHCommFrameTimerCnts[n].LowLevelTime = 0;
mwWMHCommFrameTimerCnts[n].HighLevelTime = 0;
}
} else {
}
else
{
mwWMHCommFrameTimerCnts[n].HighLevelTime += tmpCnts;
if (mwWMHCommFrameTimerCnts[n].HighLevelTime > 0) {
if (mwWMHCommFrame[n] == EM_WMH_COMM_FRAME_STANDBAY) {
if (MW_WMH_COMM_FRAME_CONVERT_COND(n, EM_WMH_COMM_FRAME_START) != 0) {
if (mwWMHCommFrameTimerCnts[n].HighLevelTime > 0)
{
if (mwWMHCommFrame[n] == EM_WMH_COMM_FRAME_STANDBAY)
{
if (MW_WMH_COMM_FRAME_CONVERT_COND(n, EM_WMH_COMM_FRAME_START) != 0)
{
mwWMHCommFrame[n] = EM_WMH_COMM_FRAME_START;
mwWMHCommSerialBuffer[n].Byte = 0;
mwWMHCommSerialBuffer[n].Bit = 0;
mwWMHCommFrameTimerCnts[n].LowLevelTime = 0;
mwWMHCommFrameTimerCnts[n].HighLevelTime = 0;
}
} else if (mwWMHCommFrame[n] == EM_WMH_COMM_FRAME_START) {
if (MW_WMH_COMM_FRAME_CONVERT_COND(n, EM_WMH_COMM_FRAME_LOGIC_1) != 0) {
}
else if (mwWMHCommFrame[n] == EM_WMH_COMM_FRAME_START)
{
if (MW_WMH_COMM_FRAME_CONVERT_COND(n, EM_WMH_COMM_FRAME_LOGIC_1) != 0)
{
// mwWMHCommSerialBuffer[n].Byte = mwWMHCommSerialBuffer[n].Byte << 1;
mwWMHCommSerialBuffer[n].Byte |= (1u << mwWMHCommSerialBuffer[n].Bit);
mwWMHCommSerialBuffer[n].Bit++;
mwWMHCommFrameTimerCnts[n].LowLevelTime = 0;
mwWMHCommFrameTimerCnts[n].HighLevelTime = 0;
} else if (MW_WMH_COMM_FRAME_CONVERT_COND(n, EM_WMH_COMM_FRAME_LOGIC_0) != 0) {
}
else if (MW_WMH_COMM_FRAME_CONVERT_COND(n, EM_WMH_COMM_FRAME_LOGIC_0) != 0)
{
// mwWMHCommSerialBuffer[n].Byte = mwWMHCommSerialBuffer[n].Byte << 1;
mwWMHCommSerialBuffer[n].Byte &= ~(1u << mwWMHCommSerialBuffer[n].Bit);
mwWMHCommSerialBuffer[n].Bit++;
mwWMHCommFrameTimerCnts[n].LowLevelTime = 0;
mwWMHCommFrameTimerCnts[n].HighLevelTime = 0;
} else if (mwWMHCommFrameTimerCnts[n].HighLevelTime >= 60000) {
}
else if (mwWMHCommFrameTimerCnts[n].HighLevelTime >= 60000)
{
mwWMHCommFrame[n] = EM_WMH_COMM_FRAME_STANDBAY;
mwWMHCommSerialBuffer[n].Valid = 1;
mwWMHCommSerialBuffer[n].Byte = 0;
mwWMHCommSerialBuffer[n].Bit = 0;
mwWMHCommFrameTimerCnts[n].LowLevelTime = 0;
mwWMHCommFrameTimerCnts[n].HighLevelTime = 0;
} else {
}
else
{
;
}
if (mwWMHCommSerialBuffer[n].Bit >= 8) {
if (mwWMHCommSerialBuffer[n].Bit >= 8)
{
mwWMHCommSerialBuffer[n].Bit = 0;
// Receive One Byte
mwWMHCommRecvByte_wibox(mwWMHCommSerialBuffer[n].Byte);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment