diff --git a/Platformio/HAL/Targets/ESP32/HardwareRevX.cpp b/Platformio/HAL/Targets/ESP32/HardwareRevX.cpp index b8d6fc5..000ddca 100644 --- a/Platformio/HAL/Targets/ESP32/HardwareRevX.cpp +++ b/Platformio/HAL/Targets/ESP32/HardwareRevX.cpp @@ -81,7 +81,6 @@ void HardwareRevX::init() { setupTFT(); setupTouchScreen(); initLVGL(); - setupWifi(); setupIMU(); setupIR(); @@ -92,18 +91,6 @@ void HardwareRevX::debugPrint(std::string aDebugMessage) { Serial.print(aDebugMessage.c_str()); } -// void HardwareRevX::MQTTPublish(const char *topic, const char *payload) { -// #ifdef ENABLE_WIFI -// if (client.connected()) { -// client.publish(topic, payload); -// } else { -// debugPrint("MQTT Client Not Connected When Attempting Publish."); -// } -// #else -// debugPrint("Attempting To Publish MQTT with wifi Disabled!"); -// #endif -// } - std::shared_ptr HardwareRevX::getInstance(){ if (!mInstance) { mInstance = std::shared_ptr(new HardwareRevX()); @@ -218,12 +205,6 @@ void HardwareRevX::enterSleep() { IMU.readRegister(&intDataRead, LIS3DH_INT1_SRC); // really clear interrupt -#ifdef ENABLE_WIFI - // Power down modem - WiFi.disconnect(); - WiFi.mode(WIFI_OFF); -#endif - // Prepare IO states digitalWrite(LCD_DC, LOW); // LCD control signals off digitalWrite(LCD_CS, LOW); @@ -391,25 +372,6 @@ void HardwareRevX::slowDisplayWakeup() { delay(100); // Wait for the LCD driver to power on } -void HardwareRevX::handleWifiEvent(WiFiEvent_t event) { -#ifdef ENABLE_WIFI - // Serial.printf("[WiFi-event] event: %d\n", event); - if (event == ARDUINO_EVENT_WIFI_STA_GOT_IP) { - client.setServer(MQTT_SERVER, 1883); // MQTT initialization - client.connect("OMOTE"); // Connect using a client id - } - // Set status bar icon based on WiFi status - // TODO allow UI to register a Handler for these events - - // if (event == ARDUINO_EVENT_WIFI_STA_GOT_IP || - // event == ARDUINO_EVENT_WIFI_STA_GOT_IP6) { - // lv_label_set_text(WifiLabel, LV_SYMBOL_WIFI); - // } else { - // lv_label_set_text(WifiLabel, ""); - // } -#endif -} - void HardwareRevX::setupIR() { // Setup IR IrSender.begin(); @@ -417,16 +379,6 @@ void HardwareRevX::setupIR() { IrReceiver.enableIRIn(); // Start the receiver } -void HardwareRevX::setupWifi() { -#ifdef ENABLE_WIFI - // Setup WiFi - WiFi.setHostname("OMOTE"); // define hostname - WiFi.onEvent(wiFiEventImpl); - WiFi.begin(WIFI_SSID, WIFI_PASSWORD); - WiFi.setSleep(true); -#endif -} - void HardwareRevX::startTasks() { if (xTaskCreate(&HardwareRevX::updateBatteryTask, "Battery Percent Update", 1024, nullptr, 5, &batteryUpdateTskHndl) != pdPASS) { diff --git a/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp b/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp index 3321db2..e61aff5 100644 --- a/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp +++ b/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp @@ -2,7 +2,6 @@ #include "SparkFunLIS3DH.h" #include "HardwareAbstract.hpp" -#include #include "Wire.h" #include "lvgl.h" #include "battery.hpp" @@ -45,7 +44,6 @@ protected: void initLVGL(); void setupIMU(); void setupIR(); - void setupWifi(); void activityDetection(); void enterSleep(); @@ -56,8 +54,6 @@ protected: lv_color_t *color_p); void handleTouchPadRead(lv_indev_drv_t *indev_driver, lv_indev_data_t *data); - void handleWifiEvent(WiFiEvent_t event); - // Tasks void startTasks(); /// @brief Send Battery Notification every 5 Seconds @@ -69,9 +65,6 @@ private: HardwareRevX(); // Static Wrappers Needed to Satisfy C APIs - static void wiFiEventImpl(WiFiEvent_t event) { - mInstance->handleWifiEvent(event); - } static void displayFlushImpl(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) { mInstance->handleDisplayFlush(disp, area, color_p); @@ -81,11 +74,6 @@ private: mInstance->handleTouchPadRead(indev_driver, data); } -#ifdef ENABLE_WIFI - WiFiClient espClient; - PubSubClient client = PubSubClient(espClient); -#endif - Adafruit_FT6206 touch = Adafruit_FT6206(); TS_Point touchPoint; TS_Point oldPoint;