diff --git a/mos.yml b/mos.yml index 370a847..c04d6c6 100644 --- a/mos.yml +++ b/mos.yml @@ -1,7 +1,8 @@ -platform: esp32 author: Pim van Pelt description: A Mongoose-OS Huzzah32 Featherwing version: 1.0 +platform: esp32 +platfors: [ esp8266, esp32 ] libs_version: ${mos.version} modules_version: ${mos.version} @@ -24,7 +25,7 @@ filesystem: config_schema: # - ["debug.level", 4] - - ["sys.esp32_adc_vref", 3300] # ADC Vref is 3.3V +# - ["spi.debug", true] - ["wifi.ap.enable", false] - ["wifi.sta.enable", true] - ["wifi.sta.ssid", "dapches-iot"] @@ -42,17 +43,28 @@ config_schema: - ["app.battery_calibration", i, {title: "Battery ADC value at 4000mV"}] - ["app.battery_calibration", 2360] - ["spi.enable", true] -# - ["spi.debug", true] - - ["spi.mosi_gpio", 18] - - ["spi.miso_gpio", 19] - - ["spi.sclk_gpio", 5] - - ["spi.cs0_gpio", 32] - ["spi.cs1_gpio", -1] - ["spi.cs2_gpio", -1] - - ["ili9341.cs_pin", 15] - - ["ili9341.dc_pin", 33] - ["stmpe610.cs_index", 0] - - ["stmpe610.irq_pin", 23] + +conds: + - when: mos.platform == "esp32" + apply: + build_vars: + MGOS_PLATFORM_ESP32: 1 + config_schema: + - ["sys.esp32_adc_vref", 3300] # ADC Vref is 3.3V + - ["spi.mosi_gpio", 18] + - ["spi.miso_gpio", 19] + - ["spi.sclk_gpio", 5] + - ["spi.cs0_gpio", 32] + - ["ili9341.cs_pin", 15] + - ["ili9341.dc_pin", 33] + - ["stmpe610.irq_pin", 23] + - when: mos.platform == "esp8266" + apply: + build_vars: + MGOS_PLATFORM_ESP8266: 1 diff --git a/src/widget_default.c b/src/widget_default.c index 54470b7..2faf360 100644 --- a/src/widget_default.c +++ b/src/widget_default.c @@ -58,4 +58,5 @@ void widget_default_ev(int ev, struct widget_t *w, void *ev_data) { default: // EV_WIDGET_NONE break; } + (void) ev_data; } diff --git a/src/widget_network.c b/src/widget_network.c index 66f0c29..29a1905 100644 --- a/src/widget_network.c +++ b/src/widget_network.c @@ -24,11 +24,13 @@ static void widget_network_render(struct widget_t *w, void *ev_data) { static void widget_network_send_clear(void *arg) { send_timer=0; widget_network_ev(EV_WIDGET_REDRAW, widget_network, NULL); + (void) arg; } static void widget_network_recv_clear(void *arg) { recv_timer=0; widget_network_ev(EV_WIDGET_REDRAW, widget_network, NULL); + (void) arg; } void widget_network_send() { diff --git a/src/widget_wifi.c b/src/widget_wifi.c index b23d737..150bba3 100644 --- a/src/widget_wifi.c +++ b/src/widget_wifi.c @@ -1,6 +1,8 @@ #include "mgos.h" #include "mongoose-touch.h" +#ifdef MGOS_PLATFORM_ESP32 #include +#endif static long map(long x, long in_min, long in_max, long out_min, long out_max) { @@ -9,6 +11,7 @@ static long map(long x, long in_min, long in_max, long out_min, long out_max) // Returns a value between 0 and 100% static uint8_t widget_wifi_signal() { +#ifdef MGOS_PLATFORM_ESP32 wifi_ap_record_t info; if(0 != esp_wifi_sta_get_ap_info(&info)) @@ -19,6 +22,8 @@ static uint8_t widget_wifi_signal() { if (info.rssi >= -50) return 100; return 2 * (info.rssi + 100); +#endif + return 100; } static void widget_wifi_render(struct widget_t *w, void *ev_data) {