Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:dev:tailcontrol-release-notes [2026/09/25 20:32] – darkgrueen:dev:tailcontrol-release-notes [2026/10/23 15:38] (current) – darkgrue
Line 2: Line 2:
  
  
-===== TailControl v5.4.8 =====+===== TailControl v5.4.11 =====
  
 ==== Fixed ==== ==== Fixed ====
   * Removed duplicated line in console banner logo.   * Removed duplicated line in console banner logo.
 +  * **A move command sent while the previous move was homing could be dropped.** At the end of a move, ''taskMovesUpdate()'' decides to home and then calls ''setMove(&SERVO_MOVE_HOME, true)''. A command handled by ''taskTerminal()'' in between replied ''<CMD> BEGIN'' but was immediately overwritten by ''TAILHM''; the tail only went home. The ''vTaskSuspend(tMove)'' in ''setMove()'' didn't stop ''updateMove()'' partway through, and on UART builds (no core affinity) both tasks can run at once. Move state changes are now serialized by a recursive mutex held across ''updateMove()'', ''setMove()'', ''setDSSPMove()'' and ''stopServos()''.
 +  * **Autonomous and No-phone Mode: ''taskMovesUpdate()'' suspended itself** when it started a random move (''setRandMove()'' → ''setMove()'' → ''vTaskSuspend(tMove)'' from the same task). The suspend/resume pair is replaced by the mutex above.
   * **Serial console dropping characters and lines on ESP32-S3 boards (EarGear 2 v4.1, ClawGear v4.1).** The Arduino-ESP32 3.3.7 HW USB CDC driver silently discards up to 64 bytes when ''Serial'' is written from a task running on the other core from its interrupt handler. Its ISR ignores a short FIFO write while ''HWCDC::write()'' commits the FIFO from the calling core. All console output now goes through a single writer task pinned to the ISR core, and application tasks are pinned to ''ARDUINO_RUNNING_CORE'' on USB CDC builds.   * **Serial console dropping characters and lines on ESP32-S3 boards (EarGear 2 v4.1, ClawGear v4.1).** The Arduino-ESP32 3.3.7 HW USB CDC driver silently discards up to 64 bytes when ''Serial'' is written from a task running on the other core from its interrupt handler. Its ISR ignores a short FIFO write while ''HWCDC::write()'' commits the FIFO from the calling core. All console output now goes through a single writer task pinned to the ISR core, and application tasks are pinned to ''ARDUINO_RUNNING_CORE'' on USB CDC builds.
   * **Console lines losing their beginning after brief USB link dropouts.** The HW USB CDC TX buffer is increased from 256 to 2048 bytes (''USB_CDC_TX_BUFFER_SIZE''), which absorbs the periodic 2–6 ms host SOF dropouts instead of evicting queued output.   * **Console lines losing their beginning after brief USB link dropouts.** The HW USB CDC TX buffer is increased from 256 to 2048 bytes (''USB_CDC_TX_BUFFER_SIZE''), which absorbs the periodic 2–6 ms host SOF dropouts instead of evicting queued output.
 +  * **USB Power Delivery negotiation failing intermittently (MiTail, MiTail Mini, FlutterWings; regression since v5.4.1).** The PD library is polled, and it replies to the charger's ''Source_Capabilities'' from inside ''PD_UFP.run()''. The source abandons the negotiation if the ''Request'' doesn't arrive within its 24–30 ms ''SenderResponseTimer''. Since ''0775052'', ''run()'' was called from ''taskBattUpdate()'', which runs every 30 ms, so the reply was often late. The result depended on timing and on the charger: soft or hard resets, or a fallback to 5 V. PD now runs in its own task, woken by the FUSB302 interrupt, and replies within about 3–4 ms.
 +  * **PD: stale power contract after unplugging.** The library kept the previous charger's voltage, "power ready" state and capabilities after a detach. On re-plug this caused a false ''CHARGE COMPLETE'' notification. With a charger slower than 500 ms to reach ''PS_RDY'', the firmware could also act on the previous charger's 12 V reading, enabling fast charging and skipping the 15 V/9 V fallback before the new negotiation finished.
 +  * **PD: the requested voltage was not reset between connections.** After a fallback to 15 V or 9 V, the next attach requested that voltage first instead of 12 V. On detach, the library now restores the power option passed to ''PD_UFP.init()''.
 +  * **PD: unnecessary ''Get_Src_Cap'' sent immediately on attach.** The library's 350 ms ''t_TypeCSinkWaitCap'' timer wasn't restarted on attach, so it requested capabilities before the charger sent them. Some chargers answered with a ''Soft_Reset''.
 +  * **PD: a quick unplug and re-plug (within 500 ms) skipped disconnect handling**, so the fallback state wasn't reset. Disconnects are now handled as soon as they're detected, and the charger is disabled immediately.
   * **ClawGear: Tilt and Clap Mode only responded while a move was running.** The accelerometer servicing condition was inverted. The fix from ''b093b59'' was lost in revert ''6d8cfb6''. Detection now runs while idle and is suspended during moves, when servo motion disturbs the readings.   * **ClawGear: Tilt and Clap Mode only responded while a move was running.** The accelerometer servicing condition was inverted. The fix from ''b093b59'' was lost in revert ''6d8cfb6''. Detection now runs while idle and is suspended during moves, when servo motion disturbs the readings.
   * **ClawGear: uninitialized ''clapModeIsOn'' and ''prevClapModeIsOn''** could cause a spurious or missed ''CLAP ARMED'' edge on startup.   * **ClawGear: uninitialized ''clapModeIsOn'' and ''prevClapModeIsOn''** could cause a spurious or missed ''CLAP ARMED'' edge on startup.
