58 #include <util/atomic.h> 111 #if defined BOARD_PROTO_128 //ProtoBoardMega128 121 #elif defined BOARD_PROTO_48 //ProtoBoardMega48 189 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
212 #pragma GCC diagnostic push // avoid false positive on gcc 4.9.2 213 #pragma GCC diagnostic ignored "-Wreturn-type" 216 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
221 #pragma GCC diagnostic pop 241 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
253 #pragma GCC diagnostic push // avoid false positive on gcc 4.9.2 254 #pragma GCC diagnostic ignored "-Wreturn-type" 257 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
262 #pragma GCC diagnostic pop 272 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
284 #pragma GCC diagnostic push // avoid false positive on gcc 4.9.2 285 #pragma GCC diagnostic ignored "-Wreturn-type" 288 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
293 #pragma GCC diagnostic pop 303 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
315 #pragma GCC diagnostic push // avoid false positive on gcc 4.9.2 316 #pragma GCC diagnostic ignored "-Wreturn-type" 319 ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
324 #pragma GCC diagnostic pop 495 if (ucClock.
hour >= 24)
uint8_t ClockIsRunning(void)
Value used as parameter to ClockSetStatus() to start clock.
#define CLOCK_DDR
Datadirectionreg of port for clock pulsebits.
#define CLOCK_PULSE_ENABLE12
Portbit for enable clock pulse line 1.
static uint8_t ucClockTimeFactor
A struct with hour and minute.
void ClockSetTime(fclock_t newValue)
Set actual time.
uint8_t ClockReadTimeFactor(void)
Get time factor.
void ClockSetStatus(uint8_t ucStatus)
Set status of pulse generator.
uint8_t ClockReadEndTimeMinute(void)
Get the minute of the end time.
void ClockSetStartTimeMinute(uint8_t ucMinute)
Set the minute of the start time.
#define CLOCK_TIME_FACTOR_MIN
minimum *10 (10 = 1:1,0)
static void ClockGeneratePulse(void)
This function is called by SysHWTimer every 100ms.
#define CLOCK_STATUS_TIME
Status Bit of pulse generator: with/without increment of actual time.
static volatile uint16_t uiClockPulse
Length of pulse on the clock line.
void ClockSetStartTimeHour(uint8_t ucHour)
Set the hour of the start time.
uint8_t minute
minute value 0..59
void ClockSetEndTimeHour(uint8_t ucHour)
Set the hour of the end time.
void ClockSetEndTimeMinute(uint8_t ucMinute)
Set the minute of the end time.
void ClockKernelInit(void)
Initialization of the pulse generator.
#define CLOCK_STATUS_RUN
Status Bit of pulse generator: start/stop.
#define CLOCK_PERIOD_10
10 times counts needed for 1 min in 1:1
static volatile bool ucClockOddPulse
odd minute?!
#define CLOCK_TIME_FACTOR_MAX
maximum *10 (119 = 1:11.9)
void ClockSetPeriod(uint16_t uiPeriod)
Set length of model minute in 100ms.
static uint8_t ucEndTimeHour
#define CLOCK_PORT
Port for clock pulsebits.
static volatile uint16_t uiClockPeriod
Value of minute in model time (60 in 1:1) at least 2*uiClockPulse.
static uint8_t ucEndTimeMinute
#define CLOCK_PULSE_ENABLE34
Portbit for enable clock pulse line 2.
uint8_t ClockReadEndTimeHour(void)
Get the hour of the end time.
uint8_t hour
hour value 0..23
void ClockSetTimeFactor(uint8_t ucFactor)
Set time factor.
uint16_t ClockReadPulse(void)
Get length of pulse length in 100ms.
static volatile uint16_t uiClockTimer
Gets decremented every 100 milliseconds by interrupt.
#define CLOCK_MIDNIGHT
"00:00" alias "24:00"
void SysTimerUserInterrupt10(void)
This function is called by SysHWTimer every 10ms.
System wide Definitions for FREMO Clock.
uint16_t ClockReadPeriod(void)
Get length of model minute in 100ms.
#define CLOCK_PULSE_ODD
Portbit for odd clock pulse.
static volatile uint8_t ucClockStatus
Clock status byte.
uint8_t ClockReadStartTimeHour(void)
Get the hour of the start time.
void SysTimerUserInterrupt(void)
This function is called by SysHWTimer every 1ms.
void ClockSetPulse(uint16_t uiPulse)
Set length of pulse length in 100ms.
uint8_t ClockReadStartTimeMinute(void)
Get the minute of the start time.
uint8_t ClockReadStatus(void)
Read status of pulse generator.
User function called by timer ISR.
static uint8_t ucStartTimeHour
void SysTimerUserInterrupt100(void)
This function is called by SysHWTimer every 100ms.
static volatile fclock_t ucClock
actual model time
#define CLOCK_PULSE_EVEN
Portbit for even clock pulse.
fclock_t ClockGetTime(void)
Get actual time.
static uint8_t ucStartTimeMinute