Conversation
- Root .gitignore for editor configs and source archives - Extend AxxSolder_firmware/.gitignore with build/, .vscode/, .clangd
main.c was 2898 lines mixing peripheral init, ISR dispatchers, sensor
handling, state machine, PID control, display, buttons/encoder,
USB-PD negotiation, and persistent settings. This commit extracts
each subsystem into its own .c/.h pair while preserving the
byte-equivalent runtime behavior of the original.
New modules (Core/Src + Core/Inc):
sensors thermocouple, bus voltage, MCU temp, heater current
ADC sampling and moving-average filters
heater TIM1 PWM, ADC2 current measurement, duty cycle math
handle JBC handle detection (T210/T245/NT115), cartridge
presence, per-handle power limits and PID gains
state_machine RUN/STANDBY/SLEEP/HALTED transitions, emergency
shutdown checks, delta-temperature fault detection
encoder TIM2 quadrature decoding, setpoint write
buttons EXTI press handlers, TIM16 debounce, long/short press
stand stand-sense GPIO debounce and state transitions
settings flash storage of Flash_values struct
telemetry rate-limited UART debug packet transmission
power_source STUSB4500 USB-PD negotiation
display_app main screen render, popups, graph view, uGUI glue
controller PID instance, setpoint update, PID_TUNING hooks
util clamp()
version firmware and hardware version queries
Modified modules:
buzzer extended with beep_at_set_temp and ISR entry points
main.c now contains only the CubeMX-generated peripheral inits, the
USER CODE BEGIN 2 / BEGIN WHILE init sequences (byte-exact firing
order with the original), and thin one-line ISR dispatchers that
route HAL callbacks to the owning modules.
Dead code removed in this pass (verified unused in upstream):
UART_buffer, timer_cleaned, time_to_standby_ms, time_to_sleep_ms,
and the min()/min3() helpers (only call site was inlined).
No behavior changes, no new features. Code organization only.
RAM and FLASH footprint match upstream within rounding.
Refactoring: modularize main.c into per-subsystem source files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.