separate in directories
[mTask.git] / client / client.c
similarity index 91%
rename from client/main.c
rename to client/client.c
index 4919d9d..8fa596f 100644 (file)
@@ -5,11 +5,6 @@
 
 #ifdef LINUX
 #include <stdio.h>
-#elif defined NODEMCU
-#include "ets_sys.h"
-#include "osapi.h"
-#include "gpio.h"
-#include "os_type.h"
 #endif
 
 #include "interpret.h"
@@ -78,7 +73,7 @@ void loop(void)
        read_message();
 
        //Run tasks
-       cyclestart = millis();
+       cyclestart = getmillis();
        for(ct = 0; ct<MAXTASKS; ct++){
                //See whether the task is even in use
                if((curtask = task_get(ct)) == NULL){
@@ -105,8 +100,8 @@ void loop(void)
 
 #ifdef STM
 int main(void){
-#elif defined NODEMCU
-void ICACHE_FLASH_ATTR user_init(){
+#elif defined ARDUINO_ESP8266_NODEMCU
+void setup(){
 #elif defined LINUX
 int main(int argc, char *argv[]){
        gargc = argc;
@@ -121,10 +116,10 @@ int main(int argc, char *argv[]){
        while(true){
                //Check for newtasks
                loop();
-               delay(100);
+               msdelay(100);
        }
 
-#ifndef NODEMCU
+#ifndef ARDUINO_ESP8266_NODEMCU
        return 0;
 #endif
 }