Skip to content

Commit

Permalink
Merge pull request #267 from julio-matarranz/feat/c3-devices
Browse files Browse the repository at this point in the history
feat : add support to c3 devices (mini ai-c3 and c3 super mini, 24khs) and refactor rgb led devices
  • Loading branch information
BitMaker-hub authored Dec 30, 2023
2 parents 6d29381 + b1b3ca3 commit 0c62b62
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 42 deletions.
72 changes: 67 additions & 5 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[platformio]
globallib_dir = lib
default_envs = esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S3-mini-weact
default_envs = esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S3-mini-weact, ESP32-C3-devKitmv1, ESP32-C3-super-mini


;--------------------------------------------------------------------
Expand All @@ -31,7 +31,8 @@ build_flags =
-D BOARD_HAS_PSRAM
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D S3MINIWEMOS=1
-D ESP32RGB=1
-D RGB_LED_PIN=47
;-D DEBUG_MINING=1
lib_deps =
https://github.com/takkaO/OpenFontRender
Expand All @@ -42,7 +43,6 @@ lib_deps =
https://github.com/FastLED/FastLED
lib_ignore =
TFT_eSPI
;--------------------------------------------------------------------

;--------------------------------------------------------------------

Expand All @@ -62,7 +62,67 @@ build_flags =
-D BOARD_HAS_PSRAM
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D S3MINIWEACT=1
-D ESP32RGB=1
-D RGB_LED_PIN=48
;-D DEBUG_MINING=1
lib_deps =
https://github.com/takkaO/OpenFontRender
bblanchon/ArduinoJson@^6.21.2
https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2
mathertel/OneButton @ ^2.0.3
arduino-libraries/NTPClient
https://github.com/FastLED/FastLED
lib_ignore =
TFT_eSPI
;--------------------------------------------------------------------

[env:ESP32-C3-super-mini]
platform = espressif32
board = seeed_xiao_esp32c3
framework = arduino
monitor_filters =
esp32_exception_decoder
time
log2file
monitor_speed = 115200
upload_speed = 115200
board_build.partitions = huge_app.csv
build_flags =
-D BOARD_HAS_PSRAM
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D DEVKITV1=1
-D PIN_BUTTON_1=9
-D LED_PIN=8
;-D DEBUG_MINING=1
lib_deps =
https://github.com/takkaO/OpenFontRender
bblanchon/ArduinoJson@^6.21.2
https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2
mathertel/OneButton @ ^2.0.3
arduino-libraries/NTPClient
lib_ignore =
TFT_eSPI
;--------------------------------------------------------------------

[env:ESP32-C3-devKitmv1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
monitor_filters =
esp32_exception_decoder
time
log2file
monitor_speed = 115200
upload_speed = 115200
board_build.partitions = huge_app.csv
build_flags =
-D BOARD_HAS_PSRAM
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D ESP32RGB=1
-D PIN_BUTTON_1=9
-D RGB_LED_PIN=8
;-D DEBUG_MINING=1
lib_deps =
https://github.com/takkaO/OpenFontRender
Expand All @@ -73,6 +133,7 @@ lib_deps =
https://github.com/FastLED/FastLED
lib_ignore =
TFT_eSPI

;--------------------------------------------------------------------

[env:ESP32-S3-devKitv1]
Expand All @@ -91,7 +152,8 @@ build_flags =
-D BOARD_HAS_PSRAM
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D DEVKITV1RGB=1
-D ESP32RGB=1
-D RGB_LED_PIN=48
;-D DEBUG_MINING=1
lib_deps =
https://github.com/takkaO/OpenFontRender
Expand Down
8 changes: 2 additions & 6 deletions src/drivers/devices/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@
#include "esp32CAM.h"
#elif defined(M5_STAMP_S3)
#include "m5StampS3.h"
#elif defined(DEVKITV1RGB)
#include "esp32DevKitRGB.h"
#elif defined(S3MINIWEMOS)
#include "esp32S3MiniWemos.h"
#elif defined(S3MINIWEACT)
#include "esp32S3MiniWeact.h"
#elif defined(ESP32RGB)
#include "esp32RGB.h"

#else
#error "No device defined"
Expand Down
5 changes: 5 additions & 0 deletions src/drivers/devices/esp32DevKit.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#ifndef _ESP32_DEV_KIT_H
#define _ESP32_DEV_KIT_H

#ifndef PIN_BUTTON_1
#define PIN_BUTTON_1 0
#endif

#ifndef LED_PIN
#define LED_PIN 2
#endif

#define NO_DISPLAY

Expand Down
10 changes: 0 additions & 10 deletions src/drivers/devices/esp32DevKitRGB.h

This file was deleted.

24 changes: 24 additions & 0 deletions src/drivers/devices/esp32RGB.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef _ESP32_RGB_H
#define _ESP32_RGB_H

#ifndef PIN_BUTTON_1
#define PIN_BUTTON_1 0
#endif

#ifndef RGB_LED_PIN
#define RGB_LED_PIN 48
#endif

#ifndef RGB_LED_CLASS
#define RGB_LED_CLASS WS2812B
#endif

#ifndef RGB_LED_ORDER
#define RGB_LED_ORDER BGR
#endif


#define LED_DISPLAY
#define USE_LED

#endif
10 changes: 0 additions & 10 deletions src/drivers/devices/esp32S3MiniWeact.h

This file was deleted.

10 changes: 0 additions & 10 deletions src/drivers/devices/esp32S3MiniWemos.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/drivers/displays/ledDisplayDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void ledDisplay_Init(void)
{
Serial.println("Led display driver initialized");
#ifdef USE_LED
FastLED.addLeds<WS2812B, RGB_LED_PIN, BGR>(&leds, 1);
FastLED.addLeds<RGB_LED_CLASS, RGB_LED_PIN, RGB_LED_ORDER>(&leds, 1);
FastLED.show();
#endif // USE_LED
}
Expand Down

0 comments on commit 0c62b62

Please sign in to comment.