Skip to content

SBUS: fix SBUS_BYTE_TIME_US being 1000x too long - #12110

Open
jlpoltrack wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
jlpoltrack:sbus-byte-time-us-fix
Open

jlpoltrack wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
jlpoltrack:sbus-byte-time-us-fix

Conversation

@jlpoltrack

Copy link
Copy Markdown
Contributor

The macro wrapped a value already in microseconds in MS2US, so the payload pause and SBUS2 resync were 360 ms instead of 360 us, and the short frame sync interval came out negative.

The macro wrapped a value already in microseconds in MS2US, so the
payload pause and SBUS2 resync were 360 ms instead of 360 us, and the
short frame sync interval came out negative.
@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Correct SBUS byte-time calculations to use microseconds

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Remove an erroneous milliseconds-to-microseconds conversion from SBUS byte timing.
• Restore 360 µs pause and resynchronization thresholds and a positive short-frame sync interval.
Diagram

graph TD
  A["SBUS byte timing"] --> B["Pause thresholds"] --> D["Receiver sync"]
  A --> C["Short-frame interval"] --> D
Loading
High-Level Assessment

Correcting the shared macro fixes all three affected calculations at their source. Adjusting individual thresholds would duplicate the correction and leave the unit error in place.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
sbus.hFix SBUS byte-time units +1/-1

Fix SBUS byte-time units

• Removes MS2US from a calculation already expressed in microseconds and parenthesizes the byte-count argument. This restores the intended timing used by receiver pause and sync checks.

src/main/rx/sbus.h

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

RAM / Flash usage vs. base commit e87050f — commit 9380275

Using the nearest available size baseline — the PR's exact base commit has no stored baseline yet.

Target Flash Δ RAM Δ
MATEKF405 +16 B (+0.00%) CCM: ±0 B (±0.00%)
RAM: ±0 B (±0.00%)
MATEKF722 ±0 B (±0.00%) ITCM_RAM: ±0 B (±0.00%)
RAM: ±0 B (±0.00%)
TCM: ±0 B (±0.00%)
MATEKF765 +16 B (+0.00%) DTCM_RAM: ±0 B (±0.00%)
SRAM1: ±0 B (±0.00%)
MATEKH743 +16 B (+0.00%) D2_RAM: ±0 B (±0.00%)
DTCM_RAM: ±0 B (±0.00%)
ITCM_RAM: ±0 B (±0.00%)
RAM: ±0 B (±0.00%)

See RAM/flash optimization guide for techniques to reduce usage.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Test firmware build ready — commit 9380275

Download firmware for PR #12110

251 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

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