Browse Source

reverted ideasx_interface...no idea how this fixed anything

curiousmuch 4 years ago
parent
commit
514d459800
3 changed files with 5 additions and 13 deletions
  1. 1 1
      include/interface/ideasx_interface.h
  2. 4 10
      interface/ideasx_interface.c
  3. 0 2
      user/user_main.c

+ 1 - 1
include/interface/ideasx_interface.h

@@ -122,7 +122,7 @@ typedef struct {
 #define RESTART_COMMAND_INDEX   0 
 #define SHUTDOWN_COMMAND_INDEX  1
 #define LOC_COMMAND_INDEX       2
-#define NUMBER_OF_COMMANDS      3 
+#define NUMBER_OF_COMMANDS      2
 #define COMMAND_QOS     1 
 #define COMMAND_RETAIN  0
 

+ 4 - 10
interface/ideasx_interface.c

@@ -126,11 +126,9 @@ void ICACHE_FLASH_ATTR IdeasX_Connect(void)
 
 void ICACHE_FLASH_ATTR IdeasX_Disconnect(void)
 {
-    MQTT_Disconnect(&mqttClient);                     // stop MQTT process 
-                                                      // clear queue [needs to be done]
-    //os_timer_disarm(&ideasX_health.health_timer);     // disable Health timer
     if (ideasX_config.fail_cb != NULL)
         ideasX_config.fail_cb();
+    MQTT_Disconnect(&mqttClient);
 }
 
 void ICACHE_FLASH_ATTR ideasX_system_config_init(void)
@@ -163,10 +161,8 @@ void ICACHE_FLASH_ATTR ideasX_command_array_init(void)
 {
     os_sprintf(command_array[SHUTDOWN_COMMAND_INDEX].topic, "%s", SHUTDOWN_COMMAND_TOPIC);
     os_sprintf(command_array[RESTART_COMMAND_INDEX].topic, "%s", RESTART_COMMAND_TOPIC); 
-    os_sprintf(command_array[LOC_COMMAND_INDEX].topic, "%s", LOC_COMMAND_INDEX);
-    command_array[SHUTDOWN_COMMAND_INDEX].function = &Encoder_Shutdown;
-    command_array[RESTART_COMMAND_INDEX].function = &Encoder_Restart;
-    command_array[LOC_COMMAND_INDEX].function = &Encoder_Find;
+    command_array[SHUTDOWN_COMMAND_INDEX].function = Encoder_Shutdown;
+    command_array[RESTART_COMMAND_INDEX].function = Encoder_Restart;
 }
 
 static void ICACHE_FLASH_ATTR ideasX_data_cb(uint32_t *args, const char* topic, uint32_t topic_len, const char *data, uint32_t data_len)
@@ -192,12 +188,10 @@ static void ICACHE_FLASH_ATTR ideasX_data_cb(uint32_t *args, const char* topic,
         if (!strcmp(command_array[i].topic, command_topic))
         {
             ESP_LOGD(TAG, "Found the command: %s", command_array[i].topic);
-            ideasX_function_t function =  command_array[i].function; 
-            function(); 
+            command_array[i].function(); 
         }
     }
 
-  ESP_LOGD(TAG, "we made it out");
   os_free(topicBuf);
   os_free(dataBuf);
 }

+ 0 - 2
user/user_main.c

@@ -223,8 +223,6 @@ void user_init(void)
     // Intialize UART and Wi-Fi
     WiFi_Initialize();
     IdeasX_Init();
- while(1)
-        system_soft_wdt_feed();
     Encoder_InitIO();
     Encoder_InitIMU(); 
     Encoder_DisableIOInterrupts();