diff --git a/Firmware/PocketVoltex/Config.c b/Firmware/PocketVoltex/Config.c index 2259150..419fc54 100644 --- a/Firmware/PocketVoltex/Config.c +++ b/Firmware/PocketVoltex/Config.c @@ -57,8 +57,21 @@ void SetConfig(sdvx_config_t* config) { } command_response_t HandleConfig(uint8_t* buffer) { - if(buffer[0] == MAGIC_RESET_NUMBER) { - return REBOOT; + command_t *command = (command_t*)buffer; + switch(command->command) { + case VERSION: + command->data.version.version = FIRMWARE_VERSION; + command->data.version.serial = 0xDEAD; // TODO set properly later + return RESPOND; + case GETCONFIG: + memcpy(&command->data.config, &sdvxConfig, CONFIG_BYTES); + return RESPOND; + case SETCONFIG: + SetConfig(&command->data.config); + return IGNORE; + case RESET: + return REBOOT; + default: + return IGNORE; } - return IGNORE; } \ No newline at end of file diff --git a/Software/WebConfig/css/style.css b/Software/WebConfig/css/style.css index 22166a0..76dd0cc 100644 --- a/Software/WebConfig/css/style.css +++ b/Software/WebConfig/css/style.css @@ -1,17 +1,14 @@ -.hidden { - display: none; -} - -.disabled { - opacity: 0.4; +.center { + position: relative; + display:flex; + align-items:center; + flex-direction: column; } .configBox { background-image: url("../img/topdown-small.png"); width: 800px; height: 571px; - margin-left:auto; - margin-right:auto; } .connect { @@ -25,4 +22,38 @@ .connect > button { font-size: 40pt; +} + +.configOptions { + margin-left: 180px; + display: flex; + flex-wrap: wrap; + flex-direction: column; + height: 400px; + width: 600px; +} + +.configOptions > div, .configOptions > p { + width: 50%; +} + +.colourPicker { + width: 50px; + height: 20px; +} + +.pinEntry { + width: 40px; +} + +.nestedSetting { + margin-left: 10px; +} + +.hidden { + display: none; +} + +.disabled { + opacity: 0.4; } \ No newline at end of file diff --git a/Software/WebConfig/index.html b/Software/WebConfig/index.html index c40b243..3585e83 100644 --- a/Software/WebConfig/index.html +++ b/Software/WebConfig/index.html @@ -6,11 +6,14 @@ + @@ -19,11 +22,17 @@