12345678910111213141516171819202122232425262728293031323334353637383940 |
- /**********************************************************************
- Universitaet Ulm
- Abteilung Organisation und Management von Informationssystemen
- Author: Philipp Hinz
- **********************************************************************/
- #ifndef _GLOBAL_H_
- #define _GLOBAL_H_
- #include <pthread.h>
- #define SPI_CHANNEL 1 // 0 or 1 on Raspberry Pi
- #define SPI_SPEED 200000 // SPI clock speed in Hz
- #define TIMER_DELAY_US 50000 // Basic timer delay in us
- // SQL config
- #define SQL_DATABASE "coffee.sqlite"
- // Global variables
- extern int verbose;
- extern bool optDate, optPower;
- extern pthread_mutex_t mutex_spi, mutex_i2c, mutex_logger;
- extern pthread_t thread[];
- // Thread IDs
- #define THREAD_MAIN 0
- #define THREAD_STRIPE 1
- #define THREAD_DISPLAY 2
- #define THREAD_COFFEE 3
- #define THREAD_SERVER 4
- void killThread(int threadid, int sig);
- #endif
|