|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is a target configuration management system for the QUICKSILVER Flight Controller Firmware. It manages hardware target definitions for 500+ FPV flight controller boards, converting Betaflight unified targets to QUICKSILVER-compatible YAML format and generating target indices. |
| 8 | + |
| 9 | +## Development Commands |
| 10 | + |
| 11 | +```bash |
| 12 | +# Convert Betaflight configs to staging targets |
| 13 | +npm run translate |
| 14 | + |
| 15 | +# Build target index and validate configurations |
| 16 | +npx vite-node src/index.ts |
| 17 | + |
| 18 | +# Sync specific fields between staging and production targets |
| 19 | +npx vite-node src/sync.ts |
| 20 | + |
| 21 | +# Install dependencies |
| 22 | +npm install |
| 23 | +``` |
| 24 | + |
| 25 | +## Architecture Overview |
| 26 | + |
| 27 | +**Core Components:** |
| 28 | +- `src/translate.ts` - Converts Betaflight `config.h` files to QUICKSILVER YAML format |
| 29 | +- `src/index.ts` - Processes all target YAML files and generates consolidated indices |
| 30 | +- `src/dma.ts` - Automatically assigns DMA channels and prevents hardware conflicts |
| 31 | +- `src/sync.ts` - Syncs specific fields between staging and production targets |
| 32 | + |
| 33 | +**Directory Structure:** |
| 34 | +- `targets/` - Production target configurations (500+ YAML files) |
| 35 | +- `staging/` - Converted Betaflight targets awaiting validation |
| 36 | +- `betaflight/` - Git submodule with upstream Betaflight configurations |
| 37 | +- `mcu/` - MCU-specific pin and DMA definitions (stm32f405, stm32f411, etc.) |
| 38 | +- `manufacturers.yaml` - Manufacturer database with codes and metadata |
| 39 | + |
| 40 | +**Target Configuration Format:** |
| 41 | +Each target YAML contains hardware definitions: MCU type, pin mappings, serial/SPI ports, gyro configuration, motor outputs, and DMA assignments. Files are validated against `src/schema/target.json`. |
| 42 | + |
| 43 | +**MCU Support:** |
| 44 | +STM32F405/F411/F722/F745/F765/H743, STM32G473, AT32F435 with MCU-specific pin definitions in `mcu/{type}/gpio.yaml` and DMA mappings in `mcu/{type}/dma.yaml`. |
| 45 | + |
| 46 | +**CI/CD Pipeline:** |
| 47 | +Automated builds on master push generate target indices and deploy to the `targets` branch for consumption by QUICKSILVER firmware builds. |
0 commit comments