|
@@ -1,8 +1,9 @@
|
|
|
/*
|
|
|
- * display.cpp
|
|
|
+ * display2.cpp
|
|
|
*
|
|
|
* Created on: Sep 26, 2017
|
|
|
- * Author: Philipp Hinz
|
|
|
+ * Updated:
|
|
|
+ * Author: Philipp Hinz/Sebastian Vendt
|
|
|
*/
|
|
|
#include <stdlib.h>
|
|
|
#include <pthread.h>
|
|
@@ -307,6 +308,7 @@ void displayTerminate(event_t *e) {
|
|
|
void* displayThread(void* threadid) {
|
|
|
//sleep(1); // Wait for other components to initialize
|
|
|
displayTimer.start();
|
|
|
+ logger(V_BASIC, "Initialized display Thread. Timer state: %d \n", displayTimer.isActive());
|
|
|
while (1) {
|
|
|
pause();
|
|
|
if (1) {
|
|
@@ -367,10 +369,10 @@ void displayInit(void) {
|
|
|
//lcdPrintf(lcd, " CoffeePi booting...");
|
|
|
|
|
|
|
|
|
- setRefreshRate(refresh_std);
|
|
|
+ //setRefreshRate(refresh_std);
|
|
|
+ currentRefreshRate = refresh_std;
|
|
|
+ displayTimer.setDivider(20 / refresh_std);
|
|
|
|
|
|
- logger(V_BASIC, "display2.cpp Initialized display with a refresh rate of %d Hz\n",
|
|
|
- refresh_std);
|
|
|
/**The following block comes from void* displayThread(void* threadid)
|
|
|
* The idea is that the initialization functions get the component ready to react on external events
|
|
|
* once the threads start, events might be triggered and every component can process them
|
|
@@ -386,6 +388,9 @@ void displayInit(void) {
|
|
|
event_subscribe("pagechange", &displayPageUpdated);
|
|
|
event_subscribe("terminate", &displayTerminate);
|
|
|
event_subscribe("descaling", &displayDescaling);
|
|
|
+
|
|
|
+ logger(V_BASIC, "display2.cpp Initialized display with a refresh rate of %d Hz\n",
|
|
|
+ refresh_std);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -464,7 +469,6 @@ void setSwitchToNextTimeout(idx_t idx, uint16_t millis) {
|
|
|
void displayRefresh(void) {
|
|
|
//handle mode trainsitions
|
|
|
switchToNextMode(coffeeMode);
|
|
|
-
|
|
|
//FSM of the display
|
|
|
if (coffeeMode[CURRENT] == MODE_STATE) {
|
|
|
//handle state transitions
|