Skip to content

Commit 8c4da1c

Browse files
committed
Add BrainPad logo from Greg
1 parent bfa3020 commit 8c4da1c

File tree

4 files changed

+142
-73
lines changed

4 files changed

+142
-73
lines changed

boards/brainpad_arcade/board.h

Lines changed: 122 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,77 +8,134 @@
88
#define BOARD_FLASH_SIZE (512 * 1024)
99
#define BOARD_ID "STM32F401-BrainPad-Arcade-RevA"
1010

11-
1211
#ifdef DEFINE_CONFIGDATA
1312
__attribute__((section(".config"))) __attribute__((used)) //
1413
const uint32_t configData[] = {
1514
/* CF2 START */
16-
513675505, 539130489, // magic
17-
58, 100, // used entries, total entries
18-
1, 0x2e, // PIN_ACCELEROMETER_INT = PC14
19-
2, 0x16, // PIN_ACCELEROMETER_SCL = PIN_SCL
20-
3, 0x17, // PIN_ACCELEROMETER_SDA = PIN_SDA
21-
4, 0x11, // PIN_BTN_A = PB01
22-
5, 0x10, // PIN_BTN_B = PB00
23-
13, 0x29, // PIN_LED = PC09
24-
18, 0x14, // PIN_MISO = PB04
25-
19, 0x15, // PIN_MOSI = PB05
26-
21, 0x3, // PIN_RX = PA03
27-
23, 0x13, // PIN_SCK = PB03
28-
24, 0x16, // PIN_SCL = PB06
29-
25, 0x17, // PIN_SDA = PB07
30-
28, 0x2, // PIN_TX = PA02
31-
32, 0x1d, // PIN_DISPLAY_SCK = PB13
32-
33, 0x1e, // PIN_DISPLAY_MISO = PB14
33-
34, 0x1f, // PIN_DISPLAY_MOSI = PB15
34-
35, 0x1c, // PIN_DISPLAY_CS = PB12
35-
36, 0x25, // PIN_DISPLAY_DC = PC05
36-
37, 0xa0, // DISPLAY_WIDTH = 160
37-
38, 0x80, // DISPLAY_HEIGHT = 128
38-
39, 0x80, // DISPLAY_CFG0 = 0x80
39-
40, 0x603, // DISPLAY_CFG1 = 0x603
40-
41, 0x16, // DISPLAY_CFG2 = 0x16
41-
43, 0x24, // PIN_DISPLAY_RST = PC04
42-
44, 0x27, // PIN_DISPLAY_BL = PC07
43-
45, 0x1, // PIN_SERVO_1 = PA01
44-
46, 0x0, // PIN_SERVO_2 = PA00
45-
47, 0xf, // PIN_BTN_LEFT = PA15
46-
48, 0x2d, // PIN_BTN_RIGHT = PC13
47-
49, 0x5, // PIN_BTN_UP = PA05
48-
50, 0x1a, // PIN_BTN_DOWN = PB10
49-
51, 0x2a, // PIN_BTN_MENU = PC10
50-
55, 0x28, // PIN_LED1 = PC08
51-
59, 0x100, // SPEAKER_VOLUME = 256
52-
60, 0x9, // PIN_JACK_TX = PA09
53-
61, 0x6, // PIN_JACK_SENSE = PA06
54-
62, 0x4, // PIN_JACK_HPEN = PA04
55-
63, 0xa, // PIN_JACK_BZEN = PA10
56-
64, 0x7, // PIN_JACK_PWREN = PA07
57-
65, 0x8, // PIN_JACK_SND = PA08
58-
66, 0x28, // PIN_JACK_BUSLED = PC08
59-
67, 0x29, // PIN_JACK_COMMLED = PC09
60-
70, 0x38, // ACCELEROMETER_TYPE = MMA8453
61-
74, 0x12, // PIN_BTN_MENU2 = PB02
62-
151, 0x2, // PIN_D1 = PA02
63-
152, 0x3, // PIN_D2 = PA03
64-
153, 0x13, // PIN_D3 = PB03
65-
154, 0x14, // PIN_D4 = PB04
66-
155, 0x15, // PIN_D5 = PB05
67-
156, 0x16, // PIN_D6 = PB06
68-
157, 0x17, // PIN_D7 = PB07
69-
204, 0x80000, // FLASH_BYTES = 0x80000
70-
205, 0x18000, // RAM_BYTES = 0x18000
71-
208, 0x16e42d61, // BOOTLOADER_BOARD_ID = 0x16e42d61
72-
209, 0x57755a57, // UF2_FAMILY = STM32F401
73-
210, 0x10, // PINS_PORT_SIZE = PA_16
74-
211, 0x1, // BOOTLOADER_PROTECTION = 1
75-
212, 0x78, // POWER_DEEPSLEEP_TIMEOUT = 120
76-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
77-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
78-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
15+
513675505, 539130489, // magic
16+
58, 100, // used entries, total entries
17+
1, 0x2e, // PIN_ACCELEROMETER_INT = PC14
18+
2, 0x16, // PIN_ACCELEROMETER_SCL = PIN_SCL
19+
3, 0x17, // PIN_ACCELEROMETER_SDA = PIN_SDA
20+
4, 0x11, // PIN_BTN_A = PB01
21+
5, 0x10, // PIN_BTN_B = PB00
22+
13, 0x29, // PIN_LED = PC09
23+
18, 0x14, // PIN_MISO = PB04
24+
19, 0x15, // PIN_MOSI = PB05
25+
21, 0x3, // PIN_RX = PA03
26+
23, 0x13, // PIN_SCK = PB03
27+
24, 0x16, // PIN_SCL = PB06
28+
25, 0x17, // PIN_SDA = PB07
29+
28, 0x2, // PIN_TX = PA02
30+
32, 0x1d, // PIN_DISPLAY_SCK = PB13
31+
33, 0x1e, // PIN_DISPLAY_MISO = PB14
32+
34, 0x1f, // PIN_DISPLAY_MOSI = PB15
33+
35, 0x1c, // PIN_DISPLAY_CS = PB12
34+
36, 0x25, // PIN_DISPLAY_DC = PC05
35+
37, 0xa0, // DISPLAY_WIDTH = 160
36+
38, 0x80, // DISPLAY_HEIGHT = 128
37+
39, 0x80, // DISPLAY_CFG0 = 0x80
38+
40, 0x603, // DISPLAY_CFG1 = 0x603
39+
41, 0x16, // DISPLAY_CFG2 = 0x16
40+
43, 0x24, // PIN_DISPLAY_RST = PC04
41+
44, 0x27, // PIN_DISPLAY_BL = PC07
42+
45, 0x1, // PIN_SERVO_1 = PA01
43+
46, 0x0, // PIN_SERVO_2 = PA00
44+
47, 0xf, // PIN_BTN_LEFT = PA15
45+
48, 0x2d, // PIN_BTN_RIGHT = PC13
46+
49, 0x5, // PIN_BTN_UP = PA05
47+
50, 0x1a, // PIN_BTN_DOWN = PB10
48+
51, 0x2a, // PIN_BTN_MENU = PC10
49+
55, 0x28, // PIN_LED1 = PC08
50+
59, 0x100, // SPEAKER_VOLUME = 256
51+
60, 0x9, // PIN_JACK_TX = PA09
52+
61, 0x6, // PIN_JACK_SENSE = PA06
53+
62, 0x4, // PIN_JACK_HPEN = PA04
54+
63, 0xa, // PIN_JACK_BZEN = PA10
55+
64, 0x7, // PIN_JACK_PWREN = PA07
56+
65, 0x8, // PIN_JACK_SND = PA08
57+
66, 0x28, // PIN_JACK_BUSLED = PC08
58+
67, 0x29, // PIN_JACK_COMMLED = PC09
59+
70, 0x38, // ACCELEROMETER_TYPE = MMA8453
60+
74, 0x12, // PIN_BTN_MENU2 = PB02
61+
151, 0x2, // PIN_D1 = PA02
62+
152, 0x3, // PIN_D2 = PA03
63+
153, 0x13, // PIN_D3 = PB03
64+
154, 0x14, // PIN_D4 = PB04
65+
155, 0x15, // PIN_D5 = PB05
66+
156, 0x16, // PIN_D6 = PB06
67+
157, 0x17, // PIN_D7 = PB07
68+
204, 0x80000, // FLASH_BYTES = 0x80000
69+
205, 0x18000, // RAM_BYTES = 0x18000
70+
208, 0x16e42d61, // BOOTLOADER_BOARD_ID = 0x16e42d61
71+
209, 0x57755a57, // UF2_FAMILY = STM32F401
72+
210, 0x10, // PINS_PORT_SIZE = PA_16
73+
211, 0x1, // BOOTLOADER_PROTECTION = 1
74+
212, 0x78, // POWER_DEEPSLEEP_TIMEOUT = 120
75+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
76+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
77+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
78+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7979
/* CF2 END */
8080
};
8181
#endif
8282

