Repository navigation
Conversation
Truncating the refill on every update lost up to 1 ms per call, so the budget refilled up to ~40% slower than the configured duty cycle. Fixes meshcore-dev#3988
|
I checked this on a host harness that compiles the real I also checked a millis() rollover, a 6 h idle (still clamps to max_budget), and that the carry stays in [0, 1) over 200k calls with varying intervals. I ran it under ASan/UBSan with nothing reported. Heltec_v3_repeater and RAK_4631_repeater both build. One small difference from the issue's suggestion: the carry isn't zeroed when the budget clamps at max. It's always under 1 ms, so I don't think it matters. Reviewed with Claude (AI); I checked the findings before posting. |
Truncating the refill on every update lost up to 1 ms per call, so the budget refilled up to ~40% slower than the configured duty cycle.
Fixes #3988