From 9ef2d4e235680a96628e0575d839db95a8f97fe0 Mon Sep 17 00:00:00 2001
From: ladyada <limor@ladyada.net>
Date: Sat, 29 Jun 2024 12:46:25 -0400
Subject: [PATCH 1/3] add new feather c6 rev B :)

---
 boards.txt                                    | 179 ++++++++++++++++++
 .../adafruit_feather_esp32c6/pins_arduino.h   |  39 ++++
 variants/adafruit_feather_esp32c6/variant.cpp |  37 ++++
 3 files changed, 255 insertions(+)
 create mode 100644 variants/adafruit_feather_esp32c6/pins_arduino.h
 create mode 100644 variants/adafruit_feather_esp32c6/variant.cpp

diff --git a/boards.txt b/boards.txt
index 96966b9bdac..acf045eba42 100644
--- a/boards.txt
+++ b/boards.txt
@@ -13299,6 +13299,185 @@ adafruit_feather_esp32s3_reversetft.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinato
 adafruit_feather_esp32s3_reversetft.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
 adafruit_feather_esp32s3_reversetft.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr -lzboss_port
 
+#############################
+# Feather C6
+
+
+adafruit_feather_esp32c6.name=Adafruit Feather ESP32-C6
+adafruit_feather_esp32c6.vid.0=0x303a
+adafruit_feather_esp32c6.pid.0=0x1001
+
+adafruit_feather_esp32c6.bootloader.tool=esptool_py
+adafruit_feather_esp32c6.bootloader.tool.default=esptool_py
+
+adafruit_feather_esp32c6.upload.tool=esptool_py
+adafruit_feather_esp32c6.upload.tool.default=esptool_py
+adafruit_feather_esp32c6.upload.tool.network=esp_ota
+
+adafruit_feather_esp32c6.upload.maximum_size=1310720
+adafruit_feather_esp32c6.upload.maximum_data_size=327680
+adafruit_feather_esp32c6.upload.flags=
+adafruit_feather_esp32c6.upload.extra_flags=
+adafruit_feather_esp32c6.upload.use_1200bps_touch=false
+adafruit_feather_esp32c6.upload.wait_for_upload_port=false
+
+adafruit_feather_esp32c6.serial.disableDTR=false
+adafruit_feather_esp32c6.serial.disableRTS=false
+
+adafruit_feather_esp32c6.build.tarch=riscv32
+adafruit_feather_esp32c6.build.target=esp
+adafruit_feather_esp32c6.build.mcu=esp32c6
+adafruit_feather_esp32c6.build.core=esp32
+adafruit_feather_esp32c6.build.variant=adafruit_feather_esp32c6
+adafruit_feather_esp32c6.build.board=ADAFRUIT_FEATHER_ESP32C6
+adafruit_feather_esp32c6.build.bootloader_addr=0x0
+
+adafruit_feather_esp32c6.build.cdc_on_boot=0
+adafruit_feather_esp32c6.build.f_cpu=160000000L
+adafruit_feather_esp32c6.build.flash_size=4MB
+adafruit_feather_esp32c6.build.flash_freq=80m
+adafruit_feather_esp32c6.build.flash_mode=qio
+adafruit_feather_esp32c6.build.boot=qio
+adafruit_feather_esp32c6.build.partitions=default
+adafruit_feather_esp32c6.build.defines=
+
+## IDE 2.0 Seems to not update the value
+adafruit_feather_esp32c6.menu.JTAGAdapter.default=Disabled
+adafruit_feather_esp32c6.menu.JTAGAdapter.default.build.copy_jtag_files=0
+adafruit_feather_esp32c6.menu.JTAGAdapter.builtin=Integrated USB JTAG
+adafruit_feather_esp32c6.menu.JTAGAdapter.builtin.build.openocdscript=esp32c6-builtin.cfg
+adafruit_feather_esp32c6.menu.JTAGAdapter.builtin.build.copy_jtag_files=1
+adafruit_feather_esp32c6.menu.JTAGAdapter.external=FTDI Adapter
+adafruit_feather_esp32c6.menu.JTAGAdapter.external.build.openocdscript=esp32c6-ftdi.cfg
+adafruit_feather_esp32c6.menu.JTAGAdapter.external.build.copy_jtag_files=1
+adafruit_feather_esp32c6.menu.JTAGAdapter.bridge=ESP USB Bridge
+adafruit_feather_esp32c6.menu.JTAGAdapter.bridge.build.openocdscript=esp32c6-bridge.cfg
+adafruit_feather_esp32c6.menu.JTAGAdapter.bridge.build.copy_jtag_files=1
+
+adafruit_feather_esp32c6.menu.CDCOnBoot.default=Disabled
+adafruit_feather_esp32c6.menu.CDCOnBoot.default.build.cdc_on_boot=0
+adafruit_feather_esp32c6.menu.CDCOnBoot.cdc=Enabled
+adafruit_feather_esp32c6.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
+
+adafruit_feather_esp32c6.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.default.build.partitions=default
+adafruit_feather_esp32c6.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
+adafruit_feather_esp32c6.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.default_8MB.build.partitions=default_8MB
+adafruit_feather_esp32c6.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336
+adafruit_feather_esp32c6.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.minimal.build.partitions=minimal
+adafruit_feather_esp32c6.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.no_ota.build.partitions=no_ota
+adafruit_feather_esp32c6.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
+adafruit_feather_esp32c6.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
+adafruit_feather_esp32c6.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.huge_app.build.partitions=huge_app
+adafruit_feather_esp32c6.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
+adafruit_feather_esp32c6.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
+adafruit_feather_esp32c6.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
+adafruit_feather_esp32c6.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.fatflash.build.partitions=ffat
+adafruit_feather_esp32c6.menu.PartitionScheme.fatflash.upload.maximum_size=2097152
+adafruit_feather_esp32c6.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS)
+adafruit_feather_esp32c6.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB
+adafruit_feather_esp32c6.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
+adafruit_feather_esp32c6.menu.PartitionScheme.rainmaker=RainMaker
+adafruit_feather_esp32c6.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
+adafruit_feather_esp32c6.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728
+adafruit_feather_esp32c6.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs
+adafruit_feather_esp32c6.menu.PartitionScheme.zigbee.build.partitions=zigbee
+adafruit_feather_esp32c6.menu.PartitionScheme.zigbee.upload.maximum_size=1310720
+adafruit_feather_esp32c6.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
+adafruit_feather_esp32c6.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
+adafruit_feather_esp32c6.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
+adafruit_feather_esp32c6.menu.PartitionScheme.custom=Custom
+adafruit_feather_esp32c6.menu.PartitionScheme.custom.build.partitions=
+adafruit_feather_esp32c6.menu.PartitionScheme.custom.upload.maximum_size=16777216
+
+adafruit_feather_esp32c6.menu.CPUFreq.160=160MHz (WiFi)
+adafruit_feather_esp32c6.menu.CPUFreq.160.build.f_cpu=160000000L
+adafruit_feather_esp32c6.menu.CPUFreq.120=120MHz (WiFi)
+adafruit_feather_esp32c6.menu.CPUFreq.120.build.f_cpu=120000000L
+adafruit_feather_esp32c6.menu.CPUFreq.80=80MHz (WiFi)
+adafruit_feather_esp32c6.menu.CPUFreq.80.build.f_cpu=80000000L
+adafruit_feather_esp32c6.menu.CPUFreq.40=40MHz
+adafruit_feather_esp32c6.menu.CPUFreq.40.build.f_cpu=40000000L
+adafruit_feather_esp32c6.menu.CPUFreq.20=20MHz
+adafruit_feather_esp32c6.menu.CPUFreq.20.build.f_cpu=20000000L
+adafruit_feather_esp32c6.menu.CPUFreq.10=10MHz
+adafruit_feather_esp32c6.menu.CPUFreq.10.build.f_cpu=10000000L
+
+adafruit_feather_esp32c6.menu.FlashMode.qio=QIO
+adafruit_feather_esp32c6.menu.FlashMode.qio.build.flash_mode=dio
+adafruit_feather_esp32c6.menu.FlashMode.qio.build.boot=qio
+adafruit_feather_esp32c6.menu.FlashMode.dio=DIO
+adafruit_feather_esp32c6.menu.FlashMode.dio.build.flash_mode=dio
+adafruit_feather_esp32c6.menu.FlashMode.dio.build.boot=dio
+
+adafruit_feather_esp32c6.menu.FlashFreq.80=80MHz
+adafruit_feather_esp32c6.menu.FlashFreq.80.build.flash_freq=80m
+adafruit_feather_esp32c6.menu.FlashFreq.40=40MHz
+adafruit_feather_esp32c6.menu.FlashFreq.40.build.flash_freq=40m
+
+adafruit_feather_esp32c6.menu.UploadSpeed.921600=921600
+adafruit_feather_esp32c6.menu.UploadSpeed.921600.upload.speed=921600
+adafruit_feather_esp32c6.menu.UploadSpeed.115200=115200
+adafruit_feather_esp32c6.menu.UploadSpeed.115200.upload.speed=115200
+adafruit_feather_esp32c6.menu.UploadSpeed.256000.windows=256000
+adafruit_feather_esp32c6.menu.UploadSpeed.256000.upload.speed=256000
+adafruit_feather_esp32c6.menu.UploadSpeed.230400.windows.upload.speed=256000
+adafruit_feather_esp32c6.menu.UploadSpeed.230400=230400
+adafruit_feather_esp32c6.menu.UploadSpeed.230400.upload.speed=230400
+adafruit_feather_esp32c6.menu.UploadSpeed.460800.linux=460800
+adafruit_feather_esp32c6.menu.UploadSpeed.460800.macosx=460800
+adafruit_feather_esp32c6.menu.UploadSpeed.460800.upload.speed=460800
+adafruit_feather_esp32c6.menu.UploadSpeed.512000.windows=512000
+adafruit_feather_esp32c6.menu.UploadSpeed.512000.upload.speed=512000
+
+adafruit_feather_esp32c6.menu.DebugLevel.none=None
+adafruit_feather_esp32c6.menu.DebugLevel.none.build.code_debug=0
+adafruit_feather_esp32c6.menu.DebugLevel.error=Error
+adafruit_feather_esp32c6.menu.DebugLevel.error.build.code_debug=1
+adafruit_feather_esp32c6.menu.DebugLevel.warn=Warn
+adafruit_feather_esp32c6.menu.DebugLevel.warn.build.code_debug=2
+adafruit_feather_esp32c6.menu.DebugLevel.info=Info
+adafruit_feather_esp32c6.menu.DebugLevel.info.build.code_debug=3
+adafruit_feather_esp32c6.menu.DebugLevel.debug=Debug
+adafruit_feather_esp32c6.menu.DebugLevel.debug.build.code_debug=4
+adafruit_feather_esp32c6.menu.DebugLevel.verbose=Verbose
+adafruit_feather_esp32c6.menu.DebugLevel.verbose.build.code_debug=5
+
+adafruit_feather_esp32c6.menu.EraseFlash.none=Disabled
+adafruit_feather_esp32c6.menu.EraseFlash.none.upload.erase_cmd=
+adafruit_feather_esp32c6.menu.EraseFlash.all=Enabled
+adafruit_feather_esp32c6.menu.EraseFlash.all.upload.erase_cmd=-e
+
+adafruit_feather_esp32c6.menu.ZigbeeMode.default=Disabled
+adafruit_feather_esp32c6.menu.ZigbeeMode.default.build.zigbee_mode=
+adafruit_feather_esp32c6.menu.ZigbeeMode.default.build.zigbee_libs=
+adafruit_feather_esp32c6.menu.ZigbeeMode.ed=Zigbee ED (end device)
+adafruit_feather_esp32c6.menu.ZigbeeMode.ed.build.zigbee_mode=-DZIGBEE_MODE_ED
+adafruit_feather_esp32c6.menu.ZigbeeMode.ed.build.zigbee_libs=-lesp_zb_api_ed -lesp_zb_cli_command -lzboss_stack.ed.trace -lzboss_stack.ed -lzboss_port
+adafruit_feather_esp32c6.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
+adafruit_feather_esp32c6.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
+adafruit_feather_esp32c6.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port
+adafruit_feather_esp32c6.menu.ZigbeeMode.rcp=Zigbee RCP (radio co-processor)
+adafruit_feather_esp32c6.menu.ZigbeeMode.rcp.build.zigbee_mode=-DZIGBEE_MODE_RCP
+adafruit_feather_esp32c6.menu.ZigbeeMode.rcp.build.zigbee_libs=-lesp_zb_api_rcp -lesp_zb_cli_command -lzboss_stack.rcp -lzboss_port
+
+
+
 ##############################################################
 # Adafruit QT Py ESP32
 
