#ifndef ___cfg_h #define ___cfg_h #include "../../global.h" typedef struct CONFIG { volatile unsigned char init; volatile unsigned char FLAGS; volatile double LATITUDE; volatile double LONGITUDE; volatile double FACTOR_HOR; volatile double FACTOR_VER; volatile double FACTOR_FR; volatile unsigned char FRQSTEP_HOR; volatile unsigned char FRQSTEP_VER; volatile unsigned char FRQSTEP_FR; volatile long UTCADJUST; volatile int ENCODERVAL_HOR; volatile int ENCODERVAL_VER; volatile unsigned char MOTORMS_HOR; volatile unsigned char MOTORMS_VER; volatile unsigned char MOTORMS_FR; volatile int CORRECT_C; volatile int CORRECT_R; volatile unsigned char RESERVED[8]; } CONFIG; extern CONFIG cfg; extern prog_char row_update_ok[17]; extern prog_char row_noinit[17]; extern prog_char row_error[17]; extern unsigned char loadCfg(unsigned char nr ); extern void storeCfg(unsigned char nr ); #define CLEARALLCFGFLAGS cfg.FLAGS=0 #define CLRFLAGAZALT cfg.FLAGS=cfg.FLAGS&254 #define CLRFLAGCFG1 cfg.FLAGS=cfg.FLAGS&253 #define CLRFLAGCFG2 cfg.FLAGS=cfg.FLAGS&251 #define CLRFLAGCFG3 cfg.FLAGS=cfg.FLAGS&247 #define CLRFLAGCFG4 cfg.FLAGS=cfg.FLAGS&239 #define CLRFLAGCFG5 cfg.FLAGS=cfg.FLAGS&223 #define CLRFLAGCFG6 cfg.FLAGS=cfg.FLAGS&191 #define CLRFLAGCFG7 cfg.FLAGS=cfg.FLAGS&127 #define SETFLAGAZALT cfg.FLAGS=cfg.FLAGS|1 #define SETFLAGCFG1 cfg.FLAGS=cfg.FLAGS|2 #define SETFLAGCFG2 cfg.FLAGS=cfg.FLAGS|4 #define SETFLAGCFG3 cfg.FLAGS=cfg.FLAGS|8 #define SETFLAGCFG4 cfg.FLAGS=cfg.FLAGS|16 #define SETFLAGCFG5 cfg.FLAGS=cfg.FLAGS|32 #define SETFLAGCFG6 cfg.FLAGS=cfg.FLAGS|64 #define SETFLAGCFG7 cfg.FLAGS=cfg.FLAGS|128 #define ISFLAGAZALT (cfg.FLAGS&1) #define ISFLAGCFG1 (cfg.FLAGS&2) #define ISFLAGCFG2 (cfg.FLAGS&4) #define ISFLAGCFG3 (cfg.FLAGS&8) #define ISFLAGCFG4 (cfg.FLAGS&16) #define ISFLAGCFG5 (cfg.FLAGS&32) #define ISFLAGCFG6 (cfg.FLAGS&64) #define ISFLAGCFG7 (cfg.FLAGS&128) //FLAG0 is used to indicate an az/alt scope, if this flag is set all //calculation from program will be done in a RA/DEC to AZ/ALT way //If not set, scope uses a parallactic mount //FLAG1 is used to indicate encoder horizontal on, off //FLAG2 is used to indicate encoder horizontal on, off #endif