Skip to content

Dev#173

Merged
AxxAxx merged 12 commits into
mainfrom
dev
Jun 9, 2026
Merged

Dev#173
AxxAxx merged 12 commits into
mainfrom
dev

Conversation

@AxxAxx

@AxxAxx AxxAxx commented Jun 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

ENA526 and others added 12 commits May 24, 2026 01:53
- 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
@AxxAxx AxxAxx merged commit b27a641 into main Jun 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants