Skip to content

Commit

Permalink
add support for OXRS Black (#51)
Browse files Browse the repository at this point in the history
and use new OXRS_LCD_ENABLE flag
  • Loading branch information
sumnerboy12 authored May 4, 2024
1 parent 784b682 commit a00b56d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
pip install --upgrade platformio
- name: Build release binary
run: pio run -e rack32-eth_ESP32 -e rack32-wifi_ESP32 -e room8266-eth_ESP8266 -e room8266-wifi_ESP8266
run: pio run -e black-eth_ESP32 -e rack32-eth_ESP32 -e rack32-wifi_ESP32 -e room8266-eth_ESP8266 -e room8266-wifi_ESP8266

- name: Create release
uses: ncipollo/release-action@v1
Expand Down
52 changes: 48 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ build_flags =
-DFW_GITHUB_URL="${firmware.github_url}"

; debug builds
[env:black-debug]
extends = black
build_flags =
${black.build_flags}
-DFW_VERSION="DEBUG-ETH"
monitor_speed = 115200

[env:rack32-debug]
extends = rack32
build_flags =
Expand Down Expand Up @@ -77,11 +84,17 @@ build_flags =
monitor_speed = 115200

; release builds
[env:black-eth_ESP32]
extends = black
extra_scripts =
pre:scripts/release_extra.py
pre:scripts/esp32_extra.py

[env:rack32-eth_ESP32]
extends = rack32
extra_scripts =
pre:scripts/release_extra.py
pre:scripts/rack32_extra.py
pre:scripts/esp32_extra.py

[env:rack32-wifi_ESP32]
extends = rack32
Expand All @@ -96,13 +109,13 @@ build_flags =
-DWIFI_MODE
extra_scripts =
pre:scripts/release_extra.py
pre:scripts/rack32_extra.py
pre:scripts/esp32_extra.py

[env:room8266-eth_ESP8266]
extends = room8266
extra_scripts =
pre:scripts/release_extra.py
pre:scripts/room8266_extra.py
pre:scripts/esp8266_extra.py

[env:room8266-wifi_ESP8266]
extends = room8266
Expand All @@ -117,7 +130,7 @@ build_flags =
-DWIFI_MODE
extra_scripts =
pre:scripts/release_extra.py
pre:scripts/room8266_extra.py
pre:scripts/esp8266_extra.py


[rack32]
Expand Down Expand Up @@ -151,6 +164,37 @@ build_flags =
-DLOAD_FONT2=1 ; Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
-DLOAD_GFXFF=1 ; FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

[black]
platform = espressif32
board = esp32dev
platform_packages = platformio/framework-arduinoespressif32@^3.20007.0
lib_deps =
${env.lib_deps}
bodmer/TFT_eSPI
https://github.com/OXRS-IO/Ethernet
https://github.com/OXRS-IO/OXRS-IO-LCD-ESP32-LIB
https://github.com/AustinsCreations/OXRS-AC-Black-ESP32-LIB
build_flags =
${env.build_flags}
-DOXRS_BLACK
; TFT_eSPI configuration
-DUSER_SETUP_LOADED=1
-DDISABLE_ALL_LIBRARY_WARNINGS=1
-DST7789_2_DRIVER=1
-DTFT_RGB_ORDER=TFT_RGB
-DTFT_WIDTH=240
-DTFT_HEIGHT=240
-DTFT_MOSI=23
-DTFT_SCLK=18
-DTFT_CS=25
-DTFT_DC=2
-DTFT_RST=4
-DTFT_BL=14
-DSPI_FREQUENCY=40000000
-DLOAD_GLCD=1 ; Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
-DLOAD_FONT2=1 ; Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
-DLOAD_GFXFF=1 ; FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

[room8266]
platform = espressif8266
board = esp12e
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 8 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include <OXRS_Rack32.h> // Rack32 support
#include "logo.h" // Embedded maker logo
OXRS_Rack32 oxrs(FW_LOGO);
#elif defined(OXRS_BLACK)
#include <OXRS_Black.h> // Black support
OXRS_Black oxrs;
#elif defined(OXRS_ROOM8266)
#include <OXRS_Room8266.h> // Room8266 support
OXRS_Room8266 oxrs;
Expand Down Expand Up @@ -234,7 +237,7 @@ void getEventType(char eventType[], uint8_t type, uint8_t state)
void setInputType(uint8_t mcp, uint8_t pin, uint8_t inputType)
{
// Configure the display (type constant from LCD library)
#if defined(OXRS_RACK32)
#if defined(OXRS_LCD_ENABLE)
switch (inputType)
{
case SECURITY:
Expand All @@ -253,7 +256,7 @@ void setInputType(uint8_t mcp, uint8_t pin, uint8_t inputType)
void setInputInvert(uint8_t mcp, uint8_t pin, int invert)
{
// Configure the display
#if defined(OXRS_RACK32)
#if defined(OXRS_LCD_ENABLE)
oxrs.getLCD()->setPinInvert(mcp, pin, invert);
#endif

Expand All @@ -264,7 +267,7 @@ void setInputInvert(uint8_t mcp, uint8_t pin, int invert)
void setInputDisabled(uint8_t mcp, uint8_t pin, int disabled)
{
// Configure the display
#if defined(OXRS_RACK32)
#if defined(OXRS_LCD_ENABLE)
oxrs.getLCD()->setPinDisabled(mcp, pin, disabled);
#endif

Expand Down Expand Up @@ -614,7 +617,7 @@ void setup()
oxrs.begin(jsonConfig, jsonCommand);

// Set up port display
#if defined(OXRS_RACK32)
#if defined(OXRS_LCD_ENABLE)
oxrs.getLCD()->drawPorts(PORT_LAYOUT_INPUT_AUTO, g_mcps_found);
#endif

Expand Down Expand Up @@ -644,7 +647,7 @@ void loop()
uint16_t io_value = mcp23017[mcp].readGPIOAB();

// Show port animations
#if defined(OXRS_RACK32)
#if defined(OXRS_LCD_ENABLE)
oxrs.getLCD()->process(mcp, io_value);
#endif

Expand Down

0 comments on commit a00b56d

Please sign in to comment.