From b5c1f350d27e4b9924a89f493326e01dbe89430f Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Thu, 10 Oct 2019 06:47:17 +0200 Subject: [PATCH] Whitespace changes. --- include/settings.h | 18 +++++++++--------- src/effect_big_clock.cpp | 2 +- src/http_server.cpp | 6 +++--- src/settings.cpp | 24 ++++++++++++------------ 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/settings.h b/include/settings.h index e405d04..8b3c3d7 100644 --- a/include/settings.h +++ b/include/settings.h @@ -22,53 +22,53 @@ struct Settings { uint16_t time = 300; uint16_t random = 1; } cycle ; - + struct /* matrix */ { uint16_t length_min = 4; uint16_t length_max = 20; uint16_t speed_min = 3; uint16_t speed_max = 7; } matrix; - + struct /* confetti */ { uint16_t pixels_per_loop = 2; } confetti; - + struct /* dvd */ { uint16_t width = 3; uint16_t height = 2; uint16_t speed = 50; } dvd; - + struct /* dynamic */ { uint16_t single_loop_time = 40; uint16_t multi_loop_time = 1400; uint16_t big_loop_time = 50; uint16_t big_size = 3; } dynamic; - + struct /* fire */ { uint16_t cooldown = 192; uint16_t spark_chance = 5; } fire; - + struct /* firework */ { uint16_t drag = 255; uint16_t bounce = 200; uint16_t gravity = 10; uint16_t sparks = 12; } firework; - + struct /* gol */ { uint16_t start_percentage = 90; uint16_t blend_speed = 10; uint16_t restart_after_steps = 100; } gol; - + struct /* sines */ { uint16_t count = 5; } sines; - + struct /* snake */ { uint16_t direction_change = 5; uint16_t slowdown = 2; diff --git a/src/effect_big_clock.cpp b/src/effect_big_clock.cpp index 854cb36..bd42fc8 100644 --- a/src/effect_big_clock.cpp +++ b/src/effect_big_clock.cpp @@ -27,7 +27,7 @@ void BigClockEffect::_draw_seconds() { for (int i=1; i<=seconds; i++) { _draw_border_pixel(i, 0, (i%5==0) ? &_color_seconds_light : &_color_seconds_dark); } - + uint16_t millis = ntpClient.getEpochMillis() % 1000; /* // Enable this to have the next pixel move smoothly to its position diff --git a/src/http_server.cpp b/src/http_server.cpp index 3efdaec..29a0262 100644 --- a/src/http_server.cpp +++ b/src/http_server.cpp @@ -18,9 +18,9 @@ File upload_file; void http_server_handle_file_upload() { if (http_server.uri() != "/upload") return; - + HTTPUpload upload = http_server.upload(); - + if (upload.status == UPLOAD_FILE_START) { String filename = upload.filename; if (!filename.startsWith("/")) filename = "/" + filename; @@ -159,7 +159,7 @@ void http_server_setup() { } }); http_server.begin(); - + MDNS.addService("_http", "_tcp", 80); } diff --git a/src/settings.cpp b/src/settings.cpp index fd0ca02..d6a8f54 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -5,40 +5,40 @@ Settings settings; Setting all_settings[] = { {"fps", &settings.fps, TYPE_UINT8}, - + {"effects.confetti.pixels_per_loop", &settings.effects.confetti.pixels_per_loop, TYPE_UINT8}, - + {"effects.cycle.random", &settings.effects.cycle.random, TYPE_BOOL}, {"effects.cycle.time", &settings.effects.cycle.time, TYPE_UINT16}, - + {"effects.dvd.width", &settings.effects.dvd.width, TYPE_UINT8}, {"effects.dvd.height", &settings.effects.dvd.height, TYPE_UINT8}, {"effects.dvd.speed", &settings.effects.dvd.speed, TYPE_UINT8}, - + {"effects.dynamic.single_loop_time", &settings.effects.dynamic.single_loop_time, TYPE_UINT16}, {"effects.dynamic.multi_loop_time", &settings.effects.dynamic.multi_loop_time, TYPE_UINT16}, {"effects.dynamic.big_loop_time", &settings.effects.dynamic.big_loop_time, TYPE_UINT16}, {"effects.dynamic.big_size", &settings.effects.dynamic.big_size, TYPE_UINT8}, - + {"effects.fire.cooldown", &settings.effects.fire.cooldown, TYPE_UINT8}, {"effects.fire.spark_chance", &settings.effects.fire.spark_chance, TYPE_UINT8}, - + {"effects.firework.drag", &settings.effects.firework.drag, TYPE_UINT8}, {"effects.firework.bounce", &settings.effects.firework.bounce, TYPE_UINT8}, {"effects.firework.gravity", &settings.effects.firework.gravity, TYPE_UINT8}, {"effects.firework.sparks", &settings.effects.firework.sparks, TYPE_UINT8}, - + {"effects.gol.start_percentage", &settings.effects.gol.start_percentage, TYPE_UINT8}, {"effects.gol.blend_speed", &settings.effects.gol.blend_speed, TYPE_UINT8}, {"effects.gol.restart_after_steps", &settings.effects.gol.restart_after_steps, TYPE_UINT8}, - + {"effects.matrix.length_min", &settings.effects.matrix.length_min, TYPE_UINT8}, {"effects.matrix.length_max", &settings.effects.matrix.length_max, TYPE_UINT8}, {"effects.matrix.speed_min", &settings.effects.matrix.speed_min, TYPE_UINT8}, {"effects.matrix.speed_max", &settings.effects.matrix.speed_max, TYPE_UINT8}, - + {"effects.sines.count", &settings.effects.sines.count, TYPE_UINT8}, - + {"effects.snake.direction_change", &settings.effects.snake.direction_change, TYPE_UINT8} }; @@ -57,7 +57,7 @@ bool change_setting(const char* key, uint16_t new_value) { LOGln("Settings * No setting matching the name %s found.", key); return false; } - + // Check data size if (s->type == TYPE_BOOL && new_value > 1) { LOGln("Settings * Data type of %s is boolean, but new value is > 1.", key); @@ -67,7 +67,7 @@ bool change_setting(const char* key, uint16_t new_value) { LOGln("Settings * Data type of %s is uint8_t, but new value is > 0xFF.", key); return false; } - + *(s->value) = new_value; LOGln("Settings * Success. New value for %s is %d.", key, new_value); return true;