Skip to content

Commit

Permalink
Merge pull request #115 from bmorcelli/main
Browse files Browse the repository at this point in the history
Ports to Core devices
LGTM 😶‍🌫️
  • Loading branch information
pr3y authored Aug 3, 2024
2 parents 52eb2e5 + b86c00d commit 941be1d
Show file tree
Hide file tree
Showing 294 changed files with 1,722,112 additions and 102 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/buil_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
type: choice
required: true
default: 'M5Cardputer'
options: ['M5Cardputer', 'M5StickCPlus2', 'M5StickCPlus', 'M5StickC']
options: ['M5Cardputer', 'M5StickCPlus2', 'M5StickCPlus', 'Core2', 'Core16mb', 'Core4mb']

jobs:
compile_sketch:
Expand Down Expand Up @@ -51,13 +51,27 @@
bootloader_addr: "0x1000",
},
}
# - {
# name: "M5StickC",
# env: "m5stack-c",
# partitions: {
# bootloader_addr: "0x1000",
# },
# }
- {
name: "Core2",
env: "m5stack-core2",
partitions: {
bootloader_addr: "0x1000",
},
}
- {
name: "Core16mb",
env: "m5stack-core16mb",
partitions: {
bootloader_addr: "0x1000",
},
}
- {
name: "Core4mb",
env: "m5stack-core4mb",
partitions: {
bootloader_addr: "0x1000",
},
}
steps:
- uses: actions/checkout@v4

Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"bitset": "cpp",
"complex": "cpp",
"ctime": "cpp",
"regex": "cpp"
"regex": "cpp",
"list": "cpp"
}
}
8 changes: 7 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ esptool --chip esp32s3 merge_bin --output Bruce3_Cardputer.bin 0x0 .pio\build\m5

esptool --chip esp32 merge_bin --output Bruce3_cplus2.bin 0x1000 .pio\build\m5stack-cplus2\bootloader.bin 0x8000 .pio\build\m5stack-cplus2\partitions.bin 0x10000 .pio\build\m5stack-cplus2\firmware.bin

esptool --chip esp32 merge_bin --output Bruce3_cplus1_1.bin 0x1000 .pio\build\m5stack-cplus1_1\bootloader.bin 0x8000 .pio\build\m5stack-cplus1_1\partitions.bin 0x10000 .pio\build\m5stack-cplus1_1\firmware.bin
esptool --chip esp32 merge_bin --output Bruce3_cplus1_1.bin 0x1000 .pio\build\m5stack-cplus1_1\bootloader.bin 0x8000 .pio\build\m5stack-cplus1_1\partitions.bin 0x10000 .pio\build\m5stack-cplus1_1\firmware.bin

esptool --chip esp32 merge_bin --output Bruce3_core2.bin 0x1000 .pio/build/m5stack-core2/bootloader.bin 0x8000 .pio/build/m5stack-core2/partitions.bin 0x10000 .pio/build/m5stack-core2/firmware.bin

esptool --chip esp32 merge_bin --output Bruce3_core.bin 0x1000 .pio/build/m5stack-core/bootloader.bin 0x8000 .pio/build/m5stack-core/partitions.bin 0x10000 .pio/build/m5stack-core/firmware.bin

