How adam97-1/colorsortercpp works
This is STM32F446 embedded firmware with motor-control and sensor-oriented application modules. Startup configures hardware, then enters the Run application; the declared application components include task management, IR/color detection, and motor control. The motor abstraction combines encoder feedback and PID regulators, while peripheral interfaces have STM32F446-specific implementations. Source excerpts support startup and several hardware layers, but sensor, task, and application implementation details are unsampled, so their internal runtime links are not asserted.
Main entry points: Run.cpp Application runner · Motor.cpp Motor control · main.cpp Firmware entry · stm32f446xx.h STM32F446 definitions
Components 23
Application
- Firmware entry
Src/main.cpp - Hardware configuration
Src/Config/Config.cpp - Application runner
Src/Run.cpp - Task manager
Src/TaskMenager.cpp - Task base
Src/Task.cpp - Color detector
Src/ColorDetector.cpp - IR detector
Src/IrDetector.cpp
Motion Control
- Motor control
Src/Motor.cpp - Encoder feedback
Src/Encoder.cpp - PID regulator
Src/PidRegulator.cpp
Peripheral Drivers
- Clock abstraction
Src/Clock/Clock.cpp - F446 clock driver
Src/Clock/ClockSTMF446.cpp - GPIO abstraction
Src/Gpio/Gpio.cpp - F446 GPIO driver
Src/Gpio/GpioF446.cpp - Timer abstraction
Src/Timer/Timer.cpp - F446 timer driver
Src/Timer/TimerF446.cpp - Flash abstraction
Src/Flash/Flash.cpp - F446 flash driver
Src/Flash/FlashF446.cpp - System tick
Src/SysTickClass.cpp
MCU Platform
- STM32F446 definitions
Device/ST/STM32F4xx/Include/stm32f446xx.h - STM32 system setup
Src/system_stm32f4xx.c - CMSIS core support
Core/Include
Other components
- Firmware startup
Connections 18
- Firmware startup → Firmware entry: starts
Src/main.cpp - Firmware entry → Hardware configuration: configures
Src/main.cpp - Firmware entry → Application runner: executes
Src/main.cpp - Application runner → Task manager: uses
- Application runner → Color detector: uses
- Application runner → IR detector: uses
- Application runner → Motor control: uses
- Motor control → Task base: extends
- Motor control → Encoder feedback: uses
- Motor control → PID regulator: uses
- Encoder feedback → Task base: extends
- Clock abstraction → F446 clock driver: delegates
- GPIO abstraction → F446 GPIO driver: delegates
- Timer abstraction → F446 timer driver: delegates
- F446 clock driver → STM32F446 definitions: accesses registers
Src/Clock/ClockSTMF446.cpp - F446 timer driver → STM32F446 definitions: accesses registers
Src/Timer/TimerF446.cpp - STM32 system setup → STM32F446 definitions: uses definitions
Src/system_stm32f4xx.c - Hardware configuration → STM32 system setup: references setup
Src/Config/Config.cpp