-
-
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
7 changed files
with
71 additions
and
122 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ name: Build and Test | |
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- v** | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef POLYBOARD_COLORS_H | ||
#define POLYBOARD_COLORS_H | ||
|
||
// Predefined colors | ||
#define COLOR_BLACK 0x000000 | ||
#define COLOR_WHITE 0xFFFFFF | ||
#define COLOR_MAGENTA 0x9F2B68 | ||
#define COLOR_TEAL 0x008080 | ||
|
||
#endif // POLYBOARD_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef POLYBOARD_LAYOUT_H | ||
#define POLYBOARD_LAYOUT_H | ||
|
||
#include "app_defs.h" | ||
#include "app.h" | ||
#include "colors.h" | ||
|
||
// Inner pad indexes | ||
static const u8 PAD_INDEXES[PAD_COUNT] = | ||
{ | ||
11, 12, 13, 14, 15, 16, 17, 18, | ||
21, 22, 23, 24, 25, 26, 27, 28, | ||
31, 32, 33, 34, 35, 36, 37, 38, | ||
41, 42, 43, 44, 45, 46, 47, 48, | ||
51, 52, 53, 54, 55, 56, 57, 58, | ||
61, 62, 63, 64, 65, 66, 67, 68, | ||
71, 72, 73, 74, 75, 76, 77, 78, | ||
81, 82, 83, 84, 85, 86, 87, 88, | ||
}; | ||
|
||
static const int LAYOUT_LOGO[PAD_COUNT] = | ||
{ | ||
COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, | ||
COLOR_WHITE, COLOR_WHITE, COLOR_TEAL, COLOR_TEAL, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, | ||
COLOR_WHITE, COLOR_TEAL, COLOR_WHITE, COLOR_TEAL, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, | ||
COLOR_WHITE, COLOR_TEAL, COLOR_TEAL, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_MAGENTA, COLOR_WHITE, | ||
COLOR_WHITE, COLOR_TEAL, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_MAGENTA, COLOR_MAGENTA, COLOR_WHITE, | ||
COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_MAGENTA, COLOR_WHITE, COLOR_MAGENTA, COLOR_WHITE, | ||
COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_MAGENTA, COLOR_MAGENTA, COLOR_WHITE, COLOR_WHITE, | ||
COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, | ||
}; | ||
|
||
/** | ||
* Renders the layout on the pads. | ||
* | ||
* @param layout The layout to render. | ||
*/ | ||
void render_layout(const int layout[PAD_COUNT]); | ||
|
||
#endif // POLYBOARD_LAYOUT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "layout.h" | ||
|
||
void render_layout(const int layout[PAD_COUNT]) | ||
{ | ||
int r, g, b; | ||
|
||
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); | ||
} | ||
} |