ARM: 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...     lpc1114
    FLASH  :  4440 bytes          14%
    RAM    :   200 bytes           5%
    EEPROM :     0 bytes           0%
This commit is contained in:
Markus Hitter 2015-08-01 16:06:33 +02:00
parent ec8f0133bf
commit c118d00383
4 changed files with 11 additions and 4 deletions

View File

@ -98,7 +98,7 @@ TARGET = $(PROGRAM).hex
# Until the generic ARM port is completed, we'd have to wrap all sources
# in #ifdef __AVR__. To avoid this, build only a selection for now:
SOURCES = mendel.c cpu.c serial.c sermsg.c sersendf.c delay.c
SOURCES += gcode_parse.c gcode_process.c pinio.c timer.c
SOURCES += gcode_parse.c gcode_process.c pinio.c timer.c clock.c
ifeq ($(MCU), lpc1114)
SOURCES += cmsis-system_lpc11xx.c
endif

View File

@ -71,7 +71,11 @@ void clock_tick(void) {
called from clock_10ms(), do not call directly
*/
static void clock_250ms(void) {
#ifndef __ARMEL_NOTYET__
if (heaters_all_zero()) {
#else
if (1) {
#endif /* __ARMEL_NOTYET__, ! __ARMEL_NOTYET__ */
if (psu_timeout > (30 * 4)) {
power_off();
}
@ -114,7 +118,9 @@ static void clock_10ms(void) {
// reset watchdog
wd_reset();
#ifndef __ARMEL_NOTYET__
temp_sensor_tick();
#endif /* __ARMEL_NOTYET__ */
ifclock(clock_flag_250ms) {
clock_250ms();

View File

@ -44,8 +44,8 @@
#include "analog.h"
#endif /* __ARMEL_NOTYET__ */
#include "pinio.h"
#ifndef __ARMEL_NOTYET__
#include "clock.h"
#ifndef __ARMEL_NOTYET__
#include "intercom.h"
#include "spi.h"
#include "sd.h"
@ -222,8 +222,8 @@ int main (void)
#endif /* CANNED_CYCLE */
}
#endif /* __ARMEL_NOTYET__ */
clock();
#endif /* __ARMEL_NOTYET__ */
}
}

View File

@ -8,6 +8,7 @@
#if defined TEACUP_C_INCLUDE && defined __ARMEL__
#include "cmsis-core_cm0.h"
#include "clock.h"
/** Timer initialisation.
@ -53,8 +54,8 @@ void timer_init() {
*/
void SysTick_Handler(void) {
#ifndef __ARMEL_NOTYET__
clock_tick();
#ifndef __ARMEL_NOTYET__
dda_clock();
#endif /* __ARMEL_NOTYET__ */
}