summaryrefslogtreecommitdiff
path: root/usart_irq
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2020-10-25 16:52:57 +0100
committerxengineering <mail2xengineering@protonmail.com>2020-10-25 16:52:57 +0100
commit56c268e88a87f708de1824d87fbf7b824d4c1c2a (patch)
tree0a4ab861b2f03c2fde1de8d7a3b61d2603b4d503 /usart_irq
parent58d3787ca563b7d6a2cb4e0a1ab7fdde67fd5557 (diff)
downloadstm32f103c8-examples-56c268e88a87f708de1824d87fbf7b824d4c1c2a.tar
stm32f103c8-examples-56c268e88a87f708de1824d87fbf7b824d4c1c2a.tar.zst
stm32f103c8-examples-56c268e88a87f708de1824d87fbf7b824d4c1c2a.zip
Remove any Heap Allocation
Diffstat (limited to 'usart_irq')
-rw-r--r--usart_irq/main.c9
1 files changed, 7 insertions, 2 deletions
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;