esptool --chip esp32 merge_bin --output Bruce3_core4mb.bin 0x1000 .pio/build/m5stack-core4mb/bootloader.bin 0x8000 .pio/build/m5stack-core4mb/partitions.bin 0x10000 .pio/build/m5stack-core4mb/firmware.bin
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ ESPTOOL=$([[ -f $ESPTOOL_PATH/esptool.py ]] && echo "$ESPTOOL_PATH/esptool.py" |
$ESPTOOL --chip esp32s3 merge_bin --output Bruce3_Cardputer.bin 0x0 .pio/build/m5stack-cardputer/bootloader.bin 0x8000 .pio/build/m5stack-cardputer/partitions.bin 0x10000 .pio/build/m5stack-cardputer/firmware.bin
$ESPTOOL --chip esp32 merge_bin --output Bruce3_cplus2.bin 0x1000 .pio/build/m5stack-cplus2/bootloader.bin 0x8000 .pio/build/m5stack-cplus2/partitions.bin 0x10000 .pio/build/m5stack-cplus2/firmware.bin
$ESPTOOL --chip esp32 merge_bin --output Bruce3_cplus1_1.bin 0x1000 .pio/build/m5stack-cplus1_1/bootloader.bin 0x8000 .pio/build/m5stack-cplus1_1/partitions.bin 0x10000 .pio/build/m5stack-cplus1_1/firmware.bin
$ESPTOOL --chip esp32 merge_bin --output Bruce3_core2.bin 0x1000 .pio/build/m5stack-core2/bootloader.bin 0x8000 .pio/build/m5stack-core2/partitions.bin 0x10000 .pio/build/m5stack-core2/firmware.bin
$ESPTOOL --chip esp32 merge_bin --output Bruce3_core16mb.bin 0x1000 .pio/build/m5stack-core16mb/bootloader.bin 0x8000 .pio/build/m5stack-core16mb/partitions.bin 0x10000 .pio/build/m5stack-core16mb/firmware.bin
$ESPTOOL --chip esp32 merge_bin --output Bruce3_core4mb.bin 0x1000 .pio/build/m5stack-core4mb/bootloader.bin 0x8000 .pio/build/m5stack-core4mb/partitions.bin 0x10000 .pio/build/m5stack-core4mb/firmware.bin
5 changes: 5 additions & 0 deletions custom_16Mb.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
app0, app, ota_0, 0x10000, 0x470000,
spiffs, data, spiffs, 0x480000, 0xB70000,
coredump, data, coredump, 0xFF0000, 0x10000,
10 changes: 5 additions & 5 deletions html/AsyncWebServer/webInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,17 @@ file_size = 0;

drawMainBorder();
setTftDisplay(0,0,ALCOLOR,FM);
tft.drawCentreString("BRUCE WebUI",tft.width()/2,7,1);
tft.drawCentreString("BRUCE WebUI",WIDTH/2,7,1);
String txt;
if(!mode_ap) txt = WiFi.localIP().toString();
else txt = WiFi.softAPIP().toString();
tft.setTextColor(FGCOLOR);

#ifndef STICK_C
tft.drawCentreString("http://bruce.local", tft.width()/2,25,1);
tft.drawCentreString("http://bruce.local", WIDTH/2,25,1);
setTftDisplay(7,47);
#else
tft.drawCentreString("http://bruce.local", tft.width()/2,17,1);
tft.drawCentreString("http://bruce.local", WIDTH/2,17,1);
setTftDisplay(7,26);
#endif
tft.setTextSize(FM);
Expand All @@ -433,9 +433,9 @@ file_size = 0;
tft.setTextSize(FP);

#ifdef CARDPUTER
tft.drawCentreString("press Esc to stop", tft.width()/2,tft.height()-15,1);
tft.drawCentreString("press Esc to stop", WIDTH/2,HEIGHT-15,1);
#else
tft.drawCentreString("press Pwr to stop", tft.width()/2,tft.height()-15,1);
tft.drawCentreString("press Pwr to stop", WIDTH/2,HEIGHT-15,1);
#endif

disableCore0WDT();
Expand Down
6 changes: 3 additions & 3 deletions html/WebServer/evil_portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void startEvilPortal(String tssid, uint8_t channel, bool deauth) {

tft.setTextSize(FM);
tft.setTextColor(TFT_RED);
tft.drawCentreString("Evil Portal",tft.width()/2, 29, SMOOTH_FONT);
tft.drawCentreString("Evil Portal",WIDTH/2, 29, SMOOTH_FONT);
tft.setCursor(8,46);
tft.setTextColor(FGCOLOR);
tft.println("AP: " + AP_name);
Expand All @@ -139,11 +139,11 @@ void startEvilPortal(String tssid, uint8_t channel, bool deauth) {
if (hold_deauth) {
tft.setTextSize(FP);
tft.setTextColor(FGCOLOR);
tft.drawRightString("Deauth OFF", tft.width()-6,tft.height()-8,SMOOTH_FONT);
tft.drawRightString("Deauth OFF", WIDTH-6,HEIGHT-8,SMOOTH_FONT);
} else {
tft.setTextSize(FP);
tft.setTextColor(TFT_RED);
tft.drawRightString("Deauth ON", tft.width()-6,tft.height()-8,SMOOTH_FONT);
tft.drawRightString("Deauth ON", WIDTH-6,HEIGHT-8,SMOOTH_FONT);
}
}

Expand Down
10 changes: 5 additions & 5 deletions html/WebServer/webInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,17 +418,17 @@ void startWebUi(bool mode_ap) {
tft.fillScreen(BGCOLOR);
tft.drawSmoothRoundRect(5,5,5,5,WIDTH-10,HEIGHT-10,ALCOLOR,BGCOLOR);
setTftDisplay(0,0,ALCOLOR,FM);
tft.drawCentreString("BRUCE WebUI",tft.width()/2,7,1);
tft.drawCentreString("BRUCE WebUI",WIDTH/2,7,1);
String txt;
if(!mode_ap) txt = WiFi.localIP().toString();
else txt = WiFi.softAPIP().toString();
tft.setTextColor(FGCOLOR);

#ifndef STICK_C
tft.drawCentreString("http://bruce.local", tft.width()/2,25,1);
tft.drawCentreString("http://bruce.local", WIDTH/2,25,1);
setTftDisplay(7,47);
#else
tft.drawCentreString("http://bruce.local", tft.width()/2,17,1);
tft.drawCentreString("http://bruce.local", WIDTH/2,17,1);
setTftDisplay(7,26);
#endif
tft.setTextSize(FM);
Expand All @@ -442,9 +442,9 @@ void startWebUi(bool mode_ap) {
tft.setTextSize(FP);

#ifdef CARDPUTER
tft.drawCentreString("press Esc to stop", tft.width()/2,tft.height()-15,1);
tft.drawCentreString("press Esc to stop", WIDTH/2,HEIGHT-15,1);
#else
tft.drawCentreString("press Pwr to stop", tft.width()/2,tft.height()-15,1);
tft.drawCentreString("press Pwr to stop", WIDTH/2,HEIGHT-15,1);
#endif

disableCore0WDT();
Expand Down
33 changes: 33 additions & 0 deletions lib/M5GFX/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
set(COMPONENT_ADD_INCLUDEDIRS
src
)
file(GLOB SRCS
src/*.cpp
src/lgfx/Fonts/efont/*.c
src/lgfx/Fonts/IPA/*.c
src/lgfx/utility/*.c
src/lgfx/v1/*.cpp
src/lgfx/v1/misc/*.cpp
src/lgfx/v1/panel/*.cpp
src/lgfx/v1/platforms/esp32/*.cpp
src/lgfx/v1/platforms/esp32c3/*.cpp
src/lgfx/v1/platforms/esp32s3/*.cpp
src/lgfx/v1/touch/*.cpp
)
set(COMPONENT_SRCS ${SRCS})

if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
set(COMPONENT_REQUIRES nvs_flash efuse driver esp_timer)
elseif ((IDF_VERSION_MAJOR EQUAL 4) AND (IDF_VERSION_MINOR GREATER 3) OR IDF_VERSION_MAJOR GREATER 4)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd)
else()
set(COMPONENT_REQUIRES nvs_flash efuse)
endif()

### If you use arduino-esp32 components, please activate next comment line.
# list(APPEND COMPONENT_REQUIRES arduino-esp32)


message(STATUS "M5GFX use components = ${COMPONENT_REQUIRES}")

register_component()
21 changes: 21 additions & 0 deletions lib/M5GFX/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 M5Stack

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.
49 changes: 49 additions & 0 deletions lib/M5GFX/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# M5GFX

Graphics library for M5Stack series

Supported framework
----------------
- ESP-IDF
- Arduino for ESP32


Supported device
----------------
- M5Stack ( Basic / Gray / GO / Fire )
- M5Stack Core2
- M5Stack CoreInk
- M5Stick C
- M5Stick C Plus
- M5Stick C Plus2
- M5Paper
- M5Tough
- M5Station
- M5ATOMS3
- M5Dial
- M5DinMeter
- M5Cardputer
- UnitOLED
- UnitMiniOLED
- UnitLCD
- [UnitRCA / ModuleRCA](docs/UnitRCA.md)
- [UnitGLASS](docs/UnitGLASS.md)
- UnitGLASS2
- [AtomDisplay](docs/ATOMDisplay.md) / ModuleDisplay


License
----------------
M5GFX : [MIT](LICENSE)
LovyanGFX : [FreeBSD](https://github.com/lovyan03/LovyanGFX/blob/master/license.txt) lovyan03
TJpgDec : [original](src/lgfx/utility/lgfx_tjpgd.c) ChaN
Pngle : [MIT](https://github.com/kikuchan/pngle/blob/master/LICENSE) kikuchan
QRCode : [MIT](https://github.com/ricmoo/QRCode/blob/master/LICENSE.txt) Richard Moore and Nayuki
result : [MIT](https://github.com/bitwizeshift/result/blob/master/LICENSE) Matthew Rodusek
GFX font and GLCD font : [2-clause BSD](https://github.com/adafruit/Adafruit-GFX-Library/blob/master/license.txt) Adafruit Industries
Font 2,4,6,7,8 : [FreeBSD](https://github.com/Bodmer/TFT_eSPI/blob/master/license.txt) Bodmer
converted IPA font : [IPA Font License](src/lgfx/Fonts/IPA/IPA_Font_License_Agreement_v1.0.txt) IPA
efont : [3-clause BSD](src/lgfx/Fonts/efont/COPYRIGHT.txt) The Electronic Font Open Laboratory
TomThumb font : [3-clause BSD](src/lgfx/Fonts/GFXFF/TomThumb.h) Brian J. Swetland / Vassilii Khachaturov / Dan Marks


7 changes: 7 additions & 0 deletions lib/M5GFX/component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Main Makefile. This is basically the same as a component makefile.
#
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)

COMPONENT_SRCDIRS := src
COMPONENT_ADD_INCLUDEDIRS := src
5 changes: 5 additions & 0 deletions lib/M5GFX/idf_component.yml.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Graphics library for M5Stack series
issues: https://github.com/m5stack/M5GFX/issues
repository: https://github.com/m5stack/M5GFX.git
url: https://github.com/m5stack/M5GFX.git
version: 0.1.15
17 changes: 17 additions & 0 deletions lib/M5GFX/library.json.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "M5GFX",
"description": "Library for M5Stack All Display",
"keywords": "M5GFX,M5Stack,M5StackCore2,M5StackCoreInk,M5StickC,M5StickC-Plus,M5Paper,M5Tough,M5Station,M5ATOMS3,UnitOLED,UnitLCD,UnitRCA,ATOMDisplay",
"authors": {
"name": "M5Stack, lovyan03",
"url": "http://www.m5stack.com"
},
"repository": {
"type": "git",
"url": "https://github.com/m5stack/M5GFX.git"
},
"version": "0.1.16",
"frameworks": ["arduino", "espidf", "*"],
"platforms": ["espressif32", "native"],
"headers": "M5GFX.h"
}
10 changes: 10 additions & 0 deletions lib/M5GFX/library.properties.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name=M5GFX
version=0.1.16
author=M5Stack
maintainer=M5Stack
sentence=Library for M5Stack All Display
paragraph=M5Stack, M5Stack Core2, M5Stack CoreInk, M5StickC, M5StickC-Plus, M5Paper, M5Tough, M5Station, M5ATOMS3, Unit OLED, Unit LCD, Unit RCA, ATOM Display, See more on http://M5Stack.com
category=Display
url=https://github.com/m5stack/M5GFX.git
architectures=esp32
includes=M5GFX.h
Loading

0 comments on commit 941be1d

Please sign in to comment.