Timeline for Protothread Library Stalling on One Thread
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 15, 2017 at 17:34 | comment | added | Jack Frye | Let us continue this discussion in chat. | |
Sep 15, 2017 at 17:27 | history | edited | 001 | CC BY-SA 3.0 |
edited body
|
Sep 15, 2017 at 17:19 | history | edited | 001 | CC BY-SA 3.0 |
added 71 characters in body
|
Sep 15, 2017 at 17:14 | comment | added | 001 |
Oh, I just noticed that collectAndTransmitData(); should come after PT_WAIT_UNTIL(....) .
|
|
Sep 15, 2017 at 16:18 | comment | added | Jack Frye | it is still just transmitting | |
Sep 15, 2017 at 16:17 | comment | added | Jack Frye | looking at it, i think it is a different source but the same file | |
Sep 15, 2017 at 16:14 | comment | added | Jack Frye | it seems it will only run one thread continuously for a while then switch. I will try your library | |
Sep 15, 2017 at 15:17 | comment | added | 001 |
The timeout for collectAndTransmitData should be whatever your sample rate is. How often do you need to check the sensor? For readAndParseData() I would add if (!Serial.available()) return; as the first line so the function never gets entered unless a message is waiting.
|
|
Sep 15, 2017 at 15:15 | comment | added | 001 | Looks like I had the wrong link. Updated with what appears to be the Arduino port. | |
Sep 15, 2017 at 15:14 | history | edited | 001 | CC BY-SA 3.0 |
added 99 characters in body
|
Sep 15, 2017 at 15:09 | comment | added | Jack Frye | does that lib work with arduino? | |
Sep 15, 2017 at 14:53 | vote | accept | Jack Frye | ||
Sep 15, 2017 at 16:18 | |||||
Sep 15, 2017 at 14:53 | comment | added | Jack Frye | if you had to guess, what would you put on the millisecond argument in loop() to optimize performance for each of the threads? my baud for the serial is 9600, so i think it would make sense to try a 1 on that. Having done so, it looks like it only wants to run that thread. Barely ever touches the other one running at 20 ms | |
Sep 15, 2017 at 13:48 | history | answered | 001 | CC BY-SA 3.0 |