Project

General

Profile

Revision 1461

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:

bom.h
57 57

  
58 58

  
59 59
/** @brief Initialize the bom according to bom type **/
60
void bom_init(char type);
60
int bom_init(char type);
61 61

  
62 62
/** @brief Refresh bom_val[] with new values from analog8.  analog_init and bom_init must be called for this to work. **/
63
void bom_refresh(int bit_field);
63
int bom_refresh(int bit_field);
64 64

  
65 65
/** @brief Gets the bom reading from bom_val[which].  Call bom_refresh beforehand to read new bom values. **/
66 66
int bom_get(int which);
......
72 72
int bom_get_max10(int *dist);
73 73

  
74 74
/** @brief Enables the selected bom leds on a BOM1.5 **/
75
void bom_set_leds(int bit_field);
75
int bom_set_leds(int bit_field);
76 76

  
77 77
/** @brief (DEPRECATED) Gets and compares all bom values.  Returns the index to the highest value element since last refresh. **/
78 78
int get_max_bom(void);
79 79

  
80 80
/** @brief Turns on all BOM leds, or turns on enabled leds on a BOM1.5. **/
81
void bom_on(void);
81
int bom_on(void);
82 82

  
83 83
/** @brief Turns off all bom leds. **/
84
void bom_off(void);
84
int bom_off(void);
85 85

  
86 86
/** @} **/
87 87

  

Also available in: Unified diff