//DEFINES------------------------------------------------------------- #ifndef GLOBAL #ifndef GLOBAL #message "link global inside" #define GLOBAL #else #message "link global not defined" #endif #define VERSION "2.0b" #define MAX_FIFO_SIZE 20 #define BRAKER_COUNT 3 //INCLUDES------------------------------------------------------------ #if PLATFORM_ID==TPP2WG2 #include "tpp2.th" #endif #if PLATFORM_ID==TPP3WG2 #include "tpp3.th" #endif #if PLATFORM_ID==SIMULATOR #include "simulator.th" #endif void d(string mess); enum STORELOCATION{ NONE, EEPROM, FLASH }; typedef struct BrakerConfig{ bool Enable; unsigned char SensPort; unsigned char DropPort; unsigned char Relay; unsigned long Timeout; }; typedef struct BounceConfig{ bool Enable; unsigned char Port; unsigned int Timeout; }; typedef struct BrakerProcess{ BrakerConfig *config; bool State; unsigned long OnTime; string Fifo; }; typedef struct EncoderConfig{ unsigned char encoderPort; unsigned char encoderMode; unsigned long encoderInterval; string workedPorts; }; typedef struct EncoderProcess{ bool Enabled; EncoderConfig *config; bool State; unsigned long Count; unsigned char WorkPort; }; typedef struct Configuration{ string IP; STORELOCATION STORE_LOCATON; unsigned int FLASH_SIZE; unsigned char FLASH_FILES; bool STORE_BRAKER; BrakerConfig BRAKERS[BRAKER_COUNT]; BounceConfig BOUNCE[SENSORS]; EncoderConfig EncoderCfg; }; //#include "config_work.th" #include "net.th" //#include "braker.th" #endif //DECLARATIONS-------------------------------------------------------- extern Configuration config; extern unsigned char state[SENSORS]; extern BrakerProcess brakers[BRAKER_COUNT];