Move config stuff into own include. Iggy said its better :-)
This commit is contained in:
parent
621bca40b3
commit
5d0887be71
|
@ -1,6 +1,7 @@
|
||||||
#include <sysinit.h>
|
#include <sysinit.h>
|
||||||
|
|
||||||
#include "basic/basic.h"
|
#include "basic/basic.h"
|
||||||
|
#include "basic/config.h"
|
||||||
|
|
||||||
#include "lcd/print.h"
|
#include "lcd/print.h"
|
||||||
#include "lcd/display.h"
|
#include "lcd/display.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <sysinit.h>
|
#include <sysinit.h>
|
||||||
|
|
||||||
#include "basic/basic.h"
|
#include "basic/basic.h"
|
||||||
|
#include "basic/config.h"
|
||||||
|
|
||||||
#include "lcd/lcd.h"
|
#include "lcd/lcd.h"
|
||||||
#include "lcd/print.h"
|
#include "lcd/print.h"
|
||||||
|
|
|
@ -186,37 +186,6 @@ void handleMenu(const struct MENU *the_menu);
|
||||||
|
|
||||||
#include "basic/idle.h"
|
#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
|
// itoa.c
|
||||||
#define F_ZEROS (1<<0)
|
#define F_ZEROS (1<<0)
|
||||||
#define F_LONG (1<<1)
|
#define F_LONG (1<<1)
|
||||||
|
@ -229,4 +198,8 @@ const char* IntToStr(int num, unsigned int mxlen, char flag);
|
||||||
|
|
||||||
#include "basic/simpletime.h"
|
#include "basic/simpletime.h"
|
||||||
|
|
||||||
|
// global
|
||||||
|
#define SYSTICKSPEED 10
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,8 +4,9 @@
|
||||||
#include "lcd/print.h"
|
#include "lcd/print.h"
|
||||||
#include "filesystem/ff.h"
|
#include "filesystem/ff.h"
|
||||||
#include "basic/random.h"
|
#include "basic/random.h"
|
||||||
|
#include "basic/config.h"
|
||||||
|
|
||||||
#define CFGVER 23
|
#define CFGVER 24
|
||||||
|
|
||||||
struct CDESC the_config[]= {
|
struct CDESC the_config[]= {
|
||||||
{"version", CFGVER, CFGVER, CFGVER},
|
{"version", CFGVER, CFGVER, CFGVER},
|
||||||
|
@ -20,6 +21,9 @@ struct CDESC the_config[]= {
|
||||||
{ NULL, 0, 0, 0 },
|
{ NULL, 0, 0, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
char nickname[MAXNICK]="anonymous";
|
||||||
|
char nickfont[FILENAMELEN];
|
||||||
|
|
||||||
#define CONFFILE "r0ket.cfg"
|
#define CONFFILE "r0ket.cfg"
|
||||||
#define CONF_ITER for(int i=0;the_config[i].name!=NULL;i++)
|
#define CONF_ITER for(int i=0;the_config[i].name!=NULL;i++)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <sysinit.h>
|
#include <sysinit.h>
|
||||||
|
|
||||||
#include "basic/basic.h"
|
#include "basic/basic.h"
|
||||||
|
#include "basic/config.h"
|
||||||
|
|
||||||
#define SAMPCT (4)
|
#define SAMPCT (4)
|
||||||
uint32_t light=300*SAMPCT;
|
uint32_t light=300*SAMPCT;
|
||||||
|
|
|
@ -329,6 +329,7 @@ int ff_del_syncobj (_SYNC_t); /* Delete a sync object */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Utility functions */
|
/* Utility functions */
|
||||||
|
#define FILENAMELEN 13 // 8+1+3+1
|
||||||
const char* f_get_rc_string (FRESULT rc);
|
const char* f_get_rc_string (FRESULT rc);
|
||||||
void fsInit();
|
void fsInit();
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "core/ssp/ssp.h"
|
#include "core/ssp/ssp.h"
|
||||||
#include "gpio/gpio.h"
|
#include "gpio/gpio.h"
|
||||||
#include "basic/basic.h"
|
#include "basic/basic.h"
|
||||||
|
#include "basic/config.h"
|
||||||
#include "usb/usbmsc.h"
|
#include "usb/usbmsc.h"
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue