X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=client%2Fmain.c;h=4919d9d668c12cbb0aebf7f62fb1a027594fd2cb;hb=88ecd686ff62986cde139abb65ab52b9e93d3035;hp=18182389236e0ba2a4757b3b710c0d20324d6a03;hpb=c3bb3dde2bb886a9f86f9de5f4f96beb8d86b53d;p=mTask.git diff --git a/client/main.c b/client/main.c index 1818238..4919d9d 100644 --- a/client/main.c +++ b/client/main.c @@ -3,14 +3,19 @@ #include #include -#ifdef STM -#else +#ifdef LINUX #include +#elif defined NODEMCU +#include "ets_sys.h" +#include "osapi.h" +#include "gpio.h" +#include "os_type.h" #endif #include "interpret.h" #include "mTaskSymbols.h" #include "sds.h" +#include "spec.h" #include "task.h" #include "interface.h" @@ -19,6 +24,7 @@ #define MSG_SDS_SPEC 's' #define MSG_SDS_DEL 'a' #define MSG_SDS_UPD 'u' +#define MSG_SPEC 'c' void read_message(void) { @@ -48,7 +54,12 @@ void read_message(void) debug("Receiving a task"); task_register(); break; + case MSG_SPEC: + debug("Receiving a spec request"); + spec_send(); + break; case '\0': + debug("Server closed connection"); break; case '\n': break; @@ -94,7 +105,9 @@ void loop(void) #ifdef STM int main(void){ -#else +#elif defined NODEMCU +void ICACHE_FLASH_ATTR user_init(){ +#elif defined LINUX int main(int argc, char *argv[]){ gargc = argc; gargv = argv; @@ -104,11 +117,14 @@ int main(int argc, char *argv[]){ setup(); sds_init(); task_init(); - debug("booting up"); + debug("sending device spec"); while(true){ - //Check for newetasks + //Check for newtasks loop(); - delay(50); + delay(100); } + +#ifndef NODEMCU return 0; +#endif }