diff --git a/variants/adafruit_feather_esp32c6/pins_arduino.h b/variants/adafruit_feather_esp32c6/pins_arduino.h
new file mode 100644
index 00000000000..1cadfffa074
--- /dev/null
+++ b/variants/adafruit_feather_esp32c6/pins_arduino.h
@@ -0,0 +1,39 @@
+#ifndef Pins_Arduino_h
+#define Pins_Arduino_h
+
+#include <stdint.h>
+#include "soc/soc_caps.h"
+
+#define PIN_NEOPIXEL        9
+// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
+static const uint8_t LED_BUILTIN = 15;
+#define BUILTIN_LED  LED_BUILTIN // backward compatibility
+#define LED_BUILTIN LED_BUILTIN  // allow testing #ifdef LED_BUILTIN
+// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
+#define RGB_BUILTIN (SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL)
+#define RGB_BRIGHTNESS 64
+
+
+#define NEOPIXEL_I2C_POWER          20     // I2C power pin
+#define PIN_NEOPIXEL_I2C_POWER      20     // I2C power pin
+
+static const uint8_t TX = 16;
+static const uint8_t RX = 17;
+
+static const uint8_t SDA = 19;
+static const uint8_t SCL = 18;
+
+static const uint8_t SS    = 0;
+static const uint8_t MOSI  = 22;
+static const uint8_t MISO  = 23;
+static const uint8_t SCK   = 21;
+
+static const uint8_t A0 = 1;
+static const uint8_t A1 = 4;
+static const uint8_t A2 = 6;
+static const uint8_t A3 = 5;
+static const uint8_t A4 = 3;
+static const uint8_t A5 = 2;
+static const uint8_t A6 = 0;
+
+#endif /* Pins_Arduino_h */
diff --git a/variants/adafruit_feather_esp32c6/variant.cpp b/variants/adafruit_feather_esp32c6/variant.cpp
new file mode 100644
index 00000000000..576afb6b228
--- /dev/null
+++ b/variants/adafruit_feather_esp32c6/variant.cpp
@@ -0,0 +1,37 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "esp32-hal-gpio.h"
+#include "pins_arduino.h"
+
+extern "C" {
+
+// Initialize variant/board, called before setup()
+void initVariant(void) {
+  // This board has a power control pin, and we must set it to output and high
+  // in order to enable the NeoPixels & I2C
+  pinMode(NEOPIXEL_I2C_POWER, OUTPUT);
+  digitalWrite(NEOPIXEL_I2C_POWER, HIGH);
+}
+}

