Обновление

This commit is contained in:
cfif 2025-12-09 17:09:13 +03:00
parent 7fe69dc846
commit 7f2d395b67
2 changed files with 8 additions and 12 deletions

View File

@ -12,8 +12,7 @@
typedef struct {
tSerialPortIO *serialPortIo_IN_VIRT;
tSerialPortIO *serialPortIo_OUT_VIRT;
tSerialPortIO *serialPortIo_VIRT;
tSerialPortIO *serialPortIo_PHYSIC;
tRtcIO *rtc;
uint32_t timeout;
@ -41,8 +40,7 @@ typedef struct {
void LoggerToSerialPort_Init(
tLoggerToSerialPort *env,
int32_t greenwichOffset,
tSerialPortIO *serialPortIo_IN_VIRT,
tSerialPortIO *serialPortIo_OUT_VIRT,
tSerialPortIO *serialPortIo_VIRT,
tSerialPortIO *serialPortIo_PHYSIC,
tRtcIO *rtc,
uint16_t flags,

View File

@ -71,7 +71,7 @@ static void LoggerToSerialPort_PrintLegend(
if (env->flags)
vAsciiStringAdd(str, &strLen, ": ", 2);
SerialPortTransmit(env->serialPortIo_IN_VIRT, (uint8_t *) str, strLen, env->timeout);
SerialPortTransmit(env->serialPortIo_VIRT, (uint8_t *) str, strLen, env->timeout);
env->open = true;
}
@ -99,11 +99,11 @@ static void LoggerToSerialPort_Logging(
}
//выводим сообщение
SerialPortTransmit(env->serialPortIo_IN_VIRT, (uint8_t *) msg, msgLen, env->timeout);
SerialPortTransmit(env->serialPortIo_VIRT, (uint8_t *) msg, msgLen, env->timeout);
if (complete) {
//переводим строку
SerialPortTransmit(env->serialPortIo_IN_VIRT, (uint8_t *) "\r\n", 2, env->timeout);
SerialPortTransmit(env->serialPortIo_VIRT, (uint8_t *) "\r\n", 2, env->timeout);
env->open = false;
} else {
env->open = true;
@ -116,15 +116,13 @@ static void LoggerToSerialPort_Logging(
void LoggerToSerialPort_Init(
tLoggerToSerialPort *env,
int32_t greenwichOffset,
tSerialPortIO *serialPortIo_IN_VIRT,
tSerialPortIO *serialPortIo_OUT_VIRT,
tSerialPortIO *serialPortIo_VIRT,
tSerialPortIO *serialPortIo_PHYSIC,
tRtcIO *rtc,
uint16_t flags,
uint32_t timeoutTransmittedLog
) {
env->serialPortIo_IN_VIRT = serialPortIo_IN_VIRT;
env->serialPortIo_OUT_VIRT = serialPortIo_OUT_VIRT;
env->serialPortIo_VIRT = serialPortIo_VIRT;
env->serialPortIo_PHYSIC = serialPortIo_PHYSIC;
env->open = false;
env->timeout = 0;// не ждем на каждой операции так как если порт исправен то все должно отрабатывать моментально
@ -149,7 +147,7 @@ extern uint8_t buf_USART2_TRANSMITTED[256];
static _Noreturn void LogTransmitter_Thread(tLoggerToSerialPort *env) {
for (;;) {
uint16_t len = env->serialPortIo_OUT_VIRT->receive(env->serialPortIo_OUT_VIRT->env, buf_USART2_TRANSMITTED,
uint16_t len = env->serialPortIo_VIRT->receive(env->serialPortIo_VIRT->env, buf_USART2_TRANSMITTED,
sizeof(buf_USART2_TRANSMITTED), env->timeoutTransmittedLog);
if (len > 0) {