Skip to content

Conversation

SevenW
Copy link

@SevenW SevenW commented Nov 30, 2020

No description provided.

void mqttLoop() {
if (millis() - mqPingRx > 20*MQ_TIMEOUT) {
printf("*** No MQTT response in %d seconds - resetting\n", (millis()-mqPingRx)/1000);
uint32_t cachemqPingRx = mqPingRx;
Copy link
Author

Choose a reason for hiding this comment

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

The volatile obviously should be used, but did not solve the problem by itself. The additional variable did the trick.

I also tried swapping the millis() and the MqPingRX in the test, but that did not solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant