From 42b26d9c20373df9b70719b8029910455eb745a8 Mon Sep 17 00:00:00 2001 From: Nico Tonnhofer Date: Sat, 21 Nov 2015 10:14:02 +0100 Subject: [PATCH] STM32F411: get clock.c in. No code changes neccessary. This code in ifclock(clock_flag_1s) in clock.c should give a nice, accurate clock: static uint8_t minutes = 0, seconds = 0; seconds++; if ( ! (seconds % 60)) { seconds = 0; minutes++; } sersendf_P(PSTR("%su:"), minutes); if (seconds < 10) serial_writechar('0'); sersendf_P(PSTR("%su\n"), seconds); Current sizes are: SIZES ARM... stm32f411 FLASH : 4464 bytes 1% RAM : 204 bytes 1% EEPROM : 0 bytes 0% --- timer-stm32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/timer-stm32.c b/timer-stm32.c index bf5845a..21f7bea 100644 --- a/timer-stm32.c +++ b/timer-stm32.c @@ -7,6 +7,9 @@ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ +#include "cmsis-core_cm4.h" +#include "clock.h" + /** Timer initialisation. @@ -45,8 +48,8 @@ void timer_init() { */ void SysTick_Handler(void) { - #ifndef __ARMEL_NOTYET__ clock_tick(); + #ifndef __ARMEL_NOTYET__ dda_clock(); #endif /* __ARMEL_NOTYET__ */ }