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
When I first used the library to build my CPPM switcher, I was getting very erratic results. The sync boolean and the channels values were invalid. During troubleshooting, I found that my program would work fine so long as I didn't perform my processing loop (and call CPPM.read) faster than every 40-50 ms (50 was perfect, 40 had a few errors per minute, lower numbers had tons of errors).
I removed the "no interrupts/interrupts" statements around the CPPM.read function. This resolved the problem (at the cost of making the mapping of the channel values non-atomic). After doing this, I changed my program to do the CPPM.read once per millisecond and all was good.
My supposition is that disabling interrupts for a high percentage of the time led to missing some of the timer reads.
I don't need a fix since the two values I want do not need to come from the same frame. But, I thought it would be good to share the issue to aid others who may encounter it.
Thanks for sharing the library. It was very helpful and I appreciate its elegant brevity/simplicity.
The text was updated successfully, but these errors were encountered:
Thanks for the feedback, I'm glad you found it useful! I haven't looked at in years but I suspect you're right, if you're reading frequently then disabling interrupts probably is not the way to go.
When I first used the library to build my CPPM switcher, I was getting very erratic results. The sync boolean and the channels values were invalid. During troubleshooting, I found that my program would work fine so long as I didn't perform my processing loop (and call CPPM.read) faster than every 40-50 ms (50 was perfect, 40 had a few errors per minute, lower numbers had tons of errors).
I removed the "no interrupts/interrupts" statements around the CPPM.read function. This resolved the problem (at the cost of making the mapping of the channel values non-atomic). After doing this, I changed my program to do the CPPM.read once per millisecond and all was good.
My supposition is that disabling interrupts for a high percentage of the time led to missing some of the timer reads.
I don't need a fix since the two values I want do not need to come from the same frame. But, I thought it would be good to share the issue to aid others who may encounter it.
Thanks for sharing the library. It was very helpful and I appreciate its elegant brevity/simplicity.
The text was updated successfully, but these errors were encountered: