repositories
/
mTask.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e6e1e9d
)
add ifdefs to interface.h
author
Mart Lubbers
<mart@martlubbers.net>
Mon, 20 Mar 2017 10:55:28 +0000
(11:55 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Mon, 20 Mar 2017 10:55:28 +0000
(11:55 +0100)
client/Makefile
patch
|
blob
|
history
client/interface.c
patch
|
blob
|
history
client/interface.h
patch
|
blob
|
history
client/interpret.c
patch
|
blob
|
history
client/mcuconf.h
patch
|
blob
|
history
diff --git
a/client/Makefile
b/client/Makefile
index
d0f5454
..
0ca27f1
100644
(file)
--- a/
client/Makefile
+++ b/
client/Makefile
@@
-118,6
+118,8
@@
CSRC = $(STARTUPSRC) \
$(PLATFORMSRC) \
\r
$(BOARDSRC) \
\r
$(TESTSRC) \
\r
$(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
$(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
diff --git
a/client/interface.c
b/client/interface.c
index
9ddd214
..
fae81db
100644
(file)
--- a/
client/interface.c
+++ b/
client/interface.c
@@
-86,6
+86,9
@@
void setup(void)
halInit();
chSysInit();
sdStart(&SD3, NULL);
halInit();
chSysInit();
sdStart(&SD3, NULL);
+ sdStart(&SD1, NULL);
+
+
}
void debug(char *fmt, ...)
}
void debug(char *fmt, ...)
diff --git
a/client/interface.h
b/client/interface.h
index
eee3457
..
9e81810
100644
(file)
--- a/
client/interface.h
+++ b/
client/interface.h
@@
-36,14
+36,20
@@
uint8_t read_byte(void);
void write_byte(uint8_t b);
/* Analog and digital pins */
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);
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);
void write_apin(uint8_t i, uint8_t a);
uint8_t read_apin(uint8_t i);
+#endif
/* UserLED */
/* UserLED */
+#if HAVELED == 1
void led_on(uint8_t i);
void led_off(uint8_t i);
void led_on(uint8_t i);
void led_off(uint8_t i);
+#endif
/* Delay and communication */
long millis(void);
/* Delay and communication */
long millis(void);
diff --git
a/client/interpret.c
b/client/interpret.c
index
51e2951
..
b9d0c88
100644
(file)
--- a/
client/interpret.c
+++ b/
client/interpret.c
@@
-138,6
+138,7
@@
void run_task(struct task *t)
break;
case BCSERIALPARSEINT: trace("SerialParseInt()");
break;
break;
case BCSERIALPARSEINT: trace("SerialParseInt()");
break;
+#if HAVEAIO == 1
case BCANALOGREAD: trace("AnalogRead(%d)", program[pc]);
stack[sp++] = read_apin(program[pc++]);
break;
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;
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;
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;
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--;
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;
led_off(stack[sp-1]);
sp--;
break;
+#endif
default:
trace("unrecognized");
die("Unrecognized command: %d", program[pc-1]);
default:
trace("unrecognized");
die("Unrecognized command: %d", program[pc-1]);
diff --git
a/client/mcuconf.h
b/client/mcuconf.h
index
2886487
..
b01b315
100644
(file)
--- a/
client/mcuconf.h
+++ b/
client/mcuconf.h
@@
-264,7
+264,7
@@
/*
\r
* SERIAL driver system settings.
\r
*/
\r
/*
\r
* SERIAL driver system settings.
\r
*/
\r
-#define STM32_SERIAL_USE_USART1
FALS
E
\r
+#define STM32_SERIAL_USE_USART1
TRU
E
\r
#define STM32_SERIAL_USE_USART2 FALSE
\r
#define STM32_SERIAL_USE_USART3 TRUE
\r
#define STM32_SERIAL_USE_UART4 FALSE
\r
#define STM32_SERIAL_USE_USART2 FALSE
\r
#define STM32_SERIAL_USE_USART3 TRUE
\r
#define STM32_SERIAL_USE_UART4 FALSE
\r