From 959b1b63bcd271e0c0757495c1fe25626054414e Mon Sep 17 00:00:00 2001
From: hathach <thach@tinyusb.org>
Date: Mon, 1 Jul 2024 21:53:24 +0700
Subject: [PATCH 2/3] remove the -lzboss_stack.ed.trace per review

---
 boards.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boards.txt b/boards.txt
index acf045eba42..f3655607c56 100644
--- a/boards.txt
+++ b/boards.txt
@@ -13468,10 +13468,10 @@ adafruit_feather_esp32c6.menu.ZigbeeMode.default.build.zigbee_mode=
 adafruit_feather_esp32c6.menu.ZigbeeMode.default.build.zigbee_libs=
 adafruit_feather_esp32c6.menu.ZigbeeMode.ed=Zigbee ED (end device)
 adafruit_feather_esp32c6.menu.ZigbeeMode.ed.build.zigbee_mode=-DZIGBEE_MODE_ED
-adafruit_feather_esp32c6.menu.ZigbeeMode.ed.build.zigbee_libs=-lesp_zb_api_ed -lesp_zb_cli_command -lzboss_stack.ed.trace -lzboss_stack.ed -lzboss_port
+adafruit_feather_esp32c6.menu.ZigbeeMode.ed.build.zigbee_libs=-lesp_zb_api_ed -lesp_zb_cli_command -lzboss_stack.ed -lzboss_port
 adafruit_feather_esp32c6.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
 adafruit_feather_esp32c6.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
