00001 /* 00002 * AP_EEProm.cpp 00003 * Copyright (C) James Goppert 2010 <james.goppert@gmail.com> 00004 * 00005 * This file is free software: you can redistribute it and/or modify it 00006 * under the terms of the GNU General Public License as published by the 00007 * Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This file is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 * See the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #include <AP_EEProm.h> 00020 00021 void AP_EEPromRegistry::add(AP_EEPromEntry * entry, uint16_t & id, uint16_t & address, size_t size) 00022 { 00023 if (_newAddress + size > _maxSize) return; 00024 address = _newAddress; 00025 _newAddress += size; 00026 id = _newId++; 00027 push_back(entry); 00028 } 00029 00030 extern AP_EEPromRegistry eepromRegistry(1024);