Skip to content

Commit 6fcce8b

Browse files
committed
broke between
1 parent a3d6f60 commit 6fcce8b

17 files changed

+215
-80
lines changed

build.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,43 @@
11
#!/bin/sh
2+
project_name="genericInstaller"
3+
24
if [ -z "$1" ]; then
35
echo "Usage: sh build.sh <device>"
46
echo "esp32 is the default device"
57
exit 1
68
fi
9+
710
device_name=$(echo $1 | tr '[:lower:]' '[:upper:]')
8-
tft_config_file="tft_config_$1.txt"
9-
if [ -f "$tft_config_file" ]; then
10-
user_tft_config=$(cat $tft_config_file | tr '\n' ' ' | sed -e "s/\ /\ -D/g" -e "s/-D$//")
11-
tft_font="-DLOAD_GLCD=1 -DLOAD_FONT2=1 -DLOAD_FONT4=1 -DLOAD_FONT6=1 -DLOAD_FONT7=1 -DLOAD_FONT8=1 -DLOAD_GFXFF=1 -DSMOOTH_FONT=1"
12-
tft_config=" -DTFT=1 -DUSER_SETUP_LOADED=1 -D${user_tft_config} ${tft_font}"
11+
config_file="./devices/$1.txt"
12+
13+
if [ ! -f "$config_file" ]; then
14+
echo "Config file $config_file does not exist."
15+
exit 1
1316
fi
1417

18+
device_config=$(cat $config_file | tr '\n' ' ' | sed -e "s/\ /\ -D/g" -e "s/-D$//")
19+
1520
# works for tdisplay and esp32 devmodule
1621
board="esp32:esp32:ttgo-lora32"
17-
flags="build.extra_flags.esp32=-DARDUINO_USB_CDC_ON_BOOT=0"
22+
flags="build.extra_flags.esp32="
1823

1924
# if tdisplay_s3 use esp32s3 board
2025
if [ "$1" = "tdisplay_s3" ]; then
2126
board="esp32:esp32:lilygo_t_display_s3"
22-
flags="build.extra_flags.esp32s3=-DARDUINO_USB_MODE={build.usb_mode} -DARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot} -DARDUINO_USB_MSC_ON_BOOT={build.msc_on_boot} -DARDUINO_USB_DFU_ON_BOOT={build.dfu_on_boot}"
27+
flags="build.extra_flags.esp32s3="
28+
fi
29+
30+
if [ "$1" = "guition_s3" ]; then
31+
board="esp32:esp32:lilygo_t_display_s3"
32+
flags="build.extra_flags.esp32s3="
2333
fi
2434

25-
extra_flags="${flags} -D${device_name}=1${tft_config}"
35+
extra_flags="${flags}-D${device_config}"
2636
echo "Extra build flags: ${extra_flags}"
2737

2838
arduino-cli compile \
2939
--build-property "build.partitions=min_spiffs" \
3040
--build-property "upload.maximum_size=1966080" \
3141
--build-property "${extra_flags}" \
3242
--build-path build \
33-
--fqbn $board genericInstaller
43+
--fqbn $board $project_name

debug.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ if [ "$2" = "tdisplay_s3" ]; then
77
board="esp32:esp32:lilygo_t_display_s3"
88
echo -e "\033[0;33mHOLD BOOT BUTTON AND RESET DEVICE TO UPLOAD!\033[0m"
99
fi
10+
if [ "$2" = "guition_s3" ]; then
11+
board="esp32:esp32:lilygo_t_display_s3"
12+
fi
1013
sh build.sh $2 && \
1114
arduino-cli upload --input-dir build --fqbn $board -p $1 && \
1215
arduino-cli monitor --fqbn $board -p $1 -c baudrate=115200

devices/esp32.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ESP32=1
2+
ARDUINO_USB_CDC_ON_BOOT=0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
ESP32_3248s035=1
2+
TFT=1
3+
TOUCH=1
4+
USER_SETUP_LOADED=1
15
ST7796_DRIVER=1
26
TFT_WIDTH=320
37
TFT_HEIGHT=480
@@ -11,6 +15,14 @@ TFT_RST=-1
1115
TFT_BL=27
1216
TFT_RGB_ORDER=TFT_BGR
1317
TFT_INVERSION_OFF=1
18+
LOAD_GLCD=1
19+
LOAD_FONT2=1
20+
LOAD_FONT4=1
21+
LOAD_FONT6=1
22+
LOAD_FONT7=1
23+
LOAD_FONT8=1
24+
LOAD_GFXFF=1
25+
SMOOTH_FONT=1
1426
SPI_FREQUENCY=55000000
1527
SPI_READ_FREQUENCY=20000000
1628
TOUCH_IRQ=36
@@ -19,3 +31,5 @@ TOUCH_MISO=39
1931
TOUCH_CLK=25
2032
TOUCH_CS=33
2133
SPI_TOUCH_FREQUENCY=2500000
34+
TOUCH_WIDTH=320
35+
TOUCH_HEIGHT=480

