Subversion Repositories HomeAutomation

Rev

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

Rev 1910 Rev 1978
Line 47... Line 47...
47
    uint8_t suffixPattern[3];
47
    uint8_t suffixPattern[3];
48
} filter;
48
} filter;
49
 
49
 
50
static StdCan_Msg_t msg;
50
static StdCan_Msg_t msg;
51
 
51
 
52
#ifdef sns_Serial_USEEEPROM
52
#if sns_Serial_USEEEPROM==1
53
#include "sns_Serial_eeprom.h"
53
#include "sns_Serial_eeprom.h"
54
struct eeprom_sns_Serial EEMEM eeprom_sns_Serial =
54
struct eeprom_sns_Serial EEMEM eeprom_sns_Serial =
55
{
55
{
56
    {
56
    {
57
        9600,   // baudRate
57
        9600,   // baudRate
Line 174... Line 174...
174
}
174
}
175
 
175
 
176
 
176
 
177
void sns_Serial_Init()
177
void sns_Serial_Init()
178
{
178
{
179
#ifdef sns_Serial_USEEEPROM
179
#if sns_Serial_USEEEPROM==1
180
    if (EEDATA_OK) {
180
    if (EEDATA_OK) {
181
    //if (0) {
181
    //if (0) {
182
#if ((__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ == 6 && __AVR_LIBC_REVISION__ >=2)||(__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ > 6)||__AVR_LIBC_MAJOR__ > 1)
182
#if ((__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ == 6 && __AVR_LIBC_REVISION__ >=2)||(__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ > 6)||__AVR_LIBC_MAJOR__ > 1)
183
        baudRate = eeprom_read_dword(EEDATA32.baudRate);
183
        baudRate = eeprom_read_dword(EEDATA32.baudRate);
184
#else
184
#else
Line 333... Line 333...
333
                uint8_t returnval = sns_Serial_setSettings();
333
                uint8_t returnval = sns_Serial_setSettings();
334
               
334
               
335
                if (returnval)
335
                if (returnval)
336
                {
336
                {
337
                // update EEPROM data
337
                // update EEPROM data
338
#ifdef sns_Serial_USEEEPROM
338
#if sns_Serial_USEEEPROM==1
339
#if ((__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ == 6 && __AVR_LIBC_REVISION__ >=2)||(__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ > 6)||__AVR_LIBC_MAJOR__ > 1)
339
#if ((__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ == 6 && __AVR_LIBC_REVISION__ >=2)||(__AVR_LIBC_MAJOR__ == 1  && __AVR_LIBC_MINOR__ > 6)||__AVR_LIBC_MAJOR__ > 1)
340
                eeprom_write_dword_crc(EEDATA32.baudRate, baudRate, WITHOUT_CRC);
340
                eeprom_write_dword_crc(EEDATA32.baudRate, baudRate, WITHOUT_CRC);
341
#else
341
#else
342
#warning This version of AVR-libc does not have support for eeprom read dword
342
#warning This version of AVR-libc does not have support for eeprom read dword
343
#endif
343
#endif