-adafruit_feather_esp32c6.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port
+adafruit_feather_esp32c6.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr -lzboss_port
 adafruit_feather_esp32c6.menu.ZigbeeMode.rcp=Zigbee RCP (radio co-processor)
 adafruit_feather_esp32c6.menu.ZigbeeMode.rcp.build.zigbee_mode=-DZIGBEE_MODE_RCP
 adafruit_feather_esp32c6.menu.ZigbeeMode.rcp.build.zigbee_libs=-lesp_zb_api_rcp -lesp_zb_cli_command -lzboss_stack.rcp -lzboss_port

From 107012c79b9c8379d84b3181a582e4c7b9e809e6 Mon Sep 17 00:00:00 2001
From: hathach <thach@tinyusb.org>
Date: Tue, 2 Jul 2024 09:58:18 +0700
Subject: [PATCH 3/3] fix pre-commit

---
 .../adafruit_feather_esp32c6/pins_arduino.h   | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/variants/adafruit_feather_esp32c6/pins_arduino.h b/variants/adafruit_feather_esp32c6/pins_arduino.h
index 1cadfffa074..f8a7b112161 100644
--- a/variants/adafruit_feather_esp32c6/pins_arduino.h
+++ b/variants/adafruit_feather_esp32c6/pins_arduino.h
@@ -4,18 +4,17 @@
 #include <stdint.h>
 #include "soc/soc_caps.h"
 