Line 15: Line 22:
 ==== Added ==== ==== Added ====
   * Added ''ARMED'' and ''DISARMED'' console messages to Clap, Listen, and Tilt Modes that now emits correctly on the edge detection of those modes transitioning state.   * Added ''ARMED'' and ''DISARMED'' console messages to Clap, Listen, and Tilt Modes that now emits correctly on the edge detection of those modes transitioning state.
-  * **''Log'' module** (''include/Log.h'', ''src/Log.cpp'') for thread-safe console output:+  * ''Log'' module (''include/Log.h'', ''src/Log.cpp'') for thread-safe console output:
     * Each message is formatted in full and queued as one item. A single writer task performs every ''Serial.write()'', so lines from different tasks can't interleave.     * Each message is formatted in full and queued as one item. A single writer task performs every ''Serial.write()'', so lines from different tasks can't interleave.
     * Uses a 2 KB queue with a static ring buffer, a static writer task and no heap allocation.     * Uses a 2 KB queue with a static ring buffer, a static writer task and no heap allocation.
Line 28: Line 35:
   * The startup banner no longer calls ''Serial.flush()'' between pieces.   * The startup banner no longer calls ''Serial.flush()'' between pieces.
   * Application tasks are created with ''xTaskCreatePinnedToCore(..., RTOS_APP_TASK_CORE)''. The pin applies to USB CDC builds only; UART builds (Flutter, Mini, MiTail) keep no core affinity.   * Application tasks are created with ''xTaskCreatePinnedToCore(..., RTOS_APP_TASK_CORE)''. The pin applies to USB CDC builds only; UART builds (Flutter, Mini, MiTail) keep no core affinity.
 +  * New ''taskPDUpdate()'' task (priority 2, static allocation, created only on hardware with USB PD). It is woken by a falling-edge interrupt on the FUSB302 IRQ line (''PIN_ATTACH''), or every 10 ms to run the library's timers. It also owns all charger control pins; the charge holdoff check moved here from ''taskBattUpdate()''.
 +  * **PD library status output** goes through ''Log.h'' instead of ''PD_UFP.print_status(Serial)'', which wrote to ''Serial'' directly. Output is deferred while FUSB302 events are pending, so it never delays a reply.
 +  * The console stack report includes ''taskPDUpdate()''.
 +  * ''updateMove()'' no longer calls ''logFlush()'' before homing (FDEBUG builds). The log queue already preserves output order. The flush was a leftover from the old ''Serial.flush()'' and delayed homing, and with the new mutex any incoming command, by up to the 1 s flush timeout.
  
 ==== Removed ==== ==== Removed ====
   * **ClawGear:** the unused global ''lpf_s'' instance and its pre-loop seed call. Both were orphaned in ''9f25f3a'' when the classifier got its own filter state.   * **ClawGear:** the unused global ''lpf_s'' instance and its pre-loop seed call. Both were orphaned in ''9f25f3a'' when the classifier got its own filter state.
- 
-==== Internal ==== 
   * Native test mocks: added logger stubs, since ''Definitions.h'' now includes ''Log.h''.   * Native test mocks: added logger stubs, since ''Definitions.h'' now includes ''Log.h''.
   * Fixed warnings in release builds (no ''FDEBUG''): deprecated ''++'' on ''volatile'', an unused static function, and debug-only variables in ''initServos()''.   * Fixed warnings in release builds (no ''FDEBUG''): deprecated ''++'' on ''volatile'', an unused static function, and debug-only variables in ''initServos()''.
 +
 +==== Internal ====
 +  * ''PD_Micro'': added ''apply_init_power_config()''. The ''init()''/''init_PPS()'' configuration is saved and reapplied on detach. On detach the library now also clears the source capabilities, pending request, and wait states.
 +  * Native test mocks: added ''tPD'' and ''RTOS_TASKPDUPD_STACKSIZE''.