-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
473 additions
and
26 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
#ifndef POLYBOARD_COLORS_H | ||
#define POLYBOARD_COLORS_H | ||
#ifndef COLORS_H | ||
#define COLORS_H | ||
|
||
// Predefined colors | ||
#define COLOR_BLACK 0x000000 | ||
#define COLOR_WHITE 0xFFFFFF | ||
#define COLOR_MAGENTA 0x9F2B68 | ||
#define COLOR_TEAL 0x008080 | ||
#define COLOR_BLACK 0x000000U | ||
#define COLOR_WHITE 0xFFFFFFU | ||
#define COLOR_RED 0xFF0000U | ||
#define COLOR_GREEN 0x00FF00U | ||
#define COLOR_BLUE 0x0000FFU | ||
#define COLOR_MAGENTA 0x9F2B68U | ||
#define COLOR_TEAL 0x008080U | ||
|
||
#endif // POLYBOARD_COLORS_H | ||
// Shifts to extract color components | ||
#define COLOR_RED_SHIFT 16U | ||
#define COLOR_GREEN_SHIFT 8U | ||
#define COLOR_BLUE_SHIFT 0U | ||
|
||
#endif // COLORS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#include "layout.h" | ||
|
||
void render_layout(const int layout[PAD_COUNT]) { | ||
int r, g, b; | ||
void render_layout(const u32 layout[PAD_COUNT]) { | ||
u8 red = 0; | ||
u8 green = 0; | ||
u8 blue = 0; | ||
|
||
for (int i = 0; i < PAD_COUNT; i++) { | ||
r = (layout[i] & 0xFF0000) >> 16; | ||
g = (layout[i] & 0x00FF00) >> 8; | ||
b = (layout[i] & 0x0000FF); | ||
hal_plot_led(TYPEPAD, PAD_INDEXES[i], r, g, b); | ||
red = (layout[i] & COLOR_RED) >> COLOR_RED_SHIFT; | ||
green = (layout[i] & COLOR_GREEN) >> COLOR_GREEN_SHIFT; | ||
blue = (layout[i] & COLOR_BLUE) >> COLOR_BLUE_SHIFT; | ||
hal_plot_led(TYPEPAD, PAD_INDEXES[i], red, green, blue); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters