Обновление 23.06.2026
This commit is contained in:
parent
4f9418d433
commit
060402272f
|
|
@ -35,7 +35,7 @@ static void sendEventToCan(tCanSpamTransmitter *env) {
|
||||||
env->canFrame.standard_id = env->can_id;
|
env->canFrame.standard_id = env->can_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
env->ioCanFrame->transmit(env->ioCanFrame->env, (uint8_t *) &env->canFrame.data, env->canFrame.dlc,
|
env->ioCanFrame->transmit(env->ioCanFrame->env, (uint8_t * ) & env->canFrame.data, env->canFrame.dlc,
|
||||||
env->can_id, env->canFrame.id_type, 100);
|
env->can_id, env->canFrame.id_type, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,8 +117,8 @@ static eTimeEventTransmit isEventTransmitter(tCanSpamTransmitter *env) {
|
||||||
// Checksum computed as per XOR algorithm:
|
// Checksum computed as per XOR algorithm:
|
||||||
// Byte 1 XOR byte 2 .... XOR byte n-1. (n = packet length.)
|
// Byte 1 XOR byte 2 .... XOR byte n-1. (n = packet length.)
|
||||||
|
|
||||||
uint8_t d0 = (uint8_t) ((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_eCompSpeedReq_Val_ro & (0xFFU)));
|
uint8_t d0 = (uint8_t)((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_eCompSpeedReq_Val_ro & (0xFFU)));
|
||||||
uint8_t d1 = (uint8_t) ((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_eCompReq_Stat & (0x01U)) |
|
uint8_t d1 = (uint8_t)((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_eCompReq_Stat & (0x01U)) |
|
||||||
((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_LowTempValve_Req & (0x03U)) << 1U) |
|
((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_LowTempValve_Req & (0x03U)) << 1U) |
|
||||||
((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_HVC_Req_RC & (0x0FU)) << 4U));
|
((ccu_candb_tx.CCU_HVC_Req_Msg.CCU_HVC_Req_RC & (0x0FU)) << 4U));
|
||||||
|
|
||||||
|
|
@ -234,10 +234,10 @@ static eTimeEventTransmit isEventTransmitter(tCanSpamTransmitter *env) {
|
||||||
// Checksum computed as per XOR algorithm:
|
// Checksum computed as per XOR algorithm:
|
||||||
// Byte 1 XOR byte 2 .... XOR byte n-1. (n = packet length.)
|
// Byte 1 XOR byte 2 .... XOR byte n-1. (n = packet length.)
|
||||||
|
|
||||||
uint8_t d0 = (uint8_t) ((ccu_candb_tx.CCU_Msg3.CCU_FAN_Req & (0x7FU)));
|
uint8_t d0 = (uint8_t)((ccu_candb_tx.CCU_Msg3.CCU_FAN_Req & (0x7FU)));
|
||||||
uint8_t d1 = (uint8_t) ((ccu_candb_tx.CCU_Msg3.CCU_RestMode_Stat & (0x03U)));
|
uint8_t d1 = (uint8_t)((ccu_candb_tx.CCU_Msg3.CCU_RestMode_Stat & (0x03U)));
|
||||||
uint8_t d2 = (uint8_t) ((ccu_candb_tx.CCU_Msg3.CCU_IncarTempSum_Val_ro & (0xFFU)));
|
uint8_t d2 = (uint8_t)((ccu_candb_tx.CCU_Msg3.CCU_IncarTempSum_Val_ro & (0xFFU)));
|
||||||
uint8_t d3 = (uint8_t) ((ccu_candb_tx.CCU_Msg3.CCU_MSG3_RC & (0x0FU)));
|
uint8_t d3 = (uint8_t)((ccu_candb_tx.CCU_Msg3.CCU_MSG3_RC & (0x0FU)));
|
||||||
|
|
||||||
ccu_candb_tx.CCU_Msg3.CCU_MSG3_CS = d0 ^ d1 ^ d2 ^ d3;
|
ccu_candb_tx.CCU_Msg3.CCU_MSG3_CS = d0 ^ d1 ^ d2 ^ d3;
|
||||||
|
|
||||||
|
|
@ -300,17 +300,16 @@ static _Noreturn void CanSpamTransmitter_Thread(tCanSpamTransmitter *env) {
|
||||||
|
|
||||||
SystemDelayMs(100);
|
SystemDelayMs(100);
|
||||||
|
|
||||||
if (osMutexAcquire(env->access, 5000) == osOK) {
|
|
||||||
|
|
||||||
if (env->isMute == false) {
|
if (env->isMute == false) {
|
||||||
|
|
||||||
|
if (osMutexAcquire(env->access, 5000) == osOK) {
|
||||||
|
|
||||||
env->timeMs += 100;
|
env->timeMs += 100;
|
||||||
|
|
||||||
while (isEventTransmitter(env) != event_CCU_none) {
|
while (isEventTransmitter(env) != event_CCU_none) {
|
||||||
sendEventToCan(env);
|
sendEventToCan(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
osMutexRelease(env->access);
|
osMutexRelease(env->access);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -318,6 +317,7 @@ static _Noreturn void CanSpamTransmitter_Thread(tCanSpamTransmitter *env) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CanSpamTransmitter_StartThread(tCanSpamTransmitter *env) {
|
void CanSpamTransmitter_StartThread(tCanSpamTransmitter *env) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue