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%
This commit is contained in:
Nico Tonnhofer 2015-11-21 10:14:02 +01:00
parent a798cfac34
commit 42b26d9c20
1 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,9 @@
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__
#include "cmsis-core_cm4.h"
#include "clock.h"
/** Timer initialisation. /** Timer initialisation.
@ -45,8 +48,8 @@ void timer_init() {
*/ */
void SysTick_Handler(void) { void SysTick_Handler(void) {
#ifndef __ARMEL_NOTYET__
clock_tick(); clock_tick();
#ifndef __ARMEL_NOTYET__
dda_clock(); dda_clock();
#endif /* __ARMEL_NOTYET__ */ #endif /* __ARMEL_NOTYET__ */
} }