Open Makuna opened 1 month ago
Perhaps just size_t
would do when you only need positive numbers.
EDIT: the issue (but that is generic) is that it is only guaranteed to have 16 bits at least. IMO if you do not need maximum range (i.e. INTxx_MAX) in your loops then it may be best to use native size which is (more often than not) int
or unsigned
.
Is your feature request related to a problem? Please describe. WLED developers have found that using a native size type to the uC (ESP32 would be 32 bit) on loops can reduce code size.
Describe the solution you'd like Define a NeoPixelBus wide type like
uintLoop_t
andintLoop_t
(alternate ofuintNative_t
or others?) that then get used throughout NeoPixelBus. They get defined based on the microcontrollers platforms size. (using int and unsigned int?)Additional context This seems to be a bigger issue (using smaller size than the native uC size) for larger chips as they then need to inject code on every increment or test to convert a native register to the size the code defined.