global.h 869 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 TIMER_DELAY_US 50000 // Basic timer delay in us
  12. // SQL config
  13. #define SQL_DATABASE "coffee.sqlite"
  14. // Global variables
  15. extern int verbose;
  16. extern bool optDate, optPower;
  17. extern pthread_mutex_t mutex_spi, mutex_i2c, mutex_logger;
  18. extern pthread_t thread[];
  19. // Thread IDs
  20. #define THREAD_MAIN 0
  21. #define THREAD_STRIPE 1
  22. #define THREAD_DISPLAY 2
  23. #define THREAD_COFFEE 3
  24. #define THREAD_SERVER 4
  25. void killThread(int threadid, int sig);
  26. #endif