Fix IS31FL3741 pin mapping macro
This commit is contained in:
parent
f31efdab48
commit
4ca67aa967
1 changed files with 5 additions and 5 deletions
|
@ -5,12 +5,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a 39x9 matrix cell index to the appropriate IS31FL3741 register indexes.
|
* Maps a 39x9 matrix cell index to a 1D array matching IS31FL3741's PWM registers order.
|
||||||
*/
|
*/
|
||||||
#define PIXEL(n) ( \
|
#define PIXEL(n) ( \
|
||||||
((0 <= ((n) % 39)) && (((n) % 39) < 30)) \
|
(((n) % 39) < 30) \
|
||||||
? ((((n) / 39) * 30) + ((n) % 39)) \
|
? ((((n) / 39) * 30) + ((n) % 39)) \
|
||||||
: (210 + (((n) / 39) * 9) + (((n) % 39) - 31)))
|
: (270 + (((n) / 39) * 9) + ((n) % 39) - 30))
|
||||||
|
|
||||||
#define RGB(com, r, g, b) PIXEL(com + r) PIXEL(com + g) PIXEL(com + b)
|
#define RGB(com, r, g, b) PIXEL(com + r) PIXEL(com + g) PIXEL(com + b)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue