global.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**********************************************************************
  2. Universitaet Ulm
  3. Abteilung Organisation und Management von Informationssystemen
  4. Author: Philipp Hinz
  5. **********************************************************************/
  6. #ifndef _GLOBAL_H_
  7. #define _GLOBAL_H_
  8. #include <pthread.h>
  9. #define SPI_CHANNEL 1 // 0 or 1 on Raspberry Pi
  10. #define SPI_SPEED 200000 // SPI clock speed in Hz
  11. #define LED_RED_PIN 7
  12. #define LED_YELLOW_PIN 3
  13. #define LED_GREEN_PIN 2
  14. #define TIMER_DELAY_US 50000 // Basic timer delay in us
  15. // SQL config
  16. #define SQL_DATABASE "nodes.sqlite"
  17. // Global variables
  18. extern int verbose, optPoll;
  19. extern bool optEcho, optInc, optLom, optTerm, optAdd, optDate, optSuppress;
  20. extern pthread_mutex_t mutex;
  21. extern int lcd;
  22. // CAN Filter - Should Incoming messages be filtered in Hardware?
  23. // #defining FILTER_USAGE means yes, otherwise no filtering applies
  24. //#define FILTER_USAGE
  25. // If incoming messages are filtered, you have to define the filter properties.
  26. // If a bit n of MASK is set, the respective Message-Identifier-Bit must
  27. // be (equal to Bit n of MATCH0) OR (equal to Bit n of MATCH1).
  28. // Otherwise the message will be discarded.
  29. // Mask & Matches are in the range from 0x000 to 0x7FF.
  30. #define FILTER_MASK 0x0ff
  31. #define FILTER_MATCH0 0x084
  32. #define FILTER_MATCH1 0x094
  33. // Thread IDs
  34. #define THREAD_MAIN 0
  35. #define THREAD_TEST 1
  36. #define THREAD_CAN 2
  37. void killThread(int threadid, int sig);
  38. #endif