mirror of
https://github.com/esphome/esphome.git
synced 2026-09-03 19:46:02 +00:00
Fix stray quote in main.cpp and scheduler time overflow
- Remove trailing " from AUTO GENERATED INCLUDE BLOCK END comment - Reset scheduler `now` at start of each outer iteration to avoid unbounded growth toward UINT32_MAX across benchmark iterations
This commit is contained in:
@@ -10,7 +10,7 @@ It replaces the default ESPHome main with a benchmark runner.
|
||||
|
||||
// Auto generated code by esphome
|
||||
// ========== AUTO GENERATED INCLUDE BLOCK BEGIN ===========
|
||||
// ========== AUTO GENERATED INCLUDE BLOCK END ==========="
|
||||
// ========== AUTO GENERATED INCLUDE BLOCK END ===========
|
||||
|
||||
void original_setup() {
|
||||
// Code-generated App initialization (pre_setup, area/device registration, etc.)
|
||||
|
||||
@@ -72,10 +72,9 @@ static void Scheduler_Call_5IntervalsFiring(benchmark::State &state) {
|
||||
}
|
||||
scheduler.process_to_add();
|
||||
|
||||
// Start at a known time so intervals are immediately due
|
||||
uint32_t now = millis() + 100;
|
||||
|
||||
for (auto _ : state) {
|
||||
// Reset each outer iteration to avoid unbounded growth toward UINT32_MAX
|
||||
uint32_t now = 100;
|
||||
for (int i = 0; i < kInnerIterations; i++) {
|
||||
scheduler.call(now);
|
||||
// Advance time by 1ms so intervals are due again next call
|
||||
|
||||
Reference in New Issue
Block a user