qmk_firmware/drivers
Sergey Vlasov 627ceebef3
ws2812: Fix number of nops for AVR at 8 MHz (#9559)
* ws2812: Fix number of nops for AVR at 8 MHz

When trying to calculate the number of nops for AVR running at 8 MHz,
the value of `w3` is expected to be negative; however, because `F_CPU`
is defined in tmk_core/avr.mk with the `UL` suffix, the preprocessor
performs its calculations using `unsigned long`, getting a very large
positive number instead of the expected negative number; this then
results in generating code with a huge number of nops.  Fix the broken
calculations by performing a comparison before subtraction, so that the
unsigned number wraparound does not occur.

The keyboard which triggers the problem is `handwired/promethium`; the
buggy code silently compiles, but the resulting timings would be
completely wrong.

* ws2812: Clean up the code after the 8 MHz fix

Remove old code which was unsuccessfully trying to clamp negative w1, w2
and w3 values to 0, and set w1_nops, w2_nops and w3_nops directly.
2021-02-09 08:33:04 +11:00
..
avr ws2812: Fix number of nops for AVR at 8 MHz (#9559) 2021-02-09 08:33:04 +11:00
chibios Add BGR byte order for WS2812 drivers (#11562) 2021-01-16 08:42:30 +11:00
eeprom Add i2c 24LC64 eeprom (#11200) 2020-12-14 05:50:50 +11:00
gpio
haptic Ensure single newline at EOF for core files (#11310) 2020-12-28 04:36:32 +11:00
issi Run cformat and dos2unix manually (#11235) 2020-12-17 14:06:30 +00:00
oled
qwiic Normalise include statements in keyboard code (#11185) 2020-12-16 14:27:23 +11:00
ugfx/gdisp Ensure single newline at EOF for core files (#11310) 2020-12-28 04:36:32 +11:00
ws2812.h