diff --git a/Makefile b/Makefile index 67cc910..e44caea 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ PROJECT := main BUILD_DIR := bin -CFILES := main.c system.c -# CFILES += $(wildcard *.c) +# CFILES := main.c system.c +CFILES += $(wildcard *.c) OPENCM3_DIR := ./libopencm3 # Check if libopencm3 is available before including anything diff --git a/crypto.c b/crypto.c index 6df3060..7f09ead 100644 --- a/crypto.c +++ b/crypto.c @@ -9,7 +9,7 @@ static uint8_t seed[32]; static uint8_t signature[64]; -void crypto(void) { +void crypto_demo(void) { crypto_eddsa_key_pair(sk, pk, seed); char *msg = "Hello\n"; diff --git a/crypto.h b/crypto.h index 6f70f09..f93f914 100644 --- a/crypto.h +++ b/crypto.h @@ -1 +1,3 @@ #pragma once + +void crypto_demo(void); diff --git a/system.c b/system.c index c1ec96e..86b3b67 100644 --- a/system.c +++ b/system.c @@ -4,6 +4,7 @@ volatile uint64_t ticks; +__attribute__((interrupt)) void sys_tick_handler(void); void sys_tick_handler(void) { ticks++; } uint64_t sys_ticks_get(void) { return ticks; } diff --git a/system.h b/system.h index 84823af..9f86a9b 100644 --- a/system.h +++ b/system.h @@ -1,7 +1,7 @@ #pragma once #include -void sys_tick_handler(void); +// void sys_tick_handler(void); uint64_t sys_get_ticks(void); void sys_tick_setup(void); uint64_t sys_ticks_get(void); diff --git a/uart.c b/uart.c index 9947a18..7267a80 100644 --- a/uart.c +++ b/uart.c @@ -1,8 +1,9 @@ #include #include #include +#include "uart.h" -static void usart_setup(void) { +void usart_setup(void) { rcc_periph_clock_enable(RCC_GPIOA); rcc_periph_clock_enable(RCC_USART1); diff --git a/uart.h b/uart.h new file mode 100644 index 0000000..8392332 --- /dev/null +++ b/uart.h @@ -0,0 +1,3 @@ +#pragma once + +void usart_setup(void);