Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added heltec wifi lora v3 board #668

Merged
merged 9 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions include/screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,11 @@ class Screen : public GFXBase
U8G2_SSD1306_128X64_NONAME_F_HW_I2C oled;

public:

OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 16, /*clk*/ 15, /*data*/ 4)
#if ARDUINO_HELTEC_WIFI_LORA_32_V3
OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 21, /*clk*/ 18, /*data*/ 17)
#else
OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 16, /*clk*/ 15, /*data*/ 4)
#endif
{
oled.begin();
oled.clear();
Expand Down Expand Up @@ -360,8 +363,10 @@ class Screen : public GFXBase

SSD1306Screen(int w, int h) : Screen(w, h)
{
Heltec.begin(true /*DisplayEnable Enable*/, true /*LoRa Disable*/, false /*Serial Enable*/);
Heltec.display->screenRotate(ANGLE_180_DEGREE);
Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Enable*/, false /*Serial Enable*/);
#ifdef SCREEN_ROTATION
Heltec.display->screenRotate(SCREEN_ROTATION);
#endif
rbergen marked this conversation as resolved.
Show resolved Hide resolved
}

virtual void StartFrame() override
Expand Down
25 changes: 21 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
; mesmerizer HUB75 info panel with audio effects, weather, info, etc,

[platformio]
default_envs =
default_envs =
build_cache_dir = .pio/build_cache
extra_configs =
custom_*.ini ; This file can be created in the root directory to store user defined devices and environments.
Expand All @@ -30,8 +30,8 @@ extra_configs =
; Options that are used (or extended) in all device sections (and hence environments) are defined here

[base]
upload_port =
monitor_port =
upload_port =
monitor_port =
build_type = release
upload_speed = 2000000
build_flags = -std=gnu++2a
Expand Down Expand Up @@ -127,7 +127,16 @@ build_flags = -DARDUINO_HELTEC_WIFI_KIT_32_V2=1
extends = dev_heltec_wifi
board = heltec_wifi_kit_32_V3
build_flags = -DARDUINO_HELTEC_WIFI_KIT_32_V3=1
-DWIFI_Kit_32=1
-DWIFI_Kit_32_V3=1
${dev_heltec_wifi.build_flags}
lib_deps = ${dev_heltec_wifi.lib_deps}
heltecautomation/Heltec ESP32 Dev-Boards @ ^1.1.1

[dev_heltec_wifi_lora_v3]
extends = dev_heltec_wifi
board = heltec_wifi_lora_32_V3
build_flags = -DARDUINO_HELTEC_WIFI_LORA_32_V3=1
-DWIFI_LoRa_32_V3=1
${dev_heltec_wifi.build_flags}
lib_deps = ${dev_heltec_wifi.lib_deps}
heltecautomation/Heltec ESP32 Dev-Boards @ ^1.1.1
Expand Down Expand Up @@ -394,6 +403,14 @@ build_flags = -DDEMO=1
-DUSE_SSD1306=1
${dev_heltec_wifi_v3.build_flags}

; Heltec LoRa V3 board, which is an S3 with USB-C and LoRa
[env:helteclorav3demo]
extends = dev_heltec_wifi_lora_v3
build_flags = -DDEMO=1
-DENABLE_WIFI=1
-DUSE_SSD1306=1
rbergen marked this conversation as resolved.
Show resolved Hide resolved
${dev_heltec_wifi_lora_v3.build_flags}

; LILYGO T-Display-S3
[env:lilygo-tdisplay-s3-demo]
extends = dev_lilygo-tdisplay-s3
Expand Down
6 changes: 5 additions & 1 deletion src/screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ void CurrentEffectSummary(bool bRedraw)
if (bRedraw)
display.fillScreen(BLACK16);

uint16_t backColor = Screen::to16bit(CRGB(0, 0, 64));
#if ARDUINO_HELTEC_WIFI_LORA_32_V3
uint16_t backColor = Screen::to16bit(CRGB(0, 0, 0));
#else
uint16_t backColor = Screen::to16bit(CRGB(0, 0, 64));
#endif

// We only draw after a page flip or if anything has changed about the information that will be
// shown in the page. This avoids flicker, but at the cost that we have to remember what we displayed
Expand Down