Move config stuff into own include. Iggy said its better :-)

This commit is contained in:
Stefan `Sec` Zehl 2011-08-01 01:12:21 +02:00
parent 621bca40b3
commit 5d0887be71
7 changed files with 14 additions and 32 deletions

View File

@ -1,6 +1,7 @@
#include <sysinit.h>
#include "basic/basic.h"
#include "basic/config.h"
#include "lcd/print.h"
#include "lcd/display.h"

View File

@ -1,6 +1,7 @@
#include <sysinit.h>
#include "basic/basic.h"
#include "basic/config.h"
#include "lcd/lcd.h"
#include "lcd/print.h"

View File

@ -186,37 +186,6 @@ void handleMenu(const struct MENU *the_menu);
#include "basic/idle.h"
// config.c
int readConfig(void);
int saveConfig(void);
void applyConfig(void);
struct CDESC {
char *name;
char value;
char min;
char max;
};
extern struct CDESC the_config[];
#define GLOBALversion (the_config[0].value)
#define GLOBALprivacy (the_config[1].value)
#define GLOBALdaytrig (the_config[2].value)
#define GLOBALdaytrighyst (the_config[3].value)
#define GLOBALdayinvert (the_config[4].value)
#define GLOBALlcdbacklight (the_config[5].value)
#define GLOBALlcdmirror (the_config[6].value)
#define GLOBALlcdinvert (the_config[7].value)
#define GLOBALlcdcontrast (the_config[8].value)
#define GLOBAL(x) GLOBAL ## x
#define SYSTICKSPEED 10
// itoa.c
#define F_ZEROS (1<<0)
#define F_LONG (1<<1)
@ -229,4 +198,8 @@ const char* IntToStr(int num, unsigned int mxlen, char flag);
#include "basic/simpletime.h"
// global
#define SYSTICKSPEED 10
#endif

View File

@ -4,8 +4,9 @@
#include "lcd/print.h"
#include "filesystem/ff.h"
#include "basic/random.h"
#include "basic/config.h"
#define CFGVER 23
#define CFGVER 24
struct CDESC the_config[]= {
{"version", CFGVER, CFGVER, CFGVER},
@ -20,6 +21,9 @@ struct CDESC the_config[]= {
{ NULL, 0, 0, 0 },
};
char nickname[MAXNICK]="anonymous";
char nickfont[FILENAMELEN];
#define CONFFILE "r0ket.cfg"
#define CONF_ITER for(int i=0;the_config[i].name!=NULL;i++)

View File

@ -1,6 +1,7 @@
#include <sysinit.h>
#include "basic/basic.h"
#include "basic/config.h"
#define SAMPCT (4)
uint32_t light=300*SAMPCT;

View File

@ -329,6 +329,7 @@ int ff_del_syncobj (_SYNC_t); /* Delete a sync object */
#endif
/* Utility functions */
#define FILENAMELEN 13 // 8+1+3+1
const char* f_get_rc_string (FRESULT rc);
void fsInit();

View File

@ -6,6 +6,7 @@
#include "core/ssp/ssp.h"
#include "gpio/gpio.h"
#include "basic/basic.h"
#include "basic/config.h"
#include "usb/usbmsc.h"
/**************************************************************************/