How ubaldot/defrecs works
DEFRECS is a C framework and example set for real-time embedded control, organized around portable application components and platform-specific adapters. The clearest sampled workflow is the ADC_Readings firmware startup: board initialization calls application_setup(), then FreeRTOS starts and interrupt-triggered deferred tasks process events through the USART2 adapter. The README also documents publish/subscribe application components and platform portability. Source excerpts do not show the application component implementation or its data wiring, so those relationships are documented but not expanded into speculative component-level flows.
Main entry points: Src/main.c ADC firmware entry · application Control components · Src/main.c Hello firmware entry · application_setup.c Application setup
Components 19
Firmware startup
- ADC firmware entry
stm32f4x/ADC_Readings/Core/Src/main.c - FreeRTOS tasks
stm32f4x/ADC_Readings/Core/Src/freertos.c - Hello firmware entry
stm32f4x/Hello_World/Core/Src/main.c
Application layer
- Application setup
stm32f4x/ADC_Readings/application/application_setup.c - Control components
stm32f4x/ADC_Readings/application - Float conversion
stm32f4x/ADC_Readings/utils/ftoa.c - Formatted output
stm32f4x/ADC_Readings/utils/printf-stdarg.c - Hello application setup
stm32f4x/Hello_World/application/application_setup.c
Platform and events
- Deferred event tasks
stm32f4x/ADC_Readings/platform/interrupts_to_tasks.c - USART2 adapter
stm32f4x/ADC_Readings/platform/usart2/usart2.h - Interrupt handlers
stm32f4x/ADC_Readings/Core/Src/stm32f4xx_it.c - Hello deferred tasks
stm32f4x/Hello_World/platform/interrupts_to_tasks.c
Board services
- ADC peripheral
stm32f4x/ADC_Readings/Core/Src/adc.c - DMA service
stm32f4x/ADC_Readings/Core/Src/dma.c - USART service
stm32f4x/ADC_Readings/Core/Src/usart.c - GPIO service
stm32f4x/ADC_Readings/Core/Src/gpio.c - CMSIS PID functions
stm32f4x/ADC_Readings/Drivers/CMSIS/DSP/Source/ControllerFunctions/ControllerFunctions.c - PID API and transforms
stm32f4x/ADC_Readings/Drivers/CMSIS/DSP/Include/dsp/controller_functions.h
Other components
- Board user
Connections 18
- Board user → ADC firmware entry: starts firmware
stm32f4x/ADC_Readings/Core/Src/main.c - ADC firmware entry → GPIO service: initializes GPIO
stm32f4x/ADC_Readings/Core/Src/main.c - ADC firmware entry → DMA service: initializes DMA
stm32f4x/ADC_Readings/Core/Src/main.c - ADC firmware entry → USART service: initializes UART
stm32f4x/ADC_Readings/Core/Src/main.c - ADC firmware entry → ADC peripheral: initializes ADC
stm32f4x/ADC_Readings/Core/Src/main.c - ADC firmware entry → Application setup: calls setup
stm32f4x/ADC_Readings/Core/Src/main.c - ADC firmware entry → FreeRTOS tasks: starts scheduler
stm32f4x/ADC_Readings/Core/Src/main.c - Deferred event tasks → USART2 adapter: dispatches event
stm32f4x/ADC_Readings/platform/interrupts_to_tasks.c - Interrupt handlers → Deferred event tasks: notifies tasks
- Application setup → Control components: configures
- Control components → CMSIS PID functions: may use
- CMSIS PID functions → PID API and transforms: implements
- Board user → Hello firmware entry: starts firmware
stm32f4x/Hello_World/Core/Src/main.c - Hello firmware entry → Hello application setup: calls setup
stm32f4x/Hello_World/Core/Src/main.c - Hello firmware entry → Hello deferred tasks: starts scheduler
- Hello deferred tasks → USART2 adapter: uses adapter
- Control components → Float conversion: may use
- Control components → Formatted output: may use