Subversion Repositories Projects

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

/*****************************************************************************
 *   Copyright (C) 2010 seb@exse.net                                                                             *
 *   Copyright (C) 2011 Christian Brandtner brandtner@brandtner.net          *
 *                                                                           *
 *   This program is free software; you can redistribute it and/or modify    *
 *   it under the terms of the GNU General Public License as published by    *
 *   the Free Software Foundation; either version 2 of the License.          *
 *                                                                           *
 *   This program is distributed in the hope that it will be useful,         *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 *   GNU General Public License for more details.                            *
 *                                                                           *
 *   You should have received a copy of the GNU General Public License       *
 *   along with this program; if not, write to the                           *
 *   Free Software Foundation, Inc.,                                         *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.               *
 *                                                                           *
 *****************************************************************************/

/*14.6.2011 Parameter erweitert Wi232 Cebra */

#include <avr/io.h>
#include <avr/eeprom.h>

#include "eeprom.h"

//*****************************************************************************
//

uint8_t EE_LowBat               EEMEM= 137;
uint8_t EE_DisplayTimeout       EEMEM= 0;
uint8_t EE_DisplayLanguage      EEMEM= 0;
uint8_t EE_WiTXRXChannel        EEMEM= 1;
uint8_t EE_WiNetworkGroup       EEMEM=66;
volatile uint8_t DisplayTimeout;
volatile uint8_t DisplayLanguage;
volatile uint8_t WiTXRXChannel;
volatile uint8_t WiNetworkGroup;
//*****************************************************************************
//
void ReadParameter (void)
{
        MK_LowBat = eeprom_read_byte(&EE_LowBat);
        DisplayTimeout = eeprom_read_byte(&EE_DisplayTimeout);
        DisplayLanguage = eeprom_read_byte(&EE_DisplayLanguage);
        WiTXRXChannel =eeprom_read_byte(&EE_WiTXRXChannel);
        WiNetworkGroup =eeprom_read_byte(&EE_WiNetworkGroup);
}

//*****************************************************************************
//
void WriteParameter (void)
{
         eeprom_write_byte(&EE_LowBat, MK_LowBat);
         eeprom_write_byte(&EE_DisplayTimeout, DisplayTimeout);
         eeprom_write_byte(&EE_DisplayLanguage, DisplayLanguage);
         eeprom_write_byte(&EE_WiTXRXChannel, WiTXRXChannel);
         eeprom_write_byte(&EE_WiNetworkGroup, WiNetworkGroup);
}