Обновление
This commit is contained in:
parent
1b1389196c
commit
243b3b49be
45
LinTasks.c
45
LinTasks.c
|
|
@ -578,29 +578,30 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
|
||||
if (env->linCommandActuator[i].COM == LIN_ACT_CFR_MOD) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN, "Sending a command: LIN_ACT_CFR_MOD (ADR = %d MODE = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
env->linCommandActuator[i].MODE)
|
||||
|
||||
#endif
|
||||
ret = CFR_MOD_x(env->linIo, env->linData, env->linCommandActuator[i].BUS_ADR | 0x20,
|
||||
env->linCommandActuator[i].MODE);
|
||||
|
||||
if (ret == LIN_TX_COMPLETED) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN,
|
||||
"Command completed successfully: LIN_ACT_CFR_MOD (ADR = %d MODE = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
env->linCommandActuator[i].MODE)
|
||||
|
||||
#endif
|
||||
if (setState20(env, false, i))
|
||||
break;
|
||||
|
||||
} else {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN, "Command failed [%d]: LIN_ACT_CFR_MOD (ADR = %d MODE = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
env->linCommandActuator[i].MODE)
|
||||
|
||||
#endif
|
||||
if (setState20(env, true, i))
|
||||
break;
|
||||
}
|
||||
|
|
@ -612,29 +613,29 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
for (uint8_t i = 0; i < LIN0_ISSR_ALL; ++i) {
|
||||
|
||||
if (env->linCommandActuator[i].COM == LIN_ACT_CFR_INI) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN, "Sending a command: LIN_ACT_CFR_INI (ADR = %d POS = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
env->linCommandActuator[i].POS)
|
||||
|
||||
#endif
|
||||
ret = CFR_INI_x(env->linIo, env->linData,
|
||||
env->linCommandActuator[i].BUS_ADR | 0x20,
|
||||
env->linCommandActuator[i].POS);
|
||||
|
||||
if (ret == LIN_TX_COMPLETED) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN,
|
||||
"Command completed successfully: LIN_ACT_CFR_INI (ADR = %d POS = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR, env->linCommandActuator[i].POS)
|
||||
|
||||
#endif
|
||||
if (setState20(env, false, i))
|
||||
break;
|
||||
} else {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN, "Command failed: LIN_ACT_CFR_INI (ADR = %d POS = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
env->linCommandActuator[i].POS)
|
||||
|
||||
#endif
|
||||
if (setState20(env, true, i))
|
||||
break;
|
||||
}
|
||||
|
|
@ -646,7 +647,7 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
for (uint8_t i = 0; i < LIN0_ISSR_ALL; ++i) {
|
||||
|
||||
if (env->linCommandActuator[i].COM == LIN_ACT_CFR_SET) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN,
|
||||
"Sending a command: LIN_ACT_CFR_SET (ADR = %d POS = %d STALL= %d LNOISE = %d AUTOS = %d SPEED = %d COILS = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
|
|
@ -657,7 +658,7 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
env->linCommandActuator[i].Speed_SET,
|
||||
env->linCommandActuator[i].Coils_Stop_SET
|
||||
)
|
||||
|
||||
#endif
|
||||
ret = CFR_SET_x(env->linIo, env->linData,
|
||||
env->linCommandActuator[i].BUS_ADR | 0x20,
|
||||
env->linCommandActuator[i].POS,
|
||||
|
|
@ -668,7 +669,7 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
env->linCommandActuator[i].Coils_Stop_SET);
|
||||
|
||||
if (ret == LIN_TX_COMPLETED) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN,
|
||||
"Command completed successfully: LIN_ACT_CFR_SET (ADR = %d POS = %d STALL= %d LNOISE = %d AUTOS = %d SPEED = %d COILS = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
|
|
@ -679,11 +680,11 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
env->linCommandActuator[i].Speed_SET,
|
||||
env->linCommandActuator[i].Coils_Stop_SET
|
||||
)
|
||||
|
||||
#endif
|
||||
if (setState20(env, false, i))
|
||||
break;
|
||||
} else {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN,
|
||||
"Command failed: LIN_ACT_CFR_SET (ADR = %d POS = %d STALL= %d LNOISE = %d AUTOS = %d SPEED = %d COILS = %d)",
|
||||
env->linCommandActuator[i].BUS_ADR,
|
||||
|
|
@ -694,7 +695,7 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
env->linCommandActuator[i].Speed_SET,
|
||||
env->linCommandActuator[i].Coils_Stop_SET
|
||||
)
|
||||
|
||||
#endif
|
||||
if (setState20(env, true, i))
|
||||
break;
|
||||
}
|
||||
|
|
@ -770,7 +771,7 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
(env->linStateActuator[BUS_ADR].Error3_Temperature_Slave != Error3_Temperature_Slave) ||
|
||||
(env->linStateActuator[BUS_ADR].Error4_Permanent_Electrical_Slave !=
|
||||
Error4_Permanent_Electrical_Slave)) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN,
|
||||
"State: ADR = %d CPOS = %d Emrf = %d Mode = %d Err1 = %d Err2 = %d Err3 = %d Err4 = %d",
|
||||
BUS_ADR,
|
||||
|
|
@ -782,7 +783,7 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
Error3_Temperature_Slave,
|
||||
Error4_Permanent_Electrical_Slave
|
||||
)
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
env->linStateActuator[BUS_ADR].CPOS_ALL = CPOS_ALL;
|
||||
|
|
@ -796,11 +797,13 @@ lin_event_id_t Lin0_Scheduler(tLinTaskActuator *env) {
|
|||
if (env->linStateActuator[BUS_ADR].Stall_Slave == LIN_STALL_STA_OFF) {
|
||||
env->linStateActuator[BUS_ADR].Stall_Slave = Stall_Slave;
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
if (Stall_Slave == LIN_STALL_STA_ON) {
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN, "Detect STALL: (ADR = %d POS = %d)",
|
||||
BUS_ADR,
|
||||
CPOS_ALL)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -856,9 +859,9 @@ void resetStall(tLinTaskActuator *env, uint8_t *dataLocalStall) {
|
|||
for (uint8_t i = 0; i < LIN0_ISSR_ALL; ++i) {
|
||||
|
||||
// if (env->linCommandActuator[i].COM == LIN_ACT_CFR_SET) {
|
||||
|
||||
#if (LOG_LIN_ACTUATOR == 1)
|
||||
LoggerInfoStatic(LOGGER, LOG_SIGN, "Reset STALL")
|
||||
|
||||
#endif
|
||||
env->linStateActuator[i].Stall_Slave = LIN_STALL_STA_OFF;
|
||||
dataLocalStall[i] = LIN_STALL_STA_OFF;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include "LinIO.h"
|
||||
#include "LoggerInterface.h"
|
||||
|
||||
#define LOG_LIN_ACTUATOR 0
|
||||
|
||||
typedef struct __attribute__ ((packed)) {
|
||||
uint8_t BUS_ADR;
|
||||
|
|
|
|||
Loading…
Reference in New Issue