X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=client%2Finterface.h;h=266c13d0d7ff7ffed691cc962fa8f56c8bd7f8ec;hb=a2df77cbda43d5a24eeb8ac7db7452baae9f18aa;hp=0982d4c8332bf245b2b4fab6686b3be19e519946;hpb=2e196d4e484c3945f7e6bd1c680a2021613bece7;p=mTask.git diff --git a/client/interface.h b/client/interface.h index 0982d4c..266c13d 100644 --- a/client/interface.h +++ b/client/interface.h @@ -1,13 +1,17 @@ #ifndef INTERFACE_H #define INTERFACE_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include #ifdef LINUX -#define MAXTASKS 5 -#define MAXSDSS 100 +#define STACKSIZE 1024 +#define MEMSIZE 1024 #define HAVELED 1 #define HAVEAIO 1 #define HAVEDIO 1 @@ -16,26 +20,32 @@ extern int gargc; extern char **gargv; #elif defined STM -#define MAXTASKS 5 -#define MAXSDSS 100 +#define STACKSIZE 1024 +#define MEMSIZE 1024 #define HAVELED 1 #define HAVEAIO 1 #define HAVEDIO 1 #elif defined ARDUINO_ESP8266_NODEMCU -#define MAXTASKS 5 -#define MAXSDSS 100 +#define STACKSIZE 1024 +#define MEMSIZE 1024 #define HAVELED 0 #define HAVEAIO 0 #define HAVEDIO 0 +#elif defined ARDUINO_AVR_UNO +#define STACKSIZE 64 +#define MEMSIZE 256 +#define HAVELED 0 +#define HAVEAIO 0 +#define HAVEDIO 0 #else //Add you device here #endif #define read16() 256*(uint8_t)read_byte() + (uint8_t)read_byte() #define from16(a, b) 256*a+b -#define write16(i) { write_byte((uint8_t)i/256); write_byte((uint8_t)i%256); } +#define write16(i) { write_byte((uint8_t)(i/256)); write_byte((uint8_t)(i%256)); } /* Communication */ bool input_available(void); @@ -59,13 +69,16 @@ void led_off(uint8_t i); #endif /* Delay and communication */ -long getmillis(void); -void msdelay(long ms); +unsigned long getmillis(void); +void msdelay(unsigned long ms); /* Auxilliary */ -void setup(void); +void real_setup(void); void debug(char *fmt, ...); void pdie(char *s); void die(char *fmt, ...); +#ifdef __cplusplus +} +#endif #endif