/********************************************************************** Universitaet Ulm Abteilung Organisation und Management von Informationssystemen Author: Philipp Hinz **********************************************************************/ #ifndef _GLOBAL_H_ #define _GLOBAL_H_ #include #define SPI_CHANNEL 1 // 0 or 1 on Raspberry Pi #define SPI_SPEED 200000 // SPI clock speed in Hz #define LED_RED_PIN 7 #define LED_YELLOW_PIN 3 #define LED_GREEN_PIN 2 #define TIMER_DELAY_US 50000 // Basic timer delay in us // SQL config #define SQL_DATABASE "nodes.sqlite" // Global variables extern int verbose, optPoll; extern bool optEcho, optInc, optLom, optTerm, optAdd, optDate, optSuppress; extern pthread_mutex_t mutex; extern int lcd; // CAN Filter - Should Incoming messages be filtered in Hardware? // #defining FILTER_USAGE means yes, otherwise no filtering applies //#define FILTER_USAGE // If incoming messages are filtered, you have to define the filter properties. // If a bit n of MASK is set, the respective Message-Identifier-Bit must // be (equal to Bit n of MATCH0) OR (equal to Bit n of MATCH1). // Otherwise the message will be discarded. // Mask & Matches are in the range from 0x000 to 0x7FF. #define FILTER_MASK 0x0ff #define FILTER_MATCH0 0x084 #define FILTER_MATCH1 0x094 // Thread IDs #define THREAD_MAIN 0 #define THREAD_TEST 1 #define THREAD_CAN 2 void killThread(int threadid, int sig); #endif