-#define PIN_NEOPIXEL        9
+#define PIN_NEOPIXEL 9
 // BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
 static const uint8_t LED_BUILTIN = 15;
-#define BUILTIN_LED  LED_BUILTIN // backward compatibility
+#define BUILTIN_LED LED_BUILTIN  // backward compatibility
 #define LED_BUILTIN LED_BUILTIN  // allow testing #ifdef LED_BUILTIN
 // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
-#define RGB_BUILTIN (SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL)
+#define RGB_BUILTIN    (SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL)
 #define RGB_BRIGHTNESS 64
 
-
-#define NEOPIXEL_I2C_POWER          20     // I2C power pin
-#define PIN_NEOPIXEL_I2C_POWER      20     // I2C power pin
+#define NEOPIXEL_I2C_POWER     20  // I2C power pin
+#define PIN_NEOPIXEL_I2C_POWER 20  // I2C power pin
 
 static const uint8_t TX = 16;
 static const uint8_t RX = 17;
@@ -23,10 +22,10 @@ static const uint8_t RX = 17;
 static const uint8_t SDA = 19;
 static const uint8_t SCL = 18;
 
-static const uint8_t SS    = 0;
-static const uint8_t MOSI  = 22;
-static const uint8_t MISO  = 23;
-static const uint8_t SCK   = 21;
+static const uint8_t SS = 0;
+static const uint8_t MOSI = 22;
+static const uint8_t MISO = 23;
+static const uint8_t SCK = 21;
 
 static const uint8_t A0 = 1;
 static const uint8_t A1 = 4;