-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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.