coffee.h 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * coffee.h
  3. *
  4. * Created on: Sep 25, 2017
  5. * Author: sebastian
  6. */
  7. #ifndef COFFEE_H_
  8. #define COFFEE_H_
  9. #include <csignal>
  10. //define status
  11. #define STATE_OFF 0
  12. #define STATE_HEATING 1
  13. #define STATE_INITALHEATING 2
  14. #define STATE_IDLE 3
  15. #define STATE_BREW 4
  16. #define STATE_BREWMANUAL 5
  17. #define STATE_CLEANING 6
  18. #define STATE_ERROR 7
  19. #define AMOUNT_PREINFUSION 3 //Preinfusion amount in ml
  20. #define TIME_SOAK 3000//Time between preinfusion and infusion in ms
  21. #define TIME_INFUSION 25000 //Infusion time in ms
  22. #define AMOUNT_DBLESPRESSO 25.0 //Size of a double espresso in ml
  23. void *coffeeThread(void *threadid);
  24. void coffeeHandler (int signum, siginfo_t *siginfo, void *context);
  25. int getSigValue(void);
  26. bool SigValueEmpty(void);
  27. void changeState(int newState);
  28. int getState(void);
  29. void brewTimeHandler (void);
  30. void coffeeTerminate(void);
  31. void coffeeBrew(void);
  32. void coffeeIncreaseBrewCounter(void);
  33. void coffeeIncreaseHeatingTime(uint64_t heatingTime);
  34. #endif /* COFFEE_H_ */