fixed depecated lib
This commit is contained in:
+31
-1
@@ -61,7 +61,7 @@
|
||||
|
||||
static const uart_port_t uartPort = UART_NUM_0;
|
||||
static TaskHandle_t devTaskHandle = NULL;
|
||||
static void devTask(void* parameters);
|
||||
static TaskHandle_t colourMapTaskHandle = NULL;
|
||||
|
||||
// GPIOs
|
||||
static GPIO led_rgb_red(3, GPIO_DIRECTION_OUTPUT);
|
||||
@@ -102,7 +102,9 @@ static void countdown(int delay);
|
||||
// Timer Callback for the LEDMatrix refresh
|
||||
static bool timerCallback(gptimer_handle_t timer, const gptimer_alarm_event_data_t *edata, void *user_data);
|
||||
|
||||
static void devTask(void* parameters);
|
||||
|
||||
static void colourMapTask(void* parameters);
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Function definitions
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
@@ -207,6 +209,12 @@ extern "C" void app_main(void)
|
||||
LOGGER_ERROR("Task not created");
|
||||
}
|
||||
|
||||
// Create the colour Map task
|
||||
if(xTaskCreate(colourMapTask, "ColourTask", 2048, NULL, 3, &colourMapTaskHandle) != pdPASS)
|
||||
{
|
||||
LOGGER_ERROR("Task not created");
|
||||
}
|
||||
|
||||
Wifi wifi;
|
||||
wifi.start_client();
|
||||
|
||||
@@ -250,6 +258,28 @@ static void devTask(void* parameters)
|
||||
}
|
||||
|
||||
|
||||
static void colourMapTask(void* parameters)
|
||||
{
|
||||
uint8_t red = 0;
|
||||
uint8_t green = 0;
|
||||
uint8_t blue = 0;
|
||||
|
||||
uint32_t counter = 0;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
LEDMatrix.setGlobalColour(red, green, blue);
|
||||
|
||||
red = counter & 0xFF;
|
||||
green = (counter >> 8) & 0xFF;
|
||||
blue = (counter >> 16) & 0xFF;
|
||||
counter++;
|
||||
vTaskDelay(30);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void countdown(int delay)
|
||||
{
|
||||
map.setWord(Wordmap::Language_t::NL, "ten", true);
|
||||
|
||||
Reference in New Issue
Block a user