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:
parent
ec8f0133bf
commit
c118d00383
|
|
@ -98,7 +98,7 @@ TARGET = $(PROGRAM).hex
|
||||||
# Until the generic ARM port is completed, we'd have to wrap all sources
|
# 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:
|
# 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 = 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)
|
ifeq ($(MCU), lpc1114)
|
||||||
SOURCES += cmsis-system_lpc11xx.c
|
SOURCES += cmsis-system_lpc11xx.c
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
6
clock.c
6
clock.c
|
|
@ -71,7 +71,11 @@ void clock_tick(void) {
|
||||||
called from clock_10ms(), do not call directly
|
called from clock_10ms(), do not call directly
|
||||||
*/
|
*/
|
||||||
static void clock_250ms(void) {
|
static void clock_250ms(void) {
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
if (heaters_all_zero()) {
|
if (heaters_all_zero()) {
|
||||||
|
#else
|
||||||
|
if (1) {
|
||||||
|
#endif /* __ARMEL_NOTYET__, ! __ARMEL_NOTYET__ */
|
||||||
if (psu_timeout > (30 * 4)) {
|
if (psu_timeout > (30 * 4)) {
|
||||||
power_off();
|
power_off();
|
||||||
}
|
}
|
||||||
|
|
@ -114,7 +118,9 @@ static void clock_10ms(void) {
|
||||||
// reset watchdog
|
// reset watchdog
|
||||||
wd_reset();
|
wd_reset();
|
||||||
|
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
temp_sensor_tick();
|
temp_sensor_tick();
|
||||||
|
#endif /* __ARMEL_NOTYET__ */
|
||||||
|
|
||||||
ifclock(clock_flag_250ms) {
|
ifclock(clock_flag_250ms) {
|
||||||
clock_250ms();
|
clock_250ms();
|
||||||
|
|
|
||||||
4
mendel.c
4
mendel.c
|
|
@ -44,8 +44,8 @@
|
||||||
#include "analog.h"
|
#include "analog.h"
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
#endif /* __ARMEL_NOTYET__ */
|
||||||
#include "pinio.h"
|
#include "pinio.h"
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
#include "clock.h"
|
#include "clock.h"
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
#include "intercom.h"
|
#include "intercom.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "sd.h"
|
#include "sd.h"
|
||||||
|
|
@ -222,8 +222,8 @@ int main (void)
|
||||||
|
|
||||||
#endif /* CANNED_CYCLE */
|
#endif /* CANNED_CYCLE */
|
||||||
}
|
}
|
||||||
|
#endif /* __ARMEL_NOTYET__ */
|
||||||
|
|
||||||
clock();
|
clock();
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#if defined TEACUP_C_INCLUDE && defined __ARMEL__
|
#if defined TEACUP_C_INCLUDE && defined __ARMEL__
|
||||||
|
|
||||||
#include "cmsis-core_cm0.h"
|
#include "cmsis-core_cm0.h"
|
||||||
|
#include "clock.h"
|
||||||
|
|
||||||
|
|
||||||
/** Timer initialisation.
|
/** Timer initialisation.
|
||||||
|
|
@ -53,8 +54,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__ */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue