Files
NeoECU-Firmware/STM32/CM7/Core/Src/tasks/cam.c
Hector van der Aa 22c732be02 Refactor handler to external
Moved task handler functions to external functions, signatures are in
tasks.h, each function has its own .c file in Src/tasks
2026-06-02 20:11:07 +02:00

26 lines
738 B
C

// Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
// Copyright (C) 2026 Pierre Barbier <pierrebarbier741@gmail.com>
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "cmsis_os2.h"
#include "main.h"
#include "ring_buffer.h"
#include "tasks.h"
#ifdef DEBUG
#include "SEGGER_RTT.h"
#endif
void camHandler(void *argument) {
for (;;) {
osThreadFlagsWait(0x01, osFlagsWaitAny, osWaitForever);
#ifdef DEBUG
SEGGER_RTT_printf(0, "Cam pulse detected at: %lu\n\r",
ringBufferRead(&state_g.cam_RB, 0));
#endif /* ifdef DEBUG */
if (state_g.sync == SYNC_OK) {
// TODO complete algorithm for scheduling spark
}
}
}