1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00
This commit is contained in:
J. Nick Koston
2025-06-18 14:17:45 +02:00
parent 7b9bd70729
commit ec186e6324
5 changed files with 15 additions and 15 deletions

View File

@@ -67,10 +67,10 @@ void IRAM_ATTR LoopTestISRComponent::simulate_isr_enable() {
this->isr_call_count_++;
// Call enable_loop_soon_from_isr multiple times to test that it's safe
this->enable_loop_soon_from_isr();
this->enable_loop_soon_from_isr(); // Test multiple calls
this->enable_loop_soon_from_isr(); // Should be idempotent
// Call enable_loop_soon_any_context multiple times to test that it's safe
this->enable_loop_soon_any_context();
this->enable_loop_soon_any_context(); // Test multiple calls
this->enable_loop_soon_any_context(); // Should be idempotent
// Note: In a real ISR, we cannot use ESP_LOG* macros as they're not ISR-safe
// For testing, we'll track the call count and log it from the main loop

View File

@@ -14,7 +14,7 @@ class LoopTestISRComponent : public Component {
void setup() override;
void loop() override;
// Simulates an ISR calling enable_loop_soon_from_isr
// Simulates an ISR calling enable_loop_soon_any_context
void simulate_isr_enable();
float get_setup_priority() const override { return setup_priority::DATA; }