From f04c640c05e9ffe894f67194832623e28a8000f5 Mon Sep 17 00:00:00 2001 From: J08nY Date: Tue, 18 Feb 2020 18:04:59 +0100 Subject: Rework client. --- pyecsca/codegen/hal/host/host_hal.h | 1 + pyecsca/codegen/hal/host/uart.c | 4 +++- pyecsca/codegen/hal/host/uart.h | 2 ++ pyecsca/codegen/hal/stm32f0/stm32f0_hal.h | 1 + pyecsca/codegen/hal/stm32f3/stm32f3_hal.h | 1 + pyecsca/codegen/hal/xmega/xmega_hal.h | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) (limited to 'pyecsca/codegen/hal') 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;} -- cgit v1.3.1