Revision 1461

Added by Brad Neuman over 13 years ago

updated all the library code to have sensible _init behavior.
Almost all of the library components have a global variable which gets set after init and the functions inside will fail with an error code if init has not been called. Also, the init functions themselves check this variable and will bail out without doing any damage if that init has already been called

View differences:

37 37
#ifndef _TIME_H_
38 38
#define _TIME_H_
39 39

#include <dragonfly_lib.h>

40 42
/*	Predefined times for prescale_opt in time.c.
41 43
	To make you own, know that a pulse is 1/16th of a second. You cannot get less than this. To get more, you need
42 44
	to know how many 16ths of a second are in the time you want. (Time_desired * 16 = prescaler_opt)
63 65
/** @brief Delay execution for the specified time **/
64 66
void delay_ms(int ms) ;
65 67
/** @brief Enable the realtime clock **/
void rtc_init(int prescale_opt, void (*rtc_func)(void));
int rtc_init(int prescale_opt, void (*rtc_func)(void));
67 69
/** @brief Reset the counter of the realtime clock **/
68 70
void rtc_reset(void);
69 71
/** @brief Get the value of the realtime clock. **/

Also available in: Unified diff