Skip to content

Commit 2cb9d99

Browse files
authored
changed ip config from string to uint8_t[4] and changed all checkmarks to x's
1 parent 6981f63 commit 2cb9d99

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Code/src/firmware/main.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ enum PORT_STATUS {
4747
DISABLED
4848
};
4949

50-
using ConfigTypes = std::variant<bool, std::string, uint16_t, PORT_STATUS>;
50+
using ConfigTypes = std::variant<bool, uint8t[4], uint16_t, PORT_STATUS>;
5151

5252
std::unordered_map<std::string, ConfigTypes> config = {
53-
{"IP", "002.000.000.001"},
54-
{"SUBNET", "255.000.000.000"},
53+
{"IP", {2, 0, 0, 1}},
54+
{"SUBNET", {255, 0, 0, 0}},
5555
{"DHCP", true},
5656
{"PORT_A_STATUS", PORT_STATUS::OUTPUT},
5757
{"PORT_A_UNIVERSE", uint16_t(0x0000)},
@@ -322,7 +322,7 @@ int main () {
322322
drawRect(&display, 112, 16, 127, 31);
323323
drawRect(&display, 112, 32, 127, 47);
324324
if (std::get<bool>(config["DHCP"])) { // dhcp enabled
325-
drawText(&display, FONT, "v", 114, 15);
325+
drawText(&display, FONT, "x", 114, 15);
326326
} else { // dhcp disabled
327327
drawText(&display, FONT, "x", 114, 31);
328328
}
@@ -335,9 +335,9 @@ int main () {
335335
display.clear();
336336
draw_menu_content(&display, "IP:", {}, false);
337337
drawText(&display, font_8x8, "IP Address:", 0, 16);
338-
drawText(&display, font_8x8, std::get<std::string>(config["IP"]).c_str(), 0, 24);
338+
drawText(&display, font_8x8, std::to_string(config["IP"][0]) + "." + std::to_string(config["IP"][1]) + "." + std::to_string(config["IP"][2]) + "." + std::to_string(config["IP"][3]), 0, 24);
339339
drawText(&display, font_8x8, "Subnet Mask:", 0, 32);
340-
drawText(&display, font_8x8, std::get<std::string>(config["SUBNET"]).c_str(), 0, 40);
340+
drawText(&display, font_8x8, std::to_string(config["SUBNET"][0]) + "." + std::to_string(config["SUBNET"][1]) + "." + std::to_string(config["SUBNET"][2]) + "." + std::to_string(config["SUBNET"][3]), 0, 40);
341341

342342
if (!edit_mode) {
343343
if (button_exit_pressed) {
@@ -481,13 +481,13 @@ int main () {
481481
drawRect(&display, 112, 48, 127, 63);
482482
switch (std::get<PORT_STATUS>(config["PORT_A_STATUS"])) {
483483
case PORT_STATUS::OUTPUT:
484-
drawText(&display, FONT, "v", 114, 15);
484+
drawText(&display, FONT, "x", 114, 15);
485485
break;
486486
case PORT_STATUS::INPUT:
487-
drawText(&display, FONT, "v", 114, 31);
487+
drawText(&display, FONT, "x", 114, 31);
488488
break;
489489
case PORT_STATUS::DISABLED:
490-
drawText(&display, FONT, "v", 114, 47);
490+
drawText(&display, FONT, "x", 114, 47);
491491
break;
492492
}
493493
draw_menu_selected(&display, current_selection);
@@ -605,13 +605,13 @@ int main () {
605605
drawRect(&display, 112, 48, 127, 63);
606606
switch(std::get<PORT_STATUS>(config["PORT_B_STATUS"])) {
607607
case PORT_STATUS::OUTPUT:
608-
drawText(&display, FONT, "v", 114, 15);
608+
drawText(&display, FONT, "x", 114, 15);
609609
break;
610610
case PORT_STATUS::INPUT:
611-
drawText(&display, FONT, "v", 114, 31);
611+
drawText(&display, FONT, "x", 114, 31);
612612
break;
613613
case PORT_STATUS::DISABLED:
614-
drawText(&display, FONT, "v", 114, 47);
614+
drawText(&display, FONT, "x", 114, 47);
615615
break;
616616
}
617617
draw_menu_selected(&display, current_selection);

0 commit comments

Comments
 (0)