From aeead60971801fadc45d282436eb88f18361f0b7 Mon Sep 17 00:00:00 2001 From: cfif Date: Mon, 22 Dec 2025 13:52:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainModesArbiter.c | 24 ++++++++++++++++++++++-- MainModesArbiter.h | 2 ++ PeripheralInterfaces.c | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/MainModesArbiter.c b/MainModesArbiter.c index 0769929..6c48cd7 100644 --- a/MainModesArbiter.c +++ b/MainModesArbiter.c @@ -18,6 +18,7 @@ void Mma_Init( tLinPorts *linPorts, tCanPorts *canPorts, tStorageOnFlash *flash, + tPwms *pwms, tRtcs *rtcs ) { env->gpios = gpios; @@ -27,6 +28,7 @@ void Mma_Init( env->rtcs = rtcs; env->adcs = adcs; env->flash = flash; + env->pwms = pwms; InitThreadAtrStatic(&env->thread.attr, "Mma", env->thread.controlBlock, env->thread.stack, osPriorityNormal); env->thread.id = 0; @@ -48,14 +50,21 @@ static _Noreturn void Mma_Thread(tMma *env) { LoggerInfoStatic(&env->slog.logger, LOG_TASK_ARB, "Wake up from standby") } - SystemDelayMs(1000); +// SystemDelayMs(1000); ModelTask_StartThread(&env->ModelTask); bool isActuatorWorkBusy = false; +// env->pwms->pwmIo.run(env->pwms->pwmIo.env); + for (;;) { + + + + +/* if (osMutexAcquire(env->linTaskActuator0.access, 5000) == osOK) { if (env->linTaskActuator0.busy == 0) { @@ -122,7 +131,18 @@ static _Noreturn void Mma_Thread(tMma *env) { osMutexRelease(env->ModelTask.access); } - SystemDelayMs(100); +*/ + + + + + + + + + + + /* diff --git a/MainModesArbiter.h b/MainModesArbiter.h index 105b1c5..2e45cb2 100644 --- a/MainModesArbiter.h +++ b/MainModesArbiter.h @@ -37,6 +37,7 @@ typedef struct { tCanPorts *canPorts; tLoggerToSerialPort slog; tStorageOnFlash *flash; + tPwms *pwms; tRtcs *rtcs; tAdcs *adcs; @@ -82,6 +83,7 @@ void Mma_Init( tLinPorts *linPorts, tCanPorts *canPorts, tStorageOnFlash *flash, + tPwms *pwms, tRtcs *rtcs ); diff --git a/PeripheralInterfaces.c b/PeripheralInterfaces.c index 6409efe..bb32eda 100644 --- a/PeripheralInterfaces.c +++ b/PeripheralInterfaces.c @@ -21,5 +21,5 @@ void InitPeripheralInterfaces() { Adcs_Init(); Rtcs_Init(); StorageOnFlash_Init(); -// Pwms_Init(); + Pwms_Init(); } \ No newline at end of file