From: Mart Lubbers Date: Thu, 17 Nov 2016 12:24:25 +0000 (+0100) Subject: . X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=c816d5c0477f15631058928c9aad4fbd63d50156;p=mTask.git . --- diff --git a/gCons.icl b/gCons.icl index 77e223b..b54c8e0 100644 --- a/gCons.icl +++ b/gCons.icl @@ -58,4 +58,3 @@ conses{|[!!]|} _ = [[!!]] conses{|{}|} _ = [{}] conses{|{!}|} _ = [{!}] conses{|()|} = [()] - diff --git a/int/int.c b/int/int.c index 9dc52a2..a946908 100644 --- a/int/int.c +++ b/int/int.c @@ -1,4 +1,5 @@ #include +#include #include "mTaskSymbols.h" @@ -17,6 +18,18 @@ char program[PROGRAMSIZE+1] = {0}; int stack[STACKSIZE+1] = {0}; +bool input_available(){ + struct timeval tv; + fd_set fds; + tv.tv_sec = 0; + tv.tv_usec = 0; + FD_ZERO(&fds); + FD_SET(0, &fds); + select(1, &fds, NULL, NULL, &tv); + return FD_ISSET(0, &fds); +} + + int main(void) { char c; diff --git a/int/mTaskSymbols.h b/int/mTaskSymbols.h index f67721b..5975fd4 100644 --- a/int/mTaskSymbols.h +++ b/int/mTaskSymbols.h @@ -28,4 +28,10 @@ #define BCANALOGWRITE 25 #define BCDIGITALREAD 26 #define BCDIGITALWRITE 27 +#define BCTEST 28 +#define BCTEST 29 +#define BCTEST 30 +#define BCTEST 31 +#define BCTEST 32 +#define BCTEST 33 #endif diff --git a/mTaskInterpret.dcl b/mTaskInterpret.dcl index 0048859..53bb69b 100644 --- a/mTaskInterpret.dcl +++ b/mTaskInterpret.dcl @@ -39,6 +39,7 @@ import mTask | BCAnalogWrite String | BCDigitalRead String | BCDigitalWrite String + | BCTest AnalogPin //:: ByteCode a p = BC (BCState -> ([BC], BCState)) :: ByteCode a p = BC [BC]