How prusa3d/prusa-firmware works
Prusa Firmware is the embedded control software for Original Prusa i3 printer variants. Its principal workflow accepts commands from a host or SD card, queues and interprets them, then coordinates motion and thermal control while reporting status through the display or host. Other product capabilities include configuration persistence, bed calibration, filament sensing, power-panic recovery, and optional MMU2 control. The graph reflects the repository tree and README plus sampled excerpts; unsampled implementations are represented only where their module names establish a subsystem, and uncertain links are omitted.
Main entry points: Marlin_main.cpp Firmware loop · ultralcd.cpp LCD interface · cmdqueue.cpp Command queue · host.cpp Host interface
Components 24
Command handling
- Host interface
Firmware/host.cpp - SD print reader
Firmware/cardreader.cpp - Command queue
Firmware/cmdqueue.cpp - Firmware loop
Firmware/Marlin_main.cpp - D-code handlers
Firmware/Dcodes.cpp - T-code handlers
Firmware/Tcodes.cpp
Printer control
- Motion planner
Firmware/planner.cpp - Stepper execution
Firmware/stepper.cpp - Thermal control
Firmware/temperature.cpp
User interfaces
- LCD interface
Firmware/ultralcd.cpp - Printer menus
Firmware/menu.cpp - Localized messages
Firmware/messages.cpp
State and recovery
- Configuration store
Firmware/ConfigurationStore.cpp - EEPROM
Firmware/eeprom.cpp - Bed calibration
Firmware/mesh_bed_calibration.cpp - Power-panic recovery
Firmware/power_panic.cpp
Printer extensions
- Filament sensing
Firmware/Filament_sensor.cpp - MMU2 controller
Firmware/mmu2.cpp - MMU2 protocol
Firmware/mmu2_protocol.cpp
Other components
- Host computer
- SD card
- Printer motors
- Heaters and sensors
- MMU2 unit
Connections 22
- Host computer → Host interface: sends commands
- Host interface → Command queue: enqueues
- SD card → SD print reader: provides print
- SD print reader → Command queue: enqueues
- Command queue → Firmware loop: supplies commands
- Firmware loop → D-code handlers: dispatches
- Firmware loop → T-code handlers: dispatches
- Firmware loop → Motion planner: plans moves
- Motion planner → Stepper execution: sets steps
- Stepper execution → Printer motors: drives
- Firmware loop → Thermal control: manages heating
- Thermal control → Heaters and sensors: controls and reads
- Firmware loop → LCD interface: updates interface
- LCD interface → Printer menus: shows menus
- LCD interface → Localized messages: displays text
- Configuration store → EEPROM: persists settings
- Firmware loop → Bed calibration: runs calibration
- Firmware loop → Power-panic recovery: handles recovery
- Firmware loop → Filament sensing: checks filament
- Firmware loop → MMU2 controller: coordinates
- MMU2 controller → MMU2 protocol: uses protocol
- MMU2 protocol → MMU2 unit: communicates