diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2022-12-01 22:44:20 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2022-12-01 22:44:20 -0700 |
commit | 10a5077234e9b76dc100b9029a9e2d71801e7242 (patch) | |
tree | 13e42a3c91f1672c6ce7b6daba776366aa71ef85 /main/main.c | |
parent | 05e3f6bb7293c771629c7b3599392c8f335e7dd8 (diff) | |
download | esp32-ws2812b-main.tar.gz esp32-ws2812b-main.tar.bz2 esp32-ws2812b-main.zip |
Diffstat (limited to 'main/main.c')
-rw-r--r-- | main/main.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/main/main.c b/main/main.c index 82fff1e..3b8c284 100644 --- a/main/main.c +++ b/main/main.c @@ -4,12 +4,11 @@ #include "esp_system.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" +#include "http_server.h" #include "sdkconfig.h" - #include "station.h" -#include "http_server.h" -#include "ws2812b_writer.h" #include "tcp_server.h" +#include "ws2812b_writer.h" #ifdef CONFIG_IDF_TARGET_ESP32 #define LCD_HOST HSPI_HOST @@ -52,7 +51,7 @@ static ws_params_t ws_params; * to the led strip. */ portTASK_FUNCTION(time_keeper, params_) { - ws_params_t* params = (ws_params_t*) params_; + ws_params_t* params = (ws_params_t*)params_; TickType_t last_wake; const TickType_t freq = 1; @@ -60,11 +59,10 @@ portTASK_FUNCTION(time_keeper, params_) // Initialise the xLastWakeTime variable with the current time. last_wake = xTaskGetTickCount(); - for( ;; ) - { - // Wait for the next cycle. - vTaskDelayUntil( &last_wake, freq ); - params->state.time += params->state.timetick; + for (;;) { + // Wait for the next cycle. + vTaskDelayUntil(&last_wake, freq); + params->state.time += params->state.timetick; } } @@ -93,7 +91,7 @@ void app_main(void) printf("miso: %d\n", PIN_NUM_MISO); printf("mosi: %d\n", PIN_NUM_MOSI); printf("sclk: %d\n", PIN_NUM_CLK); - printf("Tick period ms: %d\n", (int) portTICK_PERIOD_MS); + printf("Tick period ms: %d\n", (int)portTICK_PERIOD_MS); error = spi_bus_initialize(HSPI_HOST, &cfg, SPI_DMA_CH_AUTO); printf("Bus Init\n"); |