update spec to support normal io pins
authorMart Lubbers <mart@martlubbers.net>
Thu, 22 Jun 2017 09:28:38 +0000 (11:28 +0200)
committerMart Lubbers <mart@martlubbers.net>
Thu, 22 Jun 2017 09:28:38 +0000 (11:28 +0200)
client/client.c
client/interface.h
client/spec.c
install_clean.sh
miTask.icl

index 28c1609..da74940 100644 (file)
@@ -67,6 +67,7 @@ void read_message(void)
        debug("Shutdown received");
        mem_reset();
        reset();
+       break;
       case '\0':
         debug("Server closed connection");
         break;
index 24e5c37..e6b14db 100644 (file)
@@ -10,43 +10,35 @@ extern "C" {
 #include <stdarg.h>
 
 #ifdef LINUX
-#define NAPINS 128
-#define NDPINS 128
+#define APINS 128
+#define DPINS 128
 #define STACKSIZE 1024
 #define MEMSIZE 1024
 #define HAVELED 1
-#define HAVEAIO 1
-#define HAVEDIO 1
 
 extern int gargc;
 extern char **gargv;
 
 #elif defined STM
-#define NAPINS 128
-#define NDPINS 128
+#define APINS 128
+#define DPINS 128
 #define STACKSIZE 1024
 #define MEMSIZE 1024
 #define HAVELED 1
-#define HAVEAIO 1
-#define HAVEDIO 1
 
 #elif defined ARDUINO_ESP8266_NODEMCU
-#define NAPINS 128
-#define NDPINS 128
+#define APINS 128
+#define DPINS 128
 #define STACKSIZE 1024
 #define MEMSIZE 1024
 #define HAVELED 0
-#define HAVEAIO 0
-#define HAVEDIO 0
 
 #elif defined ARDUINO_AVR_UNO
-#define NAPINS 128
-#define NDPINS 128
+#define APINS 128
+#define DPINS 128
 #define STACKSIZE 64
 #define MEMSIZE 256
 #define HAVELED 0
-#define HAVEAIO 0
-#define HAVEDIO 0
 #else
 //Add you device here
 #endif
@@ -61,11 +53,11 @@ uint8_t read_byte(void);
 void write_byte(uint8_t b);
 
 /* Analog and digital pins */
-#if HAVEDIO == 1
+#if DPINS > 0
 void write_dpin(uint8_t i, bool b);
 bool read_dpin(uint8_t i);
 #endif
-#if HAVEAIO == 1
+#if APINS > 0
 void write_apin(uint8_t i, uint8_t a);
 uint8_t read_apin(uint8_t i);
 #endif
index 38c58ef..52ed512 100644 (file)
@@ -5,11 +5,11 @@
 void spec_send(void)
 {
        write_byte('c');
-       write_byte(0 | (HAVELED << 0) | (HAVEAIO << 1) | (HAVEDIO << 2));
+       write_byte(0 | (HAVELED << 0) );//| (HAVEAIO << 1) | (HAVEDIO << 2));
        write16(MEMSIZE);
        write16(STACKSIZE);
-       write_byte(NAPINS);
-       write_byte(NDPINS);
+       write_byte(APINS);
+       write_byte(DPINS);
        write_byte('\n');
        write_byte('\n');
 }
index f7fe903..bcedd34 100755 (executable)
@@ -16,6 +16,6 @@ mkdir -p "$TARGET"
 
 echo "Downloading and installing clean nightly" >&2
 curl -sSL ftp://ftp.cs.ru.nl/pub/Clean/builds/linux-x64/clean-bundle-complete-linux-x64-latest.tgz \
-       | tar --gunzip --strip-components=1 --extract --directory="$TARGET"
+       | tar --verbose --gunzip --strip-components=1 --extract --directory="$TARGET"
 
 echo "export CLEAN_HOME=$TARGET; export PATH=$TARGET/bin:\$PATH;"
index 8c17f09..85196eb 100644 (file)
@@ -31,7 +31,8 @@ Start world = startEngine [
        ] world
 
 demo :: Task ()
-demo = viewSharedInformation "Devices" [] deviceStoreNP
+demo = set 5 (sharedDynamicStore "Hoi" 5)
+       >>| viewSharedInformation "Devices" [] deviceStoreNP
        >>* [OnValue $ ifValue pred (cont o hd)]
        where
                pred [] = False