Skip to content

Commit

Permalink
new pr: squashing commits of dev-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rouing committed Dec 22, 2024
1 parent 966b7f1 commit 6268c5f
Show file tree
Hide file tree
Showing 158 changed files with 2,455 additions and 2,624 deletions.
42 changes: 21 additions & 21 deletions ports/CYD-2432S028/platformio.ini → boards/CYD-2432S028.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@

##################################### CYD MODELS ####################################################
[env:CYD-2432S028]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip
board = esp32dev
board = CYD-2432S028
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
framework = arduino
board_build.partitions = custom_4Mb_full.csv
build_src_filter =${env.build_src_filter} +<../ports/CYD-2432S028>
build_src_filter =${env.build_src_filter} +<../boards/CYD-2432S028>
build_flags =
${env.build_flags}
-Iports/CYD-2432S028
-Iboards/CYD-2432S028
-Os
-DCORE_DEBUG_LEVEL=5
;-DARDUINO_USB_CDC_ON_BOOT=1 ; Used only in ESP32-S3 to make Serial Comands work
Expand Down Expand Up @@ -112,15 +109,15 @@ build_flags =
;Screen Setup
-DHAS_SCREEN=1
-DROTATION=1
-DWIDTH=320
-DHEIGHT=220 ;240-20 lower margin
-DBACKLIGHT=21
-DMINBRIGHT=160

;TFT_eSPI Setup
-DUSER_SETUP_LOADED=1
-DILI9341_2_DRIVER=1
-DUSE_HSPI_PORT=1
-DTFT_HEIGHT=320
-DTFT_WIDTH=220 ;240-20 lower margin
-DTFT_MISO=12
-DTFT_MOSI=13
-DTFT_SCLK=14
Expand Down Expand Up @@ -174,6 +171,15 @@ build_flags =
${env:CYD-2432S028.build_flags}
-DTFT_INVERSION_ON

[env:LAUNCHER_CYD-2USB]
extends=env:CYD-2432S028
build_flags =
${env:CYD-2432S028.build_flags}
-DTFT_INVERSION_ON
-DLITE_VERSION=1



[env:CYD-2432W328C]
extends = env:CYD-2432S028
build_flags =
Expand All @@ -185,6 +191,13 @@ build_flags =
-DSPI_TOUCH_FREQUENCY=2500000
-DHAS_CAPACITIVE_TOUCH=1

[env:LAUNCHER_CYD-2432S028]
extends=env:CYD-2432S028
build_flags =
${env:CYD-2432S028.build_flags}
-DLITE_VERSION=1


[env:CYD-2432W328C_2] # commom to CYD-2432S024 Capacitive board
extends = env:CYD-2432S028
build_flags =
Expand All @@ -196,19 +209,6 @@ build_flags =
-DSPI_TOUCH_FREQUENCY=2500000
-DHAS_CAPACITIVE_TOUCH=1

[env:LAUNCHER_CYD-2432S028]
extends=env:CYD-2432S028
build_flags =
${env:CYD-2432S028.build_flags}
-DLITE_VERSION=1

[env:LAUNCHER_CYD-2USB]
extends=env:CYD-2432S028
build_flags =
${env:CYD-2432S028.build_flags}
-DTFT_INVERSION_ON
-DLITE_VERSION=1

