* Add ESP32 Power Management lessons learned document Documents our experimentation with ESP-IDF DFS and why it doesn't work well for Meshtastic (RTOS locks, BLE locks, USB issues). Proposes simpler alternative: manual setCpuFrequencyMhz() control with explicit triggers for when to go fast vs slow. * Added a lambda function to clear startup output in the MQTT unit test to ensure a clean state before and after the MQTT subscription process.
This commit is contained in:
co-authored by
GitHub
parent
80af726877
commit
8093e2ed5a
+11
-1
@@ -289,13 +289,23 @@ class MQTTUnitTest : public MQTT
|
|||||||
mqtt = unitTest = new MQTTUnitTest();
|
mqtt = unitTest = new MQTTUnitTest();
|
||||||
mqtt->start();
|
mqtt->start();
|
||||||
|
|
||||||
|
auto clearStartupOutput = []() {
|
||||||
|
pubsub->published_.clear();
|
||||||
|
if (mockMeshService != nullptr) {
|
||||||
|
mockMeshService->messages_.clear();
|
||||||
|
mockMeshService->notifications_.clear();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (!moduleConfig.mqtt.enabled || moduleConfig.mqtt.proxy_to_client_enabled || *moduleConfig.mqtt.root) {
|
if (!moduleConfig.mqtt.enabled || moduleConfig.mqtt.proxy_to_client_enabled || *moduleConfig.mqtt.root) {
|
||||||
loopUntil([] { return true; }); // Loop once
|
loopUntil([] { return true; }); // Loop once
|
||||||
|
clearStartupOutput();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Wait for MQTT to subscribe to all topics.
|
// Wait for MQTT to subscribe to all topics.
|
||||||
TEST_ASSERT_TRUE(loopUntil(
|
TEST_ASSERT_TRUE(loopUntil(
|
||||||
[] { return pubsub->subscriptions_.count("msh/2/e/test/+") && pubsub->subscriptions_.count("msh/2/e/PKI/+"); }));
|
[] { return pubsub->subscriptions_.count("msh/2/e/test/+") && pubsub->subscriptions_.count("msh/2/e/PKI/+"); }));
|
||||||
|
clearStartupOutput();
|
||||||
}
|
}
|
||||||
PubSubClient &getPubSub() { return pubSub; }
|
PubSubClient &getPubSub() { return pubSub; }
|
||||||
};
|
};
|
||||||
@@ -930,4 +940,4 @@ void setup()
|
|||||||
UNITY_END();
|
UNITY_END();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
void loop() {}
|
void loop() {}
|
||||||
|
|||||||
Reference in New Issue
Block a user