merged S3-usb-stick into build workflow

This commit is contained in:
Tim Huyeng 2022-11-04 14:08:42 +01:00
commit f05c0b2d21
5 changed files with 127 additions and 8 deletions

View File

@ -86,6 +86,10 @@ extern BB_SPI_LCD *dp;
#define MY_DISPLAY_HEIGHT 64 // Height in pixels of OLED-display, must be 64X #define MY_DISPLAY_HEIGHT 64 // Height in pixels of OLED-display, must be 64X
#endif #endif
#ifndef MY_DISPLAY_FIRSTLINE
#define MY_DISPLAY_FIRSTLINE 0
#endif
// settings for qr code generator // settings for qr code generator
#define QR_VERSION 3 // 29 x 29px #define QR_VERSION 3 // 29 x 29px

View File

@ -4,6 +4,15 @@
#include <Arduino.h> #include <Arduino.h>
#include <Wire.h> #include <Wire.h>
#include <BitBang_I2C.h> #include <BitBang_I2C.h>
#include <Wire.h>
#ifndef MY_DISPLAY_SDA
#define MY_DISPLAY_SDA SDA
#endif
#ifndef MY_DISPLAY_SCL
#define MY_DISPLAY_SCL SCL
#endif
#define SSD1306_PRIMARY_ADDRESS (0x3D) #define SSD1306_PRIMARY_ADDRESS (0x3D)
#define SSD1306_SECONDARY_ADDRESS (0x3C) #define SSD1306_SECONDARY_ADDRESS (0x3C)
@ -14,14 +23,6 @@
#define MCP_24AA02E64_PRIMARY_ADDRESS (0x50) #define MCP_24AA02E64_PRIMARY_ADDRESS (0x50)
#define QUECTEL_GPS_PRIMARY_ADDRESS (0x10) #define QUECTEL_GPS_PRIMARY_ADDRESS (0x10)
#ifndef MY_DISPLAY_SDA
#define MY_DISPLAY_SDA SDA
#endif
#ifndef MY_DISPLAY_SCL
#define MY_DISPLAY_SCL SCL
#endif
extern SemaphoreHandle_t I2Caccess; extern SemaphoreHandle_t I2Caccess;
void i2c_init(void); void i2c_init(void);

View File

@ -0,0 +1,62 @@
[board]
halfile = ttgotdongles3.h
;halfile = ttgotdongledisplays3.h
[platformio]
; upload firmware to board with usb cable
default_envs = usb
description = Paxcounter is a device for metering passenger flows in realtime. It counts how many mobile devices are around.
[common]
; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
release_version = 3.3.2
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 5
extra_scripts = pre:build.py
otakeyfile = ota.conf
lorakeyfile = loraconf.h
lmicconfigfile = lmic_config.h
platform_espressif32 = espressif32@5.2.0
monitor_speed = 115200
upload_speed = 115200 ; set by build.py and taken from hal file
lib_deps_all =
bitbank2/BitBang_I2C@^2.2.1
https://github.com/bitbank2/bb_spi_lcd.git
fastled/FastLED @ ^3.5.0
;greyrook/libpax @ ^1.0.1
https://github.com/cyberman54/libpax.git
https://github.com/SukkoPera/Arduino-Rokkit-Hash.git
bblanchon/ArduinoJson @ ^6
spacehuhn/SimpleButton
256dpi/MQTT @ ^2.5.0
build_flags_basic =
-include "src/hal/${board.halfile}"
-include "src/paxcounter.conf"
'-DCORE_DEBUG_LEVEL=${common.debug_level}'
'-DLOG_LOCAL_LEVEL=${common.debug_level}'
'-DPROGVERSION="${common.release_version}"'
'-D LIBPAX_WIFI'
'-D LIBPAX_BLE'
'-D LIBPAX_ARDUINO'
build_flags_all =
${common.build_flags_basic}
-mfix-esp32-psram-cache-issue
[env]
framework = arduino
board = ESP32-S3-DevKitC-1
board_build.partitions = min_spiffs.csv
build_type = release
upload_speed = ${common.upload_speed}
;upload_port = COM6
platform = ${common.platform_espressif32}
lib_deps = ${common.lib_deps_all}
build_flags = ${common.build_flags_all}
upload_protocol = ${common.upload_protocol}
extra_scripts = ${common.extra_scripts}
monitor_speed = ${common.monitor_speed}
monitor_filters = time, esp32_exception_decoder, default
[env:usb]
upload_protocol = esptool

View File

@ -0,0 +1,31 @@
// clang-format off
// upload_speed 1500000
// board ESP32-S3-DevKitC-1
// see https://github.com/Xinyuan-LilyGO/T-Dongle-S3
#ifndef _TTGOTDONGLES3_H
#define _TTGOTDONGLES3_H
#include <stdint.h>
#define HAS_LED NOT_A_PIN
#define HAS_BUTTON 0
#define HAS_SDCARD 2 // this board has a SD MMC card-reader/writer
#define SDCARD_SLOTWIDTH 4 // 4-line interface
#define HAS_DISPLAY 2 // TFT-LCD
#define TFT_TYPE DISPLAY_TDONGLE_S3
#define MY_DISPLAY_FLIP 1 // use if display is rotated
#define MY_DISPLAY_WIDTH 80
#define MY_DISPLAY_HEIGHT 160
#define TFT_CS_PIN 4
#define TFT_SDA_PIN 3
#define TFT_SCL_PIN 5
#define TFT_DC_PIN 2
#define TFT_RES_PIN 1
#define TFT_LEDA_PIN 38
#endif

21
src/hal/ttgotdongles3.h Normal file
View File

@ -0,0 +1,21 @@
// clang-format off
// upload_speed 1500000
// board ESP32-S3-DevKitC-1
// for pinouts see https://github.com/Xinyuan-LilyGO/T-Dongle-S3
#ifndef _TTGOTDONGLES3_H
#define _TTGOTDONGLES3_H
#include <stdint.h>
#define HAS_LED NOT_A_PIN
#define RGB_LED_COUNT 1
#define HAS_RGB_LED FastLED.addLeds<APA102, 40, 39, BGR>(leds, RGB_LED_COUNT)
#define FASTLED_INTERNAL
#define HAS_BUTTON 0 // dongle button is on GPIO0
#define HAS_SDCARD 2 // dongle has a SD MMC card-reader/writer
#define SDCARD_SLOTWIDTH 4 // dongle has 4 line interface
#define SDCARD_SLOTCONFIG { .clk = GPIO_NUM_12, .cmd = GPIO_NUM_16, .d0 = GPIO_NUM_14, .d1 = GPIO_NUM_17, .d2 = GPIO_NUM_21, .d3 = GPIO_NUM_18, .cd = SDMMC_SLOT_NO_CD, .wp = SDMMC_SLOT_NO_WP, .width = 4, .flags = 0, }
#endif