Subversion Repositories HomeAutomation

Rev

Rev 989 | Rev 1106 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 989 Rev 1062
Line 1... Line 1...
1
 
1
 
2
#include "<template>.h"
2
#include "<template>.h"
-
 
3
 
-
 
4
#ifdef <template>_USEEEPROM
-
 
5
struct eeprom_<template> EEMEM eeprom_<template> =
-
 
6
{
-
 
7
    {
-
 
8
        ///TODO: Define initialization values on the EEPROM variables here, this will generate a *.eep file that can be used to store this values to the node, can in future be done with a EEPROM module and the make-scrips. Write the values in the exact same order as the struct is defined in the *.h file. 
-
 
9
        0xAB,   // x
-
 
10
        0x1234  // y
-
 
11
    },
-
 
12
    0   // crc, must be a correct value, but this will also be handled by the EEPROM module or make scripts
-
 
13
};
-
 
14
#endif
3
 
15
 
4
void <template>_Init(void)
16
void <template>_Init(void)
5
{
17
{
-
 
18
#ifdef <template>_USEEEPROM
-
 
19
    if (EEDATA_OK)
-
 
20
    {
-
 
21
      ///TODO: Use stored data to set initial values for the module
-
 
22
      blablaX = eeprom_read_byte(EEDATA.x);
-
 
23
      blablaY = eeprom_read_word(EEDATA.y);
-
 
24
    } else
-
 
25
    {   //The CRC of the EEPROM is not correct, store default values and update CRC
-
 
26
      eeprom_write_byte_crc(EEDATA.x, 0xAB, WITHOUT_CRC);
-
 
27
      eeprom_write_word_crc(EEDATA.y, 0x1234, WITHOUT_CRC);
-
 
28
      EEDATA_UPDATE_CRC;
-
 
29
    }
-
 
30
#endif  
6
    ///TODO: Initialize hardware etc here
31
    ///TODO: Initialize hardware etc here
-
 
32
 
7
}
33
}
8
 
34
 
9
void <template>_Process(void)
35
void <template>_Process(void)
10
{
36
{
11
    ///TODO: Stuff that needs doing is done here
37
    ///TODO: Stuff that needs doing is done here