Clang format changes for more readability
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
// Could be a config but its the GPIO on my ESP32-S3-ETH
|
||||
#define LED_GPIO GPIO_NUM_21
|
||||
|
||||
enum class led_status : uint8 {
|
||||
enum class led_status : uint8
|
||||
{
|
||||
ConnectingEthernet,
|
||||
ConnectingWifi,
|
||||
ReadyEthernet,
|
||||
@@ -17,7 +18,8 @@ enum class led_status : uint8 {
|
||||
|
||||
internal led_strip_handle_t led_strip;
|
||||
|
||||
internal void setup_led(void) {
|
||||
internal void setup_led(void)
|
||||
{
|
||||
/* LED strip initialization with the GPIO and pixels number*/
|
||||
led_strip_config_t strip_config = {};
|
||||
strip_config.strip_gpio_num = LED_GPIO;
|
||||
@@ -34,8 +36,10 @@ internal void setup_led(void) {
|
||||
|
||||
internal void destroy_led(void) { led_strip_clear(led_strip); }
|
||||
|
||||
internal void set_led_status(led_status status) {
|
||||
switch (status) {
|
||||
internal void set_led_status(led_status status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case led_status::ConnectingEthernet:
|
||||
led_strip_set_pixel(led_strip, 0, 255, 165, 0);
|
||||
break;
|
||||
@@ -54,9 +58,12 @@ internal void set_led_status(led_status status) {
|
||||
}
|
||||
led_strip_refresh(led_strip);
|
||||
}
|
||||
internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b) {
|
||||
if (n <= 0) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
if (n <= 0)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
led_strip_set_pixel(led_strip, 0, r, g, b);
|
||||
led_strip_refresh(led_strip);
|
||||
vTaskDelay(pdMS_TO_TICKS(50));
|
||||
@@ -67,7 +74,8 @@ internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b) {
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
led_strip_set_pixel(led_strip, 0, r, g, b);
|
||||
led_strip_refresh(led_strip);
|
||||
vTaskDelay(pdMS_TO_TICKS(300));
|
||||
|
||||
Reference in New Issue
Block a user