add ifdefs to interface.h
authorMart Lubbers <mart@martlubbers.net>
Mon, 20 Mar 2017 10:55:28 +0000 (11:55 +0100)
committerMart Lubbers <mart@martlubbers.net>
Mon, 20 Mar 2017 10:55:28 +0000 (11:55 +0100)
client/Makefile
client/interface.c
client/interface.h
client/interpret.c
client/mcuconf.h

index d0f5454..0ca27f1 100644 (file)
@@ -118,6 +118,8 @@ CSRC = $(STARTUPSRC) \
        $(PLATFORMSRC) \\r
        $(BOARDSRC) \\r
        $(TESTSRC) \\r
+       $(CHIBIOS)/os/hal/lib/streams/memstreams.c \\r
+       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \\r
           $(filter-out interface_linux.c,$(wildcard *.c))\r
 \r
 # C++ sources that can be compiled in ARM or THUMB mode depending on the global\r
index 9ddd214..fae81db 100644 (file)
@@ -86,6 +86,9 @@ void setup(void)
        halInit();
        chSysInit();
        sdStart(&SD3, NULL);
+       sdStart(&SD1, NULL);
+
+       
 }
 
 void debug(char *fmt, ...)
index eee3457..9e81810 100644 (file)
@@ -36,14 +36,20 @@ uint8_t read_byte(void);
 void write_byte(uint8_t b);
 
 /* Analog and digital pins */
+#if HAVEDIO == 1
 void write_dpin(uint8_t i, bool b);
 bool read_dpin(uint8_t i);
+#endif
+#if HAVEAIO == 1
 void write_apin(uint8_t i, uint8_t a);
 uint8_t read_apin(uint8_t i);
+#endif
 
 /* UserLED */
+#if HAVELED == 1
 void led_on(uint8_t i);
 void led_off(uint8_t i);
+#endif
 
 /* Delay and communication */
 long millis(void);
index 51e2951..b9d0c88 100644 (file)
@@ -138,6 +138,7 @@ void run_task(struct task *t)
                        break;
                case BCSERIALPARSEINT: trace("SerialParseInt()");
                        break;
+#if HAVEAIO == 1
                case BCANALOGREAD: trace("AnalogRead(%d)", program[pc]);
                        stack[sp++] = read_apin(program[pc++]);
                        break;
@@ -145,6 +146,8 @@ void run_task(struct task *t)
                        write_apin(program[pc++], stack[sp-1]);
                        sp--;
                        break;
+#endif
+#if HAVEDIO == 1
                case BCDIGITALREAD: trace("DigitalRead(%d)", program[pc]);
                        stack[sp++] = read_dpin(program[pc++]);
                        break;
@@ -152,6 +155,8 @@ void run_task(struct task *t)
                        write_dpin(program[pc++], stack[sp-1]);
                        sp--;
                        break;
+#endif
+#if HAVELED == 1
                case BCLEDON: trace("LedOn(%d)", program[pc]);
                        led_on(stack[sp-1]);
                        sp--;
@@ -160,6 +165,7 @@ void run_task(struct task *t)
                        led_off(stack[sp-1]);
                        sp--;
                        break;
+#endif
                default:
                        trace("unrecognized");
                        die("Unrecognized command: %d", program[pc-1]);
index 2886487..b01b315 100644 (file)
 /*\r
  * SERIAL driver system settings.\r
  */\r
-#define STM32_SERIAL_USE_USART1             FALSE\r
+#define STM32_SERIAL_USE_USART1             TRUE\r
 #define STM32_SERIAL_USE_USART2             FALSE\r
 #define STM32_SERIAL_USE_USART3             TRUE\r
 #define STM32_SERIAL_USE_UART4              FALSE\r