CoffeePi
Coffee machine control for Raspberry Pi
global.h
Go to the documentation of this file.
1 /**********************************************************************
2  Universitaet Ulm
3  Abteilung Organisation und Management von Informationssystemen
4 
5  Author: Philipp Hinz
6 
7  **********************************************************************/
8 
9 #ifndef _GLOBAL_H_
10 #define _GLOBAL_H_
11 
12 #include <pthread.h>
13 
14 #define SPI_CHANNEL 1 // 0 or 1 on Raspberry Pi
15 #define SPI_SPEED 200000 // SPI clock speed in Hz
16 
17 #define TIMER_DELAY_US 50000 // Basic timer delay in us
18 // SQL config
19 
20 #define SQL_DATABASE "coffee.sqlite"
21 
22 // Global variables
23 
24 extern int verbose;
25 extern bool optDate, optPower, optCold;
26 extern pthread_mutex_t mutex;
27 extern pthread_t thread[];
28 
29 
30 // Thread IDs
31 #define THREAD_MAIN 0
32 #define THREAD_STRIPE 1
33 #define THREAD_DISPLAY 2
34 #define THREAD_COFFEE 3
35 
36 
37 void killThread(int threadid, int sig);
38 
39 #endif
void killThread(int threadid, int sig)
Sends a signal to a thread.
Definition: main.cpp:216
bool optDate
Definition: main.cpp:33
pthread_t thread[]
Definition: main.cpp:41
pthread_mutex_t mutex
Definition: main.cpp:42
int verbose
Definition: main.cpp:32
bool optCold
Definition: main.cpp:35
bool optPower
Definition: main.cpp:34