aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/hal
diff options
context:
space:
mode:
authorJ08nY2020-02-18 18:04:59 +0100
committerJ08nY2020-02-18 18:04:59 +0100
commitf04c640c05e9ffe894f67194832623e28a8000f5 (patch)
tree192683de3385305c0091607214d9396555add3c9 /pyecsca/codegen/hal
parent29326d606cc073a0f4e62b65540998f62f242445 (diff)
downloadpyecsca-codegen-f04c640c05e9ffe894f67194832623e28a8000f5.tar.gz
pyecsca-codegen-f04c640c05e9ffe894f67194832623e28a8000f5.tar.zst
pyecsca-codegen-f04c640c05e9ffe894f67194832623e28a8000f5.zip
Rework client.
Diffstat (limited to 'pyecsca/codegen/hal')
-rw-r--r--pyecsca/codegen/hal/host/host_hal.h1
-rw-r--r--pyecsca/codegen/hal/host/uart.c4
-rw-r--r--pyecsca/codegen/hal/host/uart.h2
-rw-r--r--pyecsca/codegen/hal/stm32f0/stm32f0_hal.h1
-rw-r--r--pyecsca/codegen/hal/stm32f3/stm32f3_hal.h1
-rw-r--r--pyecsca/codegen/hal/xmega/xmega_hal.h1
6 files changed, 9 insertions, 1 deletions
diff --git a/pyecsca/codegen/hal/host/host_hal.h b/pyecsca/codegen/hal/host/host_hal.h
index b78172c..26d8f4d 100644
--- a/pyecsca/codegen/hal/host/host_hal.h
+++ b/pyecsca/codegen/hal/host/host_hal.h
@@ -10,5 +10,6 @@
#define init_uart init_uart0
#define putch output_ch_0
#define getch input_ch_0
+#define flush flush_ch_0
#endif //HOST_HAL_H_
diff --git a/pyecsca/codegen/hal/host/uart.c b/pyecsca/codegen/hal/host/uart.c
index 0410462..1f8d947 100644
--- a/pyecsca/codegen/hal/host/uart.c
+++ b/pyecsca/codegen/hal/host/uart.c
@@ -4,4 +4,6 @@ void init_uart0(void) {}
int input_ch_0(void) { return getchar(); }
-void output_ch_0(char data) { putchar(data); } \ No newline at end of file
+void output_ch_0(char data) { putchar(data); }
+
+void flush_ch_0(void) { fflush(stdout); } \ No newline at end of file
diff --git a/pyecsca/codegen/hal/host/uart.h b/pyecsca/codegen/hal/host/uart.h
index ffbc964..e65bfff 100644
--- a/pyecsca/codegen/hal/host/uart.h
+++ b/pyecsca/codegen/hal/host/uart.h
@@ -10,4 +10,6 @@ int input_ch_0(void);
void output_ch_0(char data);
+void flush_ch_0(void);
+
#endif //UART_H_ \ No newline at end of file
diff --git a/pyecsca/codegen/hal/stm32f0/stm32f0_hal.h b/pyecsca/codegen/hal/stm32f0/stm32f0_hal.h
index 630a583..1cbdefc 100644
--- a/pyecsca/codegen/hal/stm32f0/stm32f0_hal.h
+++ b/pyecsca/codegen/hal/stm32f0/stm32f0_hal.h
@@ -4,6 +4,7 @@
void init_uart(void);
void putch(char c);
char getch(void);
+#define flush()
void trigger_setup(void);
void trigger_low(void);
diff --git a/pyecsca/codegen/hal/stm32f3/stm32f3_hal.h b/pyecsca/codegen/hal/stm32f3/stm32f3_hal.h
index 016c3be..b5fec45 100644
--- a/pyecsca/codegen/hal/stm32f3/stm32f3_hal.h
+++ b/pyecsca/codegen/hal/stm32f3/stm32f3_hal.h
@@ -24,6 +24,7 @@
void init_uart(void);
void putch(char c);
char getch(void);
+#define flush()
void trigger_setup(void);
void trigger_low(void);
diff --git a/pyecsca/codegen/hal/xmega/xmega_hal.h b/pyecsca/codegen/hal/xmega/xmega_hal.h
index d86f9a6..1647824 100644
--- a/pyecsca/codegen/hal/xmega/xmega_hal.h
+++ b/pyecsca/codegen/hal/xmega/xmega_hal.h
@@ -30,6 +30,7 @@
#define init_uart init_uart0
#define putch output_ch_0
#define getch input_ch_0
+#define flush()
#if PLATFORM == CW303
#define led_error(a) if (a) {PORTA.OUTCLR = PIN6_bm;} else {PORTA.OUTSET = PIN6_bm;}