Subversion Repositories HomeAutomation

Rev

Rev 1910 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1910 Rev 1977
Line 1... Line 1...
1
 
1
 
2
#include "act_multiSwitch.h"
2
#include "act_multiSwitch.h"
3
 
3
 
4
 
4
 
5
uint8_t activeSwitch = 0;
5
uint8_t activeSwitch = 0;
6
#ifdef act_multiSwitch_USEEEPROM
6
#if act_multiSwitch_USEEEPROM==1
7
#include "act_multiSwitch_eeprom.h"
7
#include "act_multiSwitch_eeprom.h"
8
struct eeprom_act_multiSwitch EEMEM eeprom_act_multiSwitch =
8
struct eeprom_act_multiSwitch EEMEM eeprom_act_multiSwitch =
9
{
9
{
10
  {
10
  {
11
    0x00,       // x
11
    0x00,       // x
Line 14... Line 14...
14
};
14
};
15
#endif
15
#endif
16
 
16
 
17
void act_multiSwitch_Init(void)
17
void act_multiSwitch_Init(void)
18
{
18
{
19
  #ifdef act_multiSwitch_USEEEPROM
19
  #if act_multiSwitch_USEEEPROM==1
20
  if (EEDATA_OK)
20
  if (EEDATA_OK)
21
  {
21
  {
22
    activeSwitch = eeprom_read_byte(EEDATA.activeSwitch);
22
    activeSwitch = eeprom_read_byte(EEDATA.activeSwitch);
23
  } else
23
  } else
24
  { //The CRC of the EEPROM is not correct, store default values and update CRC
24
  { //The CRC of the EEPROM is not correct, store default values and update CRC