started working on OTA but downloading files is not functional yet

This commit is contained in:
Matthias Mitscherlich
2024-03-22 17:33:53 +01:00
parent 0fcd60ff57
commit 55c3ebbbe4
10 changed files with 531 additions and 219 deletions
+18 -5
View File
@@ -67,17 +67,30 @@ class prgm_ledstrip
struct pixel
{
uint32_t index;
uint8_t red;
uint8_t green;
uint8_t blue;
uint32_t index;
union
{
struct
{
uint8_t red;
uint8_t green;
uint8_t blue;
} rgb;
struct
{
uint16_t hue;
uint8_t saturation;
uint8_t value;
} hsv;
};
};
// Class Constructor
prgm_ledstrip(uint32_t numberOfLEDs, uint32_t gpio);
// Set and clear functions only update the pixel value(s) locally but do not push the values to the strip
FunctionStatus setPixel(struct pixel& pixel);
FunctionStatus setPixelRGB(struct pixel& pixel);
FunctionStatus setPixelHSV(struct pixel& pixel);
FunctionStatus clearAll(void);
// Clears all pixels locally and automatically pushes the values to the strip
+4 -4
View File
@@ -81,10 +81,10 @@ FunctionStatus ledmatrix::setPixel(uint32_t row, uint32_t column, uint8_t red, u
{
struct pixel p;
p.index = index;
p.red = red;
p.green = green;
p.blue = blue;
returnValue = prgm_ledstrip::setPixel(p);
p.rgb.red = red;
p.rgb.green = green;
p.rgb.blue = blue;
returnValue = prgm_ledstrip::setPixelRGB(p);
}
return returnValue;
+18 -2
View File
@@ -71,13 +71,29 @@ prgm_ledstrip::prgm_ledstrip(uint32_t numberOfLEDs, uint32_t gpio) : numberOfLED
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip));
}
FunctionStatus prgm_ledstrip::setPixel(struct pixel& pixel)
FunctionStatus prgm_ledstrip::setPixelRGB(struct pixel& pixel)
{
FunctionStatus returnValue = FUNCTION_STATUS_OK;
if (pixel.index < numberOfLEDs)
{
ESP_ERROR_CHECK(led_strip_set_pixel(led_strip, pixel.index, pixel.red, pixel.green, pixel.blue));
ESP_ERROR_CHECK(led_strip_set_pixel(led_strip, pixel.index, pixel.rgb.red, pixel.rgb.green, pixel.rgb.blue));
}
else
{
returnValue = FUNCTION_STATUS_ERROR;
}
return returnValue;
}
FunctionStatus prgm_ledstrip::setPixelHSV(struct pixel& pixel)
{
FunctionStatus returnValue = FUNCTION_STATUS_OK;
if (pixel.index < numberOfLEDs)
{
ESP_ERROR_CHECK(led_strip_set_pixel_hsv(led_strip, pixel.index, pixel.hsv.hue, pixel.hsv.saturation, pixel.hsv.value));
}
else
{
+4 -3
View File
@@ -47,9 +47,10 @@
// File-scope variables
// --------------------------------------------------------------------------------------------------------------------
static const char* ssid = "Kowalski";
static const char* pass = "madagascar";
static const char* ssid = "Skipper";
static const char* pass = "w00t/?YeP";
//static const char* ssid = "Kowalski";
//static const char* pass = "madagascar";
//static const char* ssid = "vbchaos";
//static const char* pass = "mijninternet";