[env:LAUNCHER_CYD-2432W328C]
extends=env:CYD-2432S028
build_flags =
Expand Down
40 changes: 40 additions & 0 deletions boards/CYD-2432S028.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"build": {
"arduino": {
"ldscript": "esp32_out.ld"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32_DEV",
"-DCYD_2432S028"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "pinouts"
},
"connectivity": [
"wifi",
"bluetooth",
"ethernet",
"can"
],
"debug": {
"openocd_board": "esp-wroom-32.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32 Dev Module",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,19 @@ bool menuPress(int bot) {
//0 - prev
//1 - Sel
//2 - next
int terco=WIDTH/3;
int terco=tftWidth/3;
if (touch.touched()) { //touch.tirqTouched() &&
auto t = touch.getPointScaled();
t = touch.getPointScaled();
//log_i("Touchscreen Pressed at x=%d, y=%d, z=%d", t.x,t.y,t.z);
if(bruceConfig.rotation==3) {
t.y = (HEIGHT+20)-t.y;
t.x = WIDTH-t.x;
t.y = (tftHeight+20)-t.y;
t.x = tftWidth-t.x;
}

if(t.y>(HEIGHT) && ((t.x>terco*bot && t.x<terco*(1+bot)) || bot==ALL)) {
t.x=WIDTH+1;
t.y=HEIGHT+11;
if(t.y>(tftHeight) && ((t.x>terco*bot && t.x<terco*(1+bot)) || bot==ALL)) {
t.x=tftWidth+1;
t.y=tftHeight+11;
return true;
} else return false;
} else return false;
Expand Down Expand Up @@ -294,8 +294,8 @@ String keyboard(String mytext, int maxSize, String msg) {
{ '/', '/' } //12
}
};
int _x = WIDTH/12;
int _y = (HEIGHT - 54)/4;
int _x = tftWidth/12;
int _y = (tftHeight - 54)/4;
int _xo = _x/2-3;

int k=0;
Expand Down Expand Up @@ -344,7 +344,7 @@ String keyboard(String mytext, int maxSize, String msg) {
box_list[k].color = ~bruceConfig.bgColor;
box_list[k].x=159;
box_list[k].y=0;
box_list[k].w=WIDTH-164;
box_list[k].w=tftWidth-164;
box_list[k].h=22;

k=0;
Expand All @@ -366,12 +366,12 @@ String keyboard(String mytext, int maxSize, String msg) {

//Draw the rectangles
if(y<0) {
tft.fillRect(0,1,WIDTH,22,bruceConfig.bgColor);
tft.fillRect(0,1,tftWidth,22,bruceConfig.bgColor);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
tft.drawRect(107,2,50,20,TFT_WHITE); // DEL Rectangle
tft.drawRect(159,2,74,20,TFT_WHITE); // SPACE Rectangle
tft.drawRect(3,32,WIDTH-3,20,bruceConfig.priColor); // mystring Rectangle
tft.drawRect(3,32,tftWidth-3,20,bruceConfig.priColor); // mystring Rectangle


if(x==0 && y==-1) { tft.setTextColor(bruceConfig.bgColor, TFT_WHITE); tft.fillRect(7,2,50,20,TFT_WHITE); }
Expand Down Expand Up @@ -401,7 +401,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

// reseta o quadrado do texto
if (mytext.length() == 19 || mytext.length() == 20 || mytext.length() == 38 || mytext.length() == 39) tft.fillRect(3,32,WIDTH-3,20,bruceConfig.bgColor); // mystring Rectangle
if (mytext.length() == 19 || mytext.length() == 20 || mytext.length() == 38 || mytext.length() == 39) tft.fillRect(3,32,tftWidth-3,20,bruceConfig.bgColor); // mystring Rectangle
// escreve o texto
tft.setTextColor(TFT_WHITE);
if(mytext.length()>19) {
Expand All @@ -417,7 +417,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.drawString(mytext, 5, 34);
}
//desenha o retangulo colorido
tft.drawRect(3,32,WIDTH-3,20,bruceConfig.priColor); // mystring Rectangle
tft.drawRect(3,32,tftWidth-3,20,bruceConfig.priColor); // mystring Rectangle


tft.setTextColor(TFT_WHITE, bruceConfig.bgColor);
Expand Down Expand Up @@ -469,11 +469,11 @@ String keyboard(String mytext, int maxSize, String msg) {

auto t = touch.getPointScaled();
if(bruceConfig.rotation==3) {
t.y = (HEIGHT+20)-t.y;
t.x = WIDTH-t.x;
t.y = (tftHeight+20)-t.y;
t.x = tftWidth-t.x;
}
if (box_list[48].contain(t.x, t.y)) { break; } // Ok
if (box_list[49].contain(t.x, t.y)) { caps=!caps; tft.fillRect(0,54,WIDTH,HEIGHT-54,bruceConfig.bgColor); goto THIS_END; } // CAP
if (box_list[49].contain(t.x, t.y)) { caps=!caps; tft.fillRect(0,54,tftWidth,tftHeight-54,bruceConfig.bgColor); goto THIS_END; } // CAP
if (box_list[50].contain(t.x, t.y)) goto DEL; // DEL
if (box_list[51].contain(t.x, t.y)) { mytext += box_list[51].key; goto ADD; } // SPACE
for(k=0;k<48;k++){
Expand Down Expand Up @@ -544,7 +544,7 @@ String keyboard(String mytext, int maxSize, String msg) {
}

//Resets screen when finished writing
tft.fillRect(0,0,WIDTH,HEIGHT,bruceConfig.bgColor);
tft.fillRect(0,0,tftWidth,tftHeight,bruceConfig.bgColor);
resetTftDisplay();

return mytext;
Expand Down
15 changes: 3 additions & 12 deletions ports/ESP-General/platformio.ini → boards/ESP-General.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,12 @@ extends = env:esp32-s3-devkitc-1


[env:esp32-s3-devkitc-1]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip
board = esp32-s3-devkitc-1
framework = arduino
build_src_filter =${env.build_src_filter} +<../ports/ESP-General>
board = ESP-General
build_src_filter =${env.build_src_filter} +<../boards/ESP-General>
build_flags =
${env.build_flags}
-Iports/ESP-General
-DESP32S3DEVKITC1
-Iboards/ESP-General
-DUSB_as_HID=1
; needed for serial
-DARDUINO_USB_CDC_ON_BOOT=1
-DBOARD_HAS_PSRAM

; grove pins
; defaults from https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h
-DGROVE_SDA=8 ; default RF TX pin
Expand Down Expand Up @@ -64,8 +57,6 @@ build_flags =
; tft vars
-DROTATION=1
-DBACKLIGHT=-1 ; tft backlight pin
-DWIDTH=240
-DHEIGHT=135
-DMINBRIGHT=160 ; unused?
-DSMOOTH_FONT=1
-DTFT_DISPON=0x29
Expand Down
53 changes: 53 additions & 0 deletions boards/ESP-General.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DESP32S3DEVKITC1",
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "pinouts"
},
"connectivity": [
"bluetooth",
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM)",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
"vendor": "Espressif"
}
File renamed without changes.
25 changes: 25 additions & 0 deletions boards/_New-Device-Model.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:NewDeviceModel]
board = _New-Device-Model
board_build.partitions = custom_8Mb.csv
build_flags =
${env.build_flags}
-Iboards/_New-Device-Model
-Os
-DCORE_DEBUG_LEVEL=5
;-DARDUINO_USB_CDC_ON_BOOT=1 ; Used only in ESP32-S3 to make Serial Comands work



lib_deps =
${env.lib_deps}
xylopyrographer/LiteLED@^1.2.0
47 changes: 47 additions & 0 deletions boards/_New-Device-Model.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DNEW_DEVICE", // Device Flag
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "m5stack_stamp_s3"
},
"connectivity": [
"bluetooth",
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "M5Stack StampS3",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.m5stack.com/en/core/StampS3",
"vendor": "M5Stack"
}
File renamed without changes.
Loading

0 comments on commit 6268c5f

Please sign in to comment.