You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using your DynamicQueue_t class. Testing it in a separate environment ( no wifi, mqtt etc) it works correctly,
Using DynamicQueue_t in a more complex environment I have some problems. I dont know if it a bug in the class or if I am using it in the wring way.
This setup is like this.
Generator task generates mqtt messages that are pushed into the queue. I have removed how payload is generated but basically a counter is updated by 1 every loop. This seems to be working fine according to the log output.
Running this with wifi and mqtt the same message is published multiple times dependent on the line marked ///DELAY.
For me it looks like the line: !queue->empty not is updated directly when reading the queue. ??? Depending on what is happening in rest of the application it is updated or not.....
The queue supposed to work so ???
If so,, how do you use it in the best way....
The text was updated successfully, but these errors were encountered:
For some reason I didn't get a notification for this issue. My apologies.
Did you find the answer?
My gut feeling is that this return should be volatile as it can be effected by multiple cores. Then, followed forward, I would make the empty() call also return a volatile:
Hi (again)
I am using your DynamicQueue_t class. Testing it in a separate environment ( no wifi, mqtt etc) it works correctly,
Using DynamicQueue_t in a more complex environment I have some problems. I dont know if it a bug in the class or if I am using it in the wring way.
This setup is like this.
Generator task generates mqtt messages that are pushed into the queue. I have removed how payload is generated but basically a counter is updated by 1 every loop. This seems to be working fine according to the log output.
Then I have a publisher task reading the queu and publishing data to the Mqtt broker (raspberry pi) using ESP-MQTT client.
Running this with wifi and mqtt the same message is published multiple times dependent on the line marked ///DELAY.
For me it looks like the line: !queue->empty not is updated directly when reading the queue. ??? Depending on what is happening in rest of the application it is updated or not.....
The queue supposed to work so ???
If so,, how do you use it in the best way....
The text was updated successfully, but these errors were encountered: