Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform/technic_hub: fix LED full brightness when small duty cycle
b22ad15 didn't fully fix this problem. There are still certain duty cycle values that cause the LED to be full brightness. This appears to be a hardware bug where the CxIF interrupt just doesn't fire at at all. We work around this by manually comparing the CNT and CCRx registers just as the timer does internally. Colors might be a bit off at low brightness values, but at least they will now error on the side of being off rather than full brightness. Fixes: pybricks/support#224
- Loading branch information