83-
#endif /* BOARD_H */
83+
#ifdef DEFINE_CUSTOM_LOGO
84+
const uint8_t brain_A0[] = {32, 32, 60, 191, 182, 31, 152, 200, 151, 202, 149, 204, 143,
85+
209, 142, 210, 141, 211, 141, 211, 139, 214, 137, 215, 136, 216,
86+
136, 216, 135, 217, 64, 217, 64, 217, 96, 217, 96, 218, 120,
87+
217, 124, 217, 124, 217, 124, 217, 124, 217, 124, 216, 120, 217,
88+
124, 217, 124, 217, 124, 217, 124, 217, 120, 217, 0};
89+
90+
const uint8_t brain_A1[] = {
91+
32, 32, 108, 191, 191, 153, 7, 151, 63, 152, 200, 151, 202, 148, 204, 144, 206, 145, 1,
92+
120, 3, 139, 1, 135, 7, 139, 49, 135, 15, 136, 13, 99, 120, 139, 15, 96, 120, 139,
93+
31, 138, 15, 64, 63, 138, 31, 135, 201, 4, 62, 136, 63, 199, 112, 1, 112, 19, 124,
94+
94, 1, 60, 31, 79, 31, 88, 201, 136, 63, 56, 118, 15, 96, 7, 31, 126, 1, 120,
95+
96, 107, 63, 126, 15, 28, 123, 115, 95, 64, 59, 62, 76, 13, 16, 79, 71, 65, 97,
96+
108, 3, 120, 25, 76, 121, 205, 6, 123, 126, 206, 135, 95, 63, 66, 7};
97+
98+
const uint8_t brain_B0[] = {32, 32, 60, 126, 216, 124, 218, 126, 217, 126, 217, 126, 216,
99+
124, 217, 124, 217, 120, 218, 124, 217, 124, 217, 124, 217, 124,
100+
217, 124, 217, 124, 216, 112, 217, 112, 217, 96, 217, 136, 216,
101+
137, 215, 137, 215, 137, 214, 138, 213, 140, 212, 142, 210, 147,
102+
205, 149, 203, 150, 201, 152, 199, 154, 31, 191, 165};
103+
104+
const uint8_t brain_B1[] = {
105+
32, 32, 111, 112, 31, 79, 96, 64, 126, 121, 104, 108, 104, 79, 79, 77, 15, 125, 125,
106+
89, 125, 17, 79, 31, 64, 15, 118, 125, 7, 112, 64, 76, 55, 136, 3, 137, 31, 3,
107+
62, 96, 112, 206, 14, 30, 30, 115, 119, 97, 111, 33, 135, 31, 124, 25, 4, 112, 67,
108+
63, 103, 135, 31, 112, 109, 202, 62, 96, 89, 203, 62, 64, 125, 203, 62, 137, 202, 135,
109+
31, 137, 63, 3, 124, 139, 63, 7, 120, 140, 79, 113, 27, 138, 81, 99, 31, 139, 31,
110+
3, 28, 141, 111, 1, 7, 145, 203, 151, 201, 152, 199, 153, 63, 155, 7, 191, 191, 0};
111+
112+
const uint8_t pad0[] = {32, 31, 63, 140, 206, 145, 206, 145, 206, 145, 206, 145, 206, 145,
113+
201, 150, 201, 151, 200, 152, 63, 153, 95, 7, 147, 201, 149, 202,
114+
149, 202, 149, 202, 149, 202, 149, 202, 149, 202, 149, 202, 150, 201,
115+
151, 200, 151, 200, 150, 201, 150, 201, 150, 201, 150, 201, 145, 206,
116+
145, 206, 145, 206, 145, 206, 145, 206, 191, 0};
117+
118+
const uint8_t pad1[] = {32, 31, 59, 172, 204, 147, 204, 147, 99, 31, 145, 99, 152,
119+
99, 152, 199, 153, 31, 153, 15, 190, 3, 148, 123, 151, 119,
120+
1, 145, 19, 1, 145, 17, 1, 145, 19, 1, 145, 200, 152,
121+
63, 153, 63, 184, 15, 151, 63, 151, 199, 152, 99, 152, 99,
122+
152, 99, 147, 203, 148, 204, 147, 204, 191, 164};
84123

