Обновление
This commit is contained in:
parent
79c194ceec
commit
29ba9ea0a9
|
|
@ -13,9 +13,11 @@
|
|||
|
||||
void CanSpamDebugReceiver_Init(tCanSpamDebugReceiver *env,
|
||||
tSerialPortFrameIO *ioCanFrame,
|
||||
osMutexId_t modelTaskAccess,
|
||||
tLoggerInterface *logger) {
|
||||
|
||||
env->ioCanFrame = ioCanFrame;
|
||||
env->modelTaskAccess = modelTaskAccess;
|
||||
env->logger = logger;
|
||||
env->access = osMutexNew(NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ typedef struct {
|
|||
osMutexId_t access;
|
||||
can_rx_message_type canFrame;
|
||||
|
||||
osMutexId_t modelTaskAccess;
|
||||
|
||||
tLoggerInterface *logger;
|
||||
|
||||
struct {
|
||||
|
|
@ -28,7 +30,7 @@ typedef struct {
|
|||
|
||||
} tCanSpamDebugReceiver;
|
||||
|
||||
void CanSpamDebugReceiver_Init(tCanSpamDebugReceiver *env, tSerialPortFrameIO *ioCanFrame, tLoggerInterface *logger);
|
||||
void CanSpamDebugReceiver_Init(tCanSpamDebugReceiver *env, tSerialPortFrameIO *ioCanFrame, osMutexId_t modelTaskAccess, tLoggerInterface *logger);
|
||||
|
||||
void CanSpamDebugReceiver_StartThread(tCanSpamDebugReceiver *env);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,11 @@
|
|||
void CanSpamDebugTransmitter_Init(tCanSpamDebugTransmitter *env,
|
||||
tSerialPortFrameIO *ioCanFrame,
|
||||
tCanSpamDebugReceiver *canSpamDebugReceiver,
|
||||
osMutexId_t modelTaskAccess,
|
||||
tLoggerInterface *logger) {
|
||||
|
||||
env->ioCanFrame = ioCanFrame;
|
||||
env->modelTaskAccess = modelTaskAccess;
|
||||
env->logger = logger;
|
||||
env->canSpamDebugReceiver = canSpamDebugReceiver;
|
||||
env->access = osMutexNew(NULL);
|
||||
|
|
@ -419,7 +421,7 @@ static eTimeEventDbgTransmit isEventTransmitter(tCanSpamDebugTransmitter *env) {
|
|||
}
|
||||
|
||||
void set_CanDebugSpamTransmitter(tCanSpamDebugTransmitter *env) {
|
||||
if (osMutexAcquire(env->access, 5000) == osOK) {
|
||||
if (osMutexAcquire(env->modelTaskAccess, 5000) == osOK) {
|
||||
memcpy(&ccu_candb_dbg_tx.dbg_Act0, &rtY.dbgCAN_dbg_Act0_model, sizeof(ccu_candb_dbg_tx.dbg_Act0));
|
||||
memcpy(&ccu_candb_dbg_tx.dbg_Act1, &rtY.dbgCAN_dbg_Act1_model, sizeof(ccu_candb_dbg_tx.dbg_Act1));
|
||||
memcpy(&ccu_candb_dbg_tx.dbg_Act2, &rtY.dbgCAN_dbg_Act2_model, sizeof(ccu_candb_dbg_tx.dbg_Act2));
|
||||
|
|
@ -433,9 +435,7 @@ void set_CanDebugSpamTransmitter(tCanSpamDebugTransmitter *env) {
|
|||
memcpy(&ccu_candb_dbg_tx.dbg_Logic_Ac, &rtY.dbg_Logic_Ac_model, sizeof(ccu_candb_dbg_tx.dbg_Logic_Ac));
|
||||
memcpy(&ccu_candb_dbg_tx.dbg_CCU_IO, &rtY.dbgCAN_CCU_IO_model, sizeof(ccu_candb_dbg_tx.dbg_CCU_IO));
|
||||
|
||||
|
||||
|
||||
osMutexRelease(env->access);
|
||||
osMutexRelease(env->modelTaskAccess);
|
||||
} else {
|
||||
LoggerErrorStatic(LOGGER, LOG_SIGN, "Access error set_CanDebugSpamTransmitter");
|
||||
}
|
||||
|
|
@ -444,6 +444,8 @@ void set_CanDebugSpamTransmitter(tCanSpamDebugTransmitter *env) {
|
|||
|
||||
static _Noreturn void CanSpamDebugTransmitter_Thread(tCanSpamDebugTransmitter *env) {
|
||||
for (;;) {
|
||||
set_CanDebugSpamTransmitter(env);
|
||||
|
||||
if (osMutexAcquire(env->access, 5000) == osOK) {
|
||||
|
||||
env->timeMs = GetSystemTick();
|
||||
|
|
@ -456,6 +458,7 @@ static _Noreturn void CanSpamDebugTransmitter_Thread(tCanSpamDebugTransmitter *e
|
|||
} else {
|
||||
LoggerErrorStatic(LOGGER, LOG_SIGN, "Access error CanSpamDebugTransmitter_Thread");
|
||||
}
|
||||
|
||||
SystemDelayMs(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ typedef struct {
|
|||
tSerialPortFrameIO *ioCanFrame;
|
||||
osMutexId_t access;
|
||||
can_rx_message_type canFrame;
|
||||
osMutexId_t modelTaskAccess;
|
||||
|
||||
tCanSpamDebugReceiver *canSpamDebugReceiver;
|
||||
|
||||
|
|
@ -158,6 +159,7 @@ typedef struct {
|
|||
uint8_t dbg_Auto_Duct_MultMsg_Idx;
|
||||
uint8_t dbg_Auto_AF_MultMsg_Idx;
|
||||
|
||||
|
||||
struct {
|
||||
osThreadId_t id;
|
||||
uint32_t stack[384];
|
||||
|
|
@ -169,7 +171,7 @@ typedef struct {
|
|||
|
||||
void
|
||||
CanSpamDebugTransmitter_Init(tCanSpamDebugTransmitter *env, tSerialPortFrameIO *ioCanFrame,
|
||||
tCanSpamDebugReceiver *canSpamDebugReceiver, tLoggerInterface *logger);
|
||||
tCanSpamDebugReceiver *canSpamDebugReceiver, osMutexId_t modelTaskAccess, tLoggerInterface *logger);
|
||||
|
||||
void CanSpamDebugTransmitter_StartThread(tCanSpamDebugTransmitter *env);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue