same spiffs location for arduino ide and travis build, second attempt; +tft orientation config

This commit is contained in:
Hansi, dl9rdz 2019-10-27 15:36:25 +01:00
parent 84b3357fa0
commit 4314e8f23f
8 changed files with 54 additions and 7 deletions

View File

@ -47,8 +47,7 @@ script:
- arduino --board esp32:esp32:t-beam --verify $PWD/RX_FSK/RX_FSK.ino
- find build
- find /home/travis/.arduino15/packages/esp32/hardware/esp32/
- $MKSPIFFS -c $PWD/RX_FSK/data -b 4096 -p 256 -s 1503232 $PWD/spiffs.bin
- $PWD/scripts/makeimage.py $ESP32TOOLS $PWD/build/RX_FSK.ino.bin $PWD/spiffs.bin $PWD/out.bin
- $PWD/scripts/makeimage.py $ESP32TOOLS $PWD/build/RX_FSK.ino.bin $PWD/RX_FSK/data $PWD/out.bin
after_success:
- .travis/push.sh
notifications:

View File

@ -431,6 +431,7 @@ struct st_configitems config_list[] = {
{"oled_rst", "OLED RST/TFT RST (needs reboot)", 0, &sonde.config.oled_rst},
{"tft_rs", "TFT RS", 0, &sonde.config.tft_rs},
{"tft_cs", "TFT CS", 0, &sonde.config.tft_cs},
{"tft_orient", "TFT orientation (0/1/2/3)", 0, &sonde.config.tft_orient},
{"button_pin", "Button input port", -4, &sonde.config.button_pin},
{"button2_pin", "Button 2 input port", -4, &sonde.config.button2_pin},
{"touch_thresh", "Touch button threshold", 0, &sonde.config.touch_thresh},

View File

@ -23,6 +23,7 @@ led_pout=9
#oled_rst=16
#tft_rs=2
#tft_cs=0
tft_orient=1
#gps_rxd=-1
gps_txd=-1
#-------------------------------#

View File

@ -1,2 +1,2 @@
const char *version_name = "rdzTTGOsonde";
const char *version_id = "devel20191026";
const char *version_id = "devel20191027";

View File

@ -318,7 +318,7 @@ void ILI9225Display::begin() {
tft = new MY_ILI9225(sonde.config.oled_rst, sonde.config.tft_rs, sonde.config.tft_cs,
sonde.config.oled_sda, sonde.config.oled_scl, TFT_LED, TFT_BRIGHTNESS);
tft->begin(spiDisp);
tft->setOrientation(1);
tft->setOrientation(sonde.config.tft_orient);
}
void ILI9225Display::clear() {

View File

@ -75,6 +75,7 @@ void Sonde::defaultConfig() {
config.gps_txd = -1;
config.oled_rst = 16;
config.disptype = 0;
config.tft_orient = 1;
if(initlevels[16]==0) {
config.oled_sda = 4;
config.oled_scl = 15;
@ -89,7 +90,7 @@ void Sonde::defaultConfig() {
if(initlevels[12]==0) { // T-Beam v1.0
Serial.println("Autoconfig: looks like T-Beam 1.0 board");
config.button_pin = 38;
config.button2_pin = -1; //T4 + 128; // T4 = GPIO13
config.button2_pin = 15 + 128; //T4 + 128; // T4 = GPIO13
config.gps_rxd = 34;
// Check for I2C-Display@21,22
#define SSD1306_ADDRESS 0x3c
@ -213,6 +214,8 @@ void Sonde::setConfig(const char *cfg) {
config.tft_rs = atoi(val);
} else if(strcmp(cfg,"tft_cs")==0) {
config.tft_cs = atoi(val);
} else if(strcmp(cfg,"tft_orient")==0) {
config.tft_orient = atoi(val);
} else if(strcmp(cfg,"gps_rxd")==0) {
config.gps_rxd = atoi(val);
} else if(strcmp(cfg,"gps_txd")==0) {

View File

@ -96,6 +96,7 @@ typedef struct st_rdzconfig {
int oled_rst; // OLED/TFT reset pin
int tft_rs; // TFT RS pin
int tft_cs; // TFT CS pin
int tft_orient; // TFT orientation (default: 1)
int gps_rxd; // GPS module RXD pin. We expect 9600 baud NMEA data.
int gps_txd; // GPS module TXD pin
// software configuration

View File

@ -1,20 +1,62 @@
#!/usr/bin/python
import os
import sys
import csv
import subprocess
#default.csv content:
#nvs, data, nvs, 0x9000, 0x5000,
#otadata, data, ota, 0xe000, 0x2000,
#app0, app, ota_0, 0x10000, 0x140000,
#app1, app, ota_1, 0x150000,0x140000,
#spiffs, data, spiffs, 0x290000,0x170000,
MKSPIFFS = os.environ['MKSPIFFS']
print "mkspiffs is "+MKSPIFFS
OFFSET_BOOTLOADER = 0x1000
OFFSET_PARTITIONS = 0x8000
## now taken from default.csv
OFFSET_BOOTAPP0 = 0xE000
OFFSET_APPLICATION = 0x10000
OFFSET_SPIFFS = 0x291000
SIZE_SPIFFS = 0x16F000
esp32tools = sys.argv[1]
file_in = sys.argv[2]
file_spiffs = sys.argv[3]
data_dir = sys.argv[3]
file_out = sys.argv[4]
partition = esp32tools + "/partitions/default.csv"
with open(partition, 'rb') as csvfile:
partreader = csv.reader(csvfile, delimiter=',')
for row in partreader:
if row[0] == "otadata":
OFFSET_BOOTAPP0 = int(row[3],16)
if row[0] == "app0":
OFFSET_APPLICATION = int(row[3],16)
if row[0] == "spiffs":
OFFSET_SPIFFS = int(row[3],16)
SIZE_SPIFFS = int(row[4],16)
print "bootapp0: "+hex(OFFSET_BOOTAPP0)
print "app0: "+hex(OFFSET_APPLICATION)
print "spiffs: "+hex(OFFSET_SPIFFS)+" size "+hex(SIZE_SPIFFS)
# create binary partition
file_part = "/tmp/partition.bin"
partproc = subprocess.Popen(['python', esp32tools+'/gen_esp32part.py', partition, file_part]);
partproc.wait();
# create SPI file system
file_spiffs = "/tmp/spiffs.bin"
spiproc = subprocess.Popen([MKSPIFFS,'-c',data_dir,'-b','4096','-p','256','-s',str(SIZE_SPIFFS),file_spiffs]);
spiproc.wait();
files_in = [
('bootloader', OFFSET_BOOTLOADER, esp32tools+"/sdk/bin/bootloader_dio_80m.bin"),
('partitions', OFFSET_PARTITIONS, esp32tools+"/partitions/default.bin"),
('partitions', OFFSET_PARTITIONS, file_part),
('bootapp0', OFFSET_BOOTAPP0, esp32tools+"/partitions/boot_app0.bin"),
('application', OFFSET_APPLICATION, file_in),
('spiffs', OFFSET_SPIFFS, file_spiffs),