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
This commit is contained in:
25
STM32/CM7/Core/Src/tasks/crank.c
Normal file
25
STM32/CM7/Core/Src/tasks/crank.c
Normal file
@@ -0,0 +1,25 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user