cpldcpu/light_ws2812

calculations based on F_CPU do not work

Closed this issue · 4 comments

If I set F_CPU to 8000000UL (8MHz), w1 is calculated as 0 (2-2), w2 as 3 (7-4) and w3 is below zero (10-8-0-3)!
This leads to a veeeeery long low period.
And, even if I set F_CPU to 500000UL (500kHz), I do not get a warning. Code is compiled without error.

Problem solved: F_CPU has to be defined as (e.g) 8000000, not as 8000000uL. The uL (which is needed for me due to code conventions) forces the calculations to be done in integer which leads to false results.