124+
const uint8_t tm[] = {16, 16, 21, 179, 1, 137, 1, 137, 15, 137, 1, 137,
125+
1, 153, 15, 138, 1, 138, 1, 136, 1, 136, 15, 166};
126+
127+
static void customLogo() {
128+
printicon(2, 10, 15, brain_A0);
129+
printicon(2, 10, 3, brain_A1);
130+
printicon(34, 10, 15, brain_B0);
131+
printicon(34, 10, 3, brain_B1);
132+
printicon(65, 9, 15, pad0);
133+
printicon(65, 9, 1, pad1);
134+
printicon(93, 18, 15, tm);
135+
}
136+
137+
#define CUSTOM_LOGO customLogo()
138+
139+
#endif
140+
141+
#endif /* BOARD_H */

images.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ const uint8_t arrowLogo[] = {
2424
32, 32, 54, 137, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 151, 201, 146, 211, 142, 209, 144, 207, 146, 205, 148, 203, 150, 201, 152, 199, 154, 31, 154, 7, 154, 1, 191, 191, 191, 175
2525
};
2626

27-
// https://makecode.com/_HTiagjK9wE1W
28-
const uint8_t ghiLogo[] = {
29-
32, 32, 98, 142, 3, 152, 9, 152, 33, 153, 33, 153, 63, 1, 145, 199, 14, 144, 202, 30, 142, 204, 30, 140, 205, 62, 140, 31, 120, 30, 138, 95, 111, 125, 139, 95, 109, 125, 138, 63, 91, 123, 3, 112, 63, 124, 62, 136, 209, 62, 135, 199, 135, 111, 15, 96, 199,
30-
126, 125, 137, 201, 126, 126, 137, 63, 64, 123, 3, 96, 205, 62, 138, 31, 96, 125, 140, 205, 62, 140, 205, 62, 141, 203, 60, 143, 202, 30, 145, 199, 14, 146, 113, 2, 146, 97, 154, 17, 154, 7, 191, 141
31-
};
32-
3327
const uint8_t font8[] = {
3428
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3529
0x00, 0x00, 0x5e, 0x00, 0x00, 0x00,

screen.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44

55
#include <string.h>
66

7+
void printicon(int x, int y, int col, const uint8_t *icon);
8+
#define DEFINE_CUSTOM_LOGO 1
9+
710
#include "pins.h"
811
#include "bl.h"
912

13+
#ifndef CUSTOM_LOGO
14+
#define CUSTOM_LOGO /* nothing */
15+
#endif
16+
17+
1018
#define DISPLAY_WIDTH 160
1119
#define DISPLAY_HEIGHT 128
1220

@@ -348,15 +356,25 @@ void draw_hold_menu() {
348356
draw_screen();
349357
}
350358

359+
void print4border(int x, int y, int c, const char *str) {
360+
print4(x - 1, y - 1, 15, str);
361+
print4(x + 1, y - 1, 15, str);
362+
print4(x - 1, y + 1, 15, str);
363+
print4(x + 1, y + 1, 15, str);
364+
print4(x, y, c, str);
365+
}
366+
351367
void draw_drag() {
352368
drawBar(0, 52, 10);
353369
drawBar(52, 55, 8);
354370
drawBar(107, 14, 4);
355371

356-
print4(108, 5, 1, "F4");
372+
print4border(109, 5, 1, "F4");
357373
print(112, 40, 8, "v" UF2_VERSION);
358374
print(23, 110, 1, "arcade.makecode.com");
359375

376+
CUSTOM_LOGO;
377+
360378
#define DRAG 70
361379
#define DRAGX 10
362380
printicon(DRAGX + 20, DRAG + 5, 1, fileLogo);

uf2cfg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define UF2_VERSION "2.6.0"
1+
#define UF2_VERSION "2.6.1"
22
#ifndef BOARD_ID
33
#define BOARD_ID "STM32F4xx-Arcade-Generic"
44
#endif

0 commit comments

Comments
 (0)