Skip to content

Align UART/GPS period handling with seconds - #1050

Open
tyeth wants to merge 1 commit into
migrate-api-v2from
claude/github-issue-1012-a95c94
Open

tyeth wants to merge 1 commit into
migrate-api-v2from
claude/github-issue-1012-a95c94

Conversation

@tyeth

@tyeth tyeth commented Oct 27, 2026

Copy link
Copy Markdown
Member

Fixes #1012

Wippersnapper_Protobuf#223 changed the documented unit of the UART (GenericInputConfig.period, PM25AQIConfig.period) and GPS (Config.period) period fields from milliseconds to seconds.

The generated wrappers in src/protos already say seconds, and both components already multiplied by 1000 on receipt, so runtime behaviour was effectively correct. This tidies the remaining mismatches:

  • GPSHardware::SetPollPeriod now takes the uint32_t seconds field directly and converts to ms with integer math, clamping instead of overflowing. This replaces float math behind a poll_period < 0 check that was always false on an unsigned type.
  • Fixed the GPS doc comments that described the input as milliseconds.
  • Fixed the SetSensorPeriodPrv doc in drvUartBase.h, which claimed it converts seconds to ms. It stores a millis() timestamp.

Not built locally; relying on CI for build and lint.

🤖 Generated with Claude Code

The api-v2 protos now document UART GenericInputConfig/PM25AQIConfig
and GPS Config period as seconds. GPS SetPollPeriod now takes the
uint32 seconds field directly and converts to ms with integer math
(clamping on overflow) instead of float math behind a dead unsigned
< 0 check. Fix stale ms docs on the UART/GPS period members.

Fixes #1012

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tyeth tyeth self-assigned this Oct 27, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

feather_esp32

  • iram0_2_seg: .flash.text +8 B (+0.0%, 1,261,440 B / 3,342,304 B, total: 38% used)

feather_esp32s3

  • iram0_2_seg: .flash.text +8 B (+0.0%, 1,272,976 B / 8,388,576 B, total: 15% used)

huzzah_esp8266

  • irom0_0_seg: .irom0.text -16 B (-0.0%, 731,512 B / 1,044,464 B, total: 70% used)

pico_2w

  • FLASH: .text -8 B (-0.0%, 913,536 B / 3,665,920 B, total: 25% used)

qtpy_esp32c3

  • drom0_0_seg: .eh_frame -16 B (-0.0%, 1,927,563 B / 8,388,576 B, total: 23% used)
  • iram0_2_seg: .flash.text -26 B (-0.0%, 1,398,216 B / 8,388,576 B, total: 17% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@tyeth tyeth left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Test this. Seems to highlight the need for mS still in uartBase

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants