Satellite Observers Workbench. NOT yet complete, just published for forum posters to \"cherry pick\" pieces of code as requiered as an example.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers config.h Source File

config.h

00001 /****************************************************************************
00002  *    Copyright 2010 Andy Kirkham, Stellar Technologies Ltd
00003  *    
00004  *    This file is part of the Satellite Observers Workbench (SOWB).
00005  *
00006  *    SOWB is free software: you can redistribute it and/or modify
00007  *    it under the terms of the GNU General Public License as published by
00008  *    the Free Software Foundation, either version 3 of the License, or
00009  *    (at your option) any later version.
00010  *
00011  *    SOWB is distributed in the hope that it will be useful,
00012  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *    GNU General Public License for more details.
00015  *
00016  *    You should have received a copy of the GNU General Public License
00017  *    along with SOWB.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  *    $Id: main.cpp 5 2010-07-12 20:51:11Z ajk $
00020  *    
00021  ***************************************************************************/
00022 
00023 #ifndef CONFIG_H
00024 #define CONFIG_H
00025 
00026 #include "flash.h"
00027 
00028 #define CONFIG_MAX_SIZE         4096
00029 #define CONFIG_FLASH_PAGES      CONFIG_MAX_SIZE / FLASH_PAGE_SIZE
00030 #define CONFIG_FLASH_PAGE_BASE  3840 - CONFIG_FLASH_PAGES
00031 
00032 typedef struct _config_values {
00033     int config_struct_version;
00034 } CONFIG_VALUES;
00035 
00036 typedef union _config_union {
00037     char buffers[CONFIG_FLASH_PAGES][FLASH_PAGE_SIZE];
00038     CONFIG_VALUES   values;
00039 } CONFIG_UNION;
00040 
00041 void config_init(void);
00042 void config_process(void);
00043 void config_copy_flash_page(int page, char *buffer);
00044 char * config_get_page(int page);
00045 
00046 #endif