Skip to content

Commit 881166b

Browse files
committed
Add brooch
1 parent 64f5828 commit 881166b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

main/menus/sao.c

+20-1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ void program_tilde_butterfly() {
176176
(uint8_t*) &data_storage, sizeof(data_storage), NULL, NULL, 0, true);
177177
}
178178

179+
void program_victorian_brooch() {
180+
sao_driver_neopixel_data_t data_neopixel = {.length = 6, .color_order = SAO_DRIVER_NEOPIXEL_COLOR_ORDER_GRB, .reserved = 0};
181+
182+
sao_driver_storage_data_t data_storage = {.flags = 0,
183+
.address = 0x50,
184+
.size_exp = 11, // 2 kbit (2^11)
185+
.page_size_exp = 4, // 16 bytes (2^4)
186+
.data_offset = 4, // 4 pages (64 bytes)
187+
.reserved = 0};
188+
189+
sao_format("Victorian brooch", SAO_DRIVER_NEOPIXEL_NAME, (uint8_t*) &data_neopixel, sizeof(data_neopixel), SAO_DRIVER_STORAGE_NAME,
190+
(uint8_t*) &data_storage, sizeof(data_storage), NULL, NULL, 0, false);
191+
}
192+
179193
typedef enum action {
180194
ACTION_NONE = 0,
181195
ACTION_BACK,
@@ -188,7 +202,8 @@ typedef enum action {
188202
ACTION_SSD1306,
189203
ACTION_NTAG,
190204
ACTION_SMALL,
191-
ACTION_BUTTERFLY
205+
ACTION_BUTTERFLY,
206+
ACTION_BROOCH
192207
} menu_dev_action_t;
193208

194209
static void menu_sao_format(xQueueHandle button_queue) {
@@ -215,6 +230,7 @@ static void menu_sao_format(xQueueHandle button_queue) {
215230
menu_insert_item(menu, "NTAG", NULL, (void*) ACTION_NTAG, -1);
216231
menu_insert_item(menu, "Generic 2kb EEPROM", NULL, (void*) ACTION_SMALL, -1);
217232
menu_insert_item(menu, "Tilde butterfly", NULL, (void*) ACTION_BUTTERFLY, -1);
233+
menu_insert_item(menu, "Victorian brooch", NULL, (void*) ACTION_BROOCH, -1);
218234

219235
bool render = true;
220236
menu_dev_action_t action = ACTION_NONE;
@@ -287,6 +303,9 @@ static void menu_sao_format(xQueueHandle button_queue) {
287303
} else if (action == ACTION_BUTTERFLY) {
288304
program_tilde_butterfly();
289305
break;
306+
} else if (action == ACTION_BROOCH) {
307+
program_victorian_brooch();
308+
break;
290309
} else if (action == ACTION_BACK) {
291310
break;
292311
}

0 commit comments

Comments
 (0)