Open Garden  0.10.1-21
Functions
date.h File Reference

time high level functions. More...

#include "debug.h"
#include "time.h"
Include dependency graph for date.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void date_set (char *cmd, struct debug_t *debug)
 
void date_setrtc (char *cmd)
 
struct tmdate_init (struct tm *tm_clock, struct debug_t *debug)
 
void date_free (struct tm *tm_clock)
 
void date_rtc (struct debug_t *debug)
 
void date (struct debug_t *debug)
 
void date_hwclock_start (void)
 
void date_hwclock_stop (void)
 
uint8_t date_timetorun (struct tm *tm_clock, struct debug_t *debug)
 check if it is the time to run a program. More...
 

Detailed Description

time high level functions.

Function Documentation

◆ date()

void date ( struct debug_t debug)

print the current time

◆ date_free()

void date_free ( struct tm tm_clock)

free the allocated structure

◆ date_hwclock_start()

void date_hwclock_start ( void  )

start the hardware clock now, high level call to rtc start.

◆ date_hwclock_stop()

void date_hwclock_stop ( void  )

stop the hardware clock

◆ date_init()

struct tm* date_init ( struct tm tm_clock,
struct debug_t debug 
)

adjust the internal clock

◆ date_rtc()

void date_rtc ( struct debug_t debug)

print the current rtc time

◆ date_set()

void date_set ( char *  cmd,
struct debug_t debug 
)

Set the date from the command line in a human form.

Parameters
cmdthe string in the format YYYYMMDDhhmm.
debugprinting and string stuff.

◆ date_setrtc()

void date_setrtc ( char *  cmd)

Extract abstime from the command and set it to the RTC clock

◆ date_timetorun()

uint8_t date_timetorun ( struct tm tm_clock,
struct debug_t debug 
)

check if it is the time to run a program.

Every time date_timetorun is called, it has stored in a static variable the last time as minute we activate a check trough all the programs to see if some has to start or to stop. If the time (minutes) are the same stored, then for this minute we are done and exit, else, if for this minute we did not check the programs list, do it.

Parameters
*tm_clockThe time.
debug
Returns
true - Execute, false - don't
Note
any call updates the struct tm to now.

static store at which last time (minutes) we run programs, needed to avoid re-execution of programs in the same minute.