devices/guition_s3.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
GUITION_S3=1
2+
TFT=1
3+
USER_SETUP_LOADED=1
4+
ST7789_DRIVER=1
5+
INIT_SEQUENCE_3=1
6+
CGRAM_OFFSET=1
7+
TFT_INVERSION_ON=1
8+
TFT_WIDTH=320
9+
TFT_HEIGHT=480
10+
TFT_PARALLEL_8_BIT=1
11+
TFT_CS=6
12+
TFT_DC=7
13+
TFT_RST=5
14+
TFT_WR=8
15+
TFT_RD=9
16+
TFT_D0=39
17+
TFT_D1=40
18+
TFT_D2=41
19+
TFT_D3=42
20+
TFT_D4=45
21+
TFT_D5=46
22+
TFT_D6=47
23+
TFT_D7=48
24+
TFT_BL=38
25+
TFT_BACKLIGHT_ON=1
26+
TFT_RGB_ORDER=TFT_RGB
27+
LOAD_GLCD=1
28+
LOAD_FONT2=1
29+
LOAD_FONT4=1
30+
LOAD_FONT6=1
31+
LOAD_FONT7=1
32+
LOAD_FONT8=1
33+
LOAD_GFXFF=1
34+
SMOOTH_FONT=1
35+
ARDUINO_USB_MODE={build.usb_mode}
36+
ARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot}
37+
ARDUINO_USB_MSC_ON_BOOT={build.msc_on_boot}
38+
ARDUINO_USB_DFU_ON_BOOT={build.dfu_on_boot}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
TDISPLAY=1
2+
TFT=1
3+
USER_SETUP_LOADED=1
14
ST7789_DRIVER=1
25
CGRAM_OFFSET=1
36
TFT_WIDTH=135
@@ -10,5 +13,13 @@ TFT_DC=16
1013
TFT_RST=23
1114
TFT_BL=4
1215
TFT_BACKLIGHT_ON=1
16+
LOAD_GLCD=1
17+
LOAD_FONT2=1
18+
LOAD_FONT4=1
19+
LOAD_FONT6=1
20+
LOAD_FONT7=1
21+
LOAD_FONT8=1
22+
LOAD_GFXFF=1
23+
SMOOTH_FONT=1
1324
SPI_FREQUENCY=27000000
1425
SPI_READ_FREQUENCY=20000000

devices/tdisplay_s3.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
TDISPLAY_S3=1
2+
TFT=1
3+
USER_SETUP_LOADED=1
4+
ST7789_DRIVER=1
5+
INIT_SEQUENCE_3=1
6+
CGRAM_OFFSET=1
7+
TFT_INVERSION_ON=1
8+
TFT_WIDTH=170
9+
TFT_HEIGHT=320
10+
TFT_PARALLEL_8_BIT=1
11+
TFT_CS=6
12+
TFT_DC=7
13+
TFT_RST=5
14+
TFT_WR=8
15+
TFT_RD=9
16+
TFT_D0=39
17+
TFT_D1=40
18+
TFT_D2=41
19+
TFT_D3=42
20+
TFT_D4=45
21+
TFT_D5=46
22+
TFT_D6=47
23+
TFT_D7=48
24+
TFT_BL=38
25+
TFT_BACKLIGHT_ON=1
26+
TFT_RGB_ORDER=TFT_RGB
27+
LOAD_GLCD=1
28+
LOAD_FONT2=1
29+
LOAD_FONT4=1
30+
LOAD_FONT6=1
31+
LOAD_FONT7=1
32+
LOAD_FONT8=1
33+
LOAD_GFXFF=1
34+
SMOOTH_FONT=1
35+
ARDUINO_USB_MODE={build.usb_mode}
36+
ARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot}
37+
ARDUINO_USB_MSC_ON_BOOT={build.msc_on_boot}
38+
ARDUINO_USB_DFU_ON_BOOT={build.dfu_on_boot}

genericInstaller/410_touch.ino

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
#include "config.h"
22

33
void setupTouch() {
4+
#ifdef TOUCH
45
uint16_t touchCalibration[5] = { 344, 3356, 242, 3616, 4 };
56
// uint16_t touchCalibration[5] = { 286, 3534, 283, 3600, 6 };
67
tft.setTouch(touchCalibration);
78
Serial.println("Touch initialised");
9+
#endif
810
}
911

1012
void loopTouch() {
11-
if (tft.getTouch(&touchX, &touchY)) {
12-
Serial.printf("Touch: %d, %d, %d\n", touchX, touchY, tft.getTouchRawZ());
13-
}
13+
#ifdef TOUCH
14+
if (tft.getTouch(&touchX, &touchY)) {
15+
Serial.printf("Touch: %d, %d, %d\n", touchX, touchY, tft.getTouchRawZ());
16+
}
17+
#endif
1418
}

package-lock.json

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"author": "",
1111
"license": "MIT",
1212
"dependencies": {
13-
"esptool-js": "^0.3.1",
13+
"esptool-js": "^0.5.7",
1414
"marked": "^9.1.4",
1515
"solid-js": "^1.8.4",
1616
"xterm": "^5.3.0"

0 commit comments

Comments
 (0)