Add tft.enable flag, gate the use of ILI9341/STMPE610 on it.

- For esp8266 (lightswitch w/o touchscreen), set tft.enable=false
- For esp32 (lightswitch w/ touchscreen), set it to true.

Clean up mos.yml flags per architecture type.
- Button is always 0,2
- Relay0 at 16 for ESP8266, as that's NodeMCU v2's onboard LED.
- Relay0 at 13 for ESP32, as that's Featherwing's onboard LED
This commit is contained in:
Pim van Pelt
2017-12-22 10:23:15 +01:00
parent 44a84dd1bc
commit ecf0a9a2fc
2 changed files with 17 additions and 8 deletions

17
mos.yml
View File

@ -31,8 +31,9 @@ config_schema:
- ["wifi.sta.ssid", "dapches-iot"]
- ["wifi.sta.pass", "marielle"]
- ["tft", "o", {title: "TFT settings"}]
- ["tft.enable", "b", {"title": "Enable STMPE610 and ILI9341"}]
- ["tft.orientation", "i", {title: "Orientation; 0=PORTRAIT 1=LANDSCAPE 2=PORTRAIT_FLIP 3=LANDSCAPE_FLIP"}]
- ["tft.orientation", 1 ]
- ["tft.orientation", 1]
- ["tft.width", "i", {title: "TFT width in pixels"}]
- ["tft.height", "i", {title: "TFT height in pixels"}]
- ["tft.width", 480] # Set to 320 for 2.4" Featherwing, set to 480 for 3.5" Featherwing
@ -45,11 +46,8 @@ config_schema:
- ["app.inactivity_timeout", "i", {title: "Inactivity timeout in seconds"}]
- ["app.inactivity_timeout", 10]
- ["app.battery_calibration", i, {title: "Battery ADC value at 4000mV"}]
- ["app.battery_calibration", 2360]
- ["app.buttons", "s", {title: "comma-separated list of button pins"}]
- ["app.buttons", "0,2"]
- ["app.relays", "s", {title: "comma-separated list of relay pins"}]
- ["app.relays", "16,12,13,14"]
- ["spi.enable", true]
- ["spi.cs1_gpio", -1]
- ["spi.cs2_gpio", -1]
@ -77,11 +75,20 @@ conds:
- ["spi.cs1_gpio", 32] # STMPE610
- ["ili9341.dc_pin", 33]
- ["stmpe610.irq_pin", 23]
- ["tft.enable", true]
- ["app.buttons", "0,2"]
- ["app.relays", "13,12,14,16"]
- ["tft.enable", true]
- ["app.battery_calibration", 2360]
- when: mos.platform == "esp8266"
apply:
build_vars:
MGOS_PLATFORM_ESP8266: 1
config_schema:
- ["tft.enable", false]
- ["app.buttons", "0,2"]
- ["app.relays", "16,12,13,14"]
- ["app.battery_calibration", -1]
# List of libraries used by this app, in order of initialisation