Moved task handler functions to external functions, signatures are in tasks.h, each function has its own .c file in Src/tasks
26 lines
744 B
C
26 lines
744 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 crankHandler(void *argument) {
|
|
for (;;) {
|
|
osThreadFlagsWait(0x01, osFlagsWaitAny, osWaitForever);
|
|
#ifdef DEBUG
|
|
SEGGER_RTT_printf(0, "Crank pulse detected at: %lu\n\r",
|
|
ringBufferRead(&state_g.crank_RB, 0));
|
|
#endif /* ifdef DEBUG */
|
|
if (state_g.sync == SYNC_OK) {
|
|
// TODO complete algorithm for scheduling spark
|
|
}
|
|
}
|
|
}
|