Skip to content

Cleanup - #753

Merged
doudar merged 5 commits into
developfrom
cleanup
Aug 21, 2026
Merged

Cleanup#753
doudar merged 5 commits into
developfrom
cleanup

Conversation

@doudar

@doudar doudar commented Aug 20, 2026

Copy link
Copy Markdown
Owner

See Commits.

@doudar
doudar requested a review from eMadman August 20, 2026 17:06
@doudar

doudar commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a460d31175

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/BLE_Fitness_Machine_Service.cpp Outdated
int logBufLength = ss2k_log_hex_to_buffer(pData, length, logBuf, 0, kLogBufCapacity);
int port = 0;

ergMode->onFTMSCommand(static_cast<uint8_t>(rxValue[0]));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve pending ERG recovery across StartOrResume

Calling onFTMSCommand() for every opcode causes StartOrResume to clear resumeErgOnCadence, even though that command only updates training/status state and does not select another control mode. If an app sends Start/Resume while the rider is still below the cadence threshold, subsequent cadence recovery leaves the trainer in simulation mode instead of restoring the latest ERG target; restrict cancellation to commands that actually change the control mode, or explicitly re-arm recovery on Start/Resume.

AGENTS.md reference: AGENTS.md:L300-L307

Useful? React with 👍 / 👎.

Comment thread src/ERG_Mode.cpp Outdated
doudar added 2 commits August 21, 2026 12:20
…e and update related logging; adjust minimum cadence threshold.
@doudar

doudar commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71ceed871e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ERG_Mode.cpp
}

if (rtConfig->cad.getValue()) {
if (rtConfig->cad.getValue() > MIN_ERG_CADENCE / 2) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Command lower resistance before filtering stopped cadence

When a cadence sensor reports 0–10 RPM at a stop, this gate skips computeErg(), so the new fallback changes only watts.target and never updates targetIncline; the stepper therefore remains at the previous high-load position. If the first resumed sample is already above 20 RPM, lines 87–90 restore the old watt target before any low-load position is commanded, leaving the rider in the ERG “black hole” this change is intended to prevent. Apply the low-cadence position adjustment even for stopped-cadence samples rather than limiting it to the 11–19 RPM window.

AGENTS.md reference: AGENTS.md:L405-L412

Useful? React with 👍 / 👎.

Comment thread src/ERG_Mode.cpp
if (rtConfig->getFTMSMode() == FitnessMachineControlPointProcedure::SetTargetPower && rtConfig->cad.getValue() <= MIN_ERG_CADENCE) {
if (rtConfig->watts.getTarget() != userConfig->getMinWatts()) {
SS2K_LOG(ERG_MODE_LOG_TAG, "Cadence below ERG minimum; lowering target to %dw", userConfig->getMinWatts());
lastSetPoint = rtConfig->watts.getTarget();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the deferred ERG target across low-cadence shifts

When the rider shifts while cadence is below the threshold, FTMSModeShiftModifier() applies the shift to the temporary minimum target; on the next loop this assignment replaces the original saved setpoint. For example, a 200 W target falls back to 50 W, one shift raises the public target to 60 W, and this stores 60 W so recovery resumes at 60 W rather than the expected 210 W. Low-cadence ERG shifts need to update the deferred target instead of overwriting it from the temporary fallback value.

AGENTS.md reference: AGENTS.md:L558-L564

Useful? React with 👍 / 👎.

@doudar
doudar merged commit dabfd7e into develop Aug 21, 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.

1 participant