From 56c268e88a87f708de1824d87fbf7b824d4c1c2a Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 25 Oct 2020 16:52:57 +0100 Subject: Remove any Heap Allocation --- usart_irq/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usart_irq') diff --git a/usart_irq/main.c b/usart_irq/main.c index c3e7966..8c79471 100644 --- a/usart_irq/main.c +++ b/usart_irq/main.c @@ -11,6 +11,8 @@ #define DELAY 1000000 +#define RX_BUFFER_SIZE 50 +#define TX_BUFFER_SIZE 50 void clock_init(void); @@ -24,13 +26,16 @@ USART usart3; int main(void) { + uint8_t rx_buffer[RX_BUFFER_SIZE]; + uint8_t tx_buffer[TX_BUFFER_SIZE]; + clock_init(); gpio_init(); - usart_init(&usart3); + usart_init(&usart3, rx_buffer, RX_BUFFER_SIZE, tx_buffer, TX_BUFFER_SIZE); gpio_set(GPIOC, GPIO13); - char welcome[] = "Hallo Freunde!\r"; + char welcome[] = "Hello world!\r"; usart_write(&usart3, welcome); uint8_t buff; -- cgit v1.2.3-70-g09d2