/*************************************************************************** * nvram parameter read/write * * * * Copyright (C) 2011 - 2012 by Olaf Rempel * * razzor AT kopf MINUS tisch DOT de * * * * 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; 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. * ***************************************************************************/ #include #include #include #include #include #include "rgb16mpm.h" static uint16_t nvram_write_pos; struct _nvdata nvram_data; static struct _nvdata nvram_eeprom EEMEM = NVRAM_DEFAULTS; static struct _nvdata nvram_defaults PROGMEM = NVRAM_DEFAULTS; /* store nvram data to eeprom */ ISR(EE_RDY_vect) { EECR &= ~(1<> 8) & 0xFF; EEDR = ((uint8_t *)&nvram_data)[nvram_write_pos++]; cli(); EECR |= (1<> 8) & 0xFF; EEDR = ((uint8_t *)&nvram_data)[nvram_write_pos++]; cli(); EECR |= (1<