From c816d5c0477f15631058928c9aad4fbd63d50156 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 17 Nov 2016 13:24:25 +0100 Subject: [PATCH] . --- gCons.icl | 1 - int/int.c | 13 +++++++++++++ int/mTaskSymbols.h | 6 ++++++ mTaskInterpret.dcl | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) 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] -- 2.20.1