Fill in the LibSpindle platform callbacks so the spindle commands
(spindle start/stop/status) drive the BTS7960 H-bridge.
- spindleLogic.c: SPINDLE_SetDutyCycle sets the TIM2 compare values,
CH4 (SPINDLE_PWM_R) for forward and CH3 (SPINDLE_PWM_L) for backward,
the inactive channel is set to 0 first. SPINDLE_EnaPWM switches both
half bridges via SPINDLE_ENA_L/R. Both PWM channels are started in
init_spindle_custom before the spindle instance is created.
- main.h: export htim2 so the spindle module can access the timer.
- consoleLogic.c: report CAP_HAS_SPINDLE and CAP_HAS_SPINDLE_STATUS in
the capability command.
- main.c: fix typo in the playground task output.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract the terminal/console logic and the spindle initialisation out of
main.c into dedicated modules so main only wires the components together.
- Add consoleLogic.c/.h: init_console_custom() creates the console
instance, registers the "capability" command and returns the handle.
CapabilityFunc moved here from main.c.
- Add spindleLogic.c/.h: init_spindle_custom(console, maxRPM, minRPM,
absMinRPM) creates the spindle controller with the given RPM limits.
Includes stub platform callbacks (SPINDLE_SetDutyCycle,
SPINDLE_EnaPWM) that still need the PWM/H-bridge implementation.
- main.c: keep console and spindle handles as static variables, pass the
console handle to the spindle module, remove the second playground
task.
- .cproject: add Core/Inc/Console and Core/Inc/Spindle to the include
paths of the CM7 project.
- Include IDE-generated settings changes and the root Eclipse .project.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>