42 lines
937 B
C
42 lines
937 B
C
//
|
|
// Created by cfif on 05.05.23.
|
|
//
|
|
#include "MainModesArbiter_Private.h"
|
|
|
|
void Mma_Init(
|
|
tMma *env,
|
|
tGpios *gpios,
|
|
tSerialPorts *serialPorts,
|
|
tRtcs *rtcs
|
|
) {
|
|
env->gpios = gpios;
|
|
env->serialPorts = serialPorts;
|
|
env->rtcs = rtcs;
|
|
|
|
InitThreadAtrStatic(&env->thread.attr, "Mma", env->thread.controlBlock, env->thread.stack, osPriorityNormal);
|
|
env->thread.id = 0;
|
|
}
|
|
|
|
static _Noreturn void Mma_Thread(tMma *env) {
|
|
|
|
// Запуск устройства
|
|
Mma_InitStage(env);
|
|
|
|
for (;;) {
|
|
|
|
GpioPinSet(&env->gpios->Led.ledR, true);
|
|
SystemDelayMs(500);
|
|
GpioPinSet(&env->gpios->Led.ledR, false);
|
|
SystemDelayMs(500);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
void Mma_StartThread(tMma *env) {
|
|
if (!env->thread.id) {
|
|
env->thread.id = osThreadNew((osThreadFunc_t) (Mma_Thread), (void *) (env), &env->thread.attr);
|
|
} else {
|
|
osThreadResume(env->thread.id);
|
|
}
|
|
} |