Bang & Olufsen support plus higher precision and frequency PWM generation#2074
Bang & Olufsen support plus higher precision and frequency PWM generation#2074danielwallner wants to merge 6 commits intocrankyoldgit:masterfrom
Conversation
|
Might it be worth doing separate PRs for the commits to see that each step is OK? First 2 commits looks good The Cast looks like s bug and should be investigated some more. As you say the consts needs cleanup when using /* */ use separate lines to not modify the existing ones, but if truly unused we should consider removing them if they do not provide any value in some other way. Having different variants between ESP and tests does reduce the reason to have tests? Should/could we consider some other way of dealing with that? |
|
Ok, I'll try to separate this into more than one PR. Yes, the cast definitely looks like a bug. What should I do with the unused constants? I can't think of a way to test the PWM that doesn't include ifdefs with delays inside the PWM loop. Also, I forgot to mention that the calibration no longer does anything but was kept to not break things. There's also an additional test failure on macOS in IRac_test that I didn't look into. |
|
I now what the IRac_test failure is now. |
Bang & Olufsen 455 kHz protocol support with additional improvements to the PWM generation.
Uses fixed point pulse widths for higher precision and polling of micros instead of delay to be able to reach the frequencies required.
On ESP8266 lower than 160 MHz a free running PWM mode was also added to get as close to 455 kHz as possible.
A bonus is that the lower frequencies now are accurate to within a few hertz.
Some additional commits were necessary to be able to run the tests with -Wall -Wextra -Werror on macOS.
The commit that comments unused constants may need a bit of cleanup.
Note that the current test isn't compatible with micros polling and the old code is used for tests.