How hiteshbhoyar03/flight-controller-v2 works
Flight Controller Rev2 is a simulation-only dual-processor flight-control firmware project. The co-processor acquires sensor data and handles receiver protocols; the main processor receives co-processor data and drives motor outputs. The README also describes persistent configuration, GPS, telemetry, and control-loop capabilities, though telemetry and PID control are in progress. The sampled excerpts show only parts of the runtime, so unsampled capability links are omitted or marked unverified rather than treated as confirmed calls.
Main entry points: Src/main.c Co-processor Loop · Src/main.c Main Processor Loop · DSHOT.c DShot Output · receiver protocols RC Protocol Parsers
Components 16
Processor Runtime
- Co-processor Loop
firmware/CP flight controller rev2/Core/Src/main.c - Main Processor Loop
firmware/MP flight controller rev2/Core/Src/main.c - CP Peripheral Setup
firmware/CP flight controller rev2/Core/Inc/main.h - MP Peripheral Setup
firmware/MP flight controller rev2/Core/Inc/main.h
Sensors And Navigation
- IMU Drivers
firmware/sensors protocol and config/imu - Barometer Drivers
firmware/sensors protocol and config/baro - GNSS Parser
firmware/sensors protocol and config/gps/M9N.c - IMU Filter
firmware/sensors protocol and config/ekf kalman filter/ekf_imu.c
Control And Protocols
- RC Protocol Parsers
firmware/sensors protocol and config/receiver protocols - PID Control
firmware/sensors protocol and config/pid/PID.c - DShot Output
firmware/sensors protocol and config/dshot protocol/DSHOT.c - Motor Configuration
firmware/MP flight controller rev2/Core/Src/DRONE_CONFIG.c
Configuration
- EEPROM Access
firmware/sensors protocol and config/eeprom/EEPROM.c
Other components
- Pilot / RC
- ESCs / Servos
- Ground Station
Connections 16
- Co-processor Loop → CP Peripheral Setup: initializes peripherals
firmware/CP flight controller rev2/Core/Src/main.c - Main Processor Loop → MP Peripheral Setup: initializes peripherals
firmware/MP flight controller rev2/Core/Src/main.c - Co-processor Loop → IMU Drivers: reads sensor data
firmware/CP flight controller rev2/Core/Src/main.c - Co-processor Loop → Barometer Drivers: reads and calculates
firmware/CP flight controller rev2/Core/Src/main.c - Pilot / RC → RC Protocol Parsers: sends RC input
README.md - Co-processor Loop → RC Protocol Parsers: parses receiver frames
- Co-processor Loop → GNSS Parser: parses GNSS
- Co-processor Loop → IMU Filter: filters sensor data
- Co-processor Loop → Main Processor Loop: sends data over UART
README.md - Main Processor Loop → Co-processor Loop: receives data over UART
README.md - Main Processor Loop → PID Control: uses control loops
- Main Processor Loop → DShot Output: sets motor output
firmware/MP flight controller rev2/Core/Src/main.c - Main Processor Loop → Motor Configuration: uses motor config
firmware/MP flight controller rev2/Core/Src/main.c - DShot Output → ESCs / Servos: sends motor commands
README.md - Co-processor Loop → EEPROM Access: persists configuration
README.md - Main Processor Loop → Ground Station: telemetry link
README.md