|
@@ -53,7 +53,10 @@ void displayPrintTime(int line) {
|
|
|
* Prints out the current temperature in a centered position
|
|
|
* @param line Target line in display
|
|
|
*/
|
|
|
-
|
|
|
+//TODO: the temperature is wrong(old value) the first time the page is opened
|
|
|
+//after the first refresh the right temperature is displayed
|
|
|
+//no idea where this comes from, datasheet says nothing about dummy readouts.
|
|
|
+//no old values are used, conversion is started before every readout...
|
|
|
void displayPrintTemp(int line) {
|
|
|
if (line > DISPLAY_ROWS)
|
|
|
line = 0;
|
|
@@ -206,19 +209,8 @@ void displayTerminate(event_t *e) {
|
|
|
*/
|
|
|
|
|
|
void* displayThread(void* threadid) {
|
|
|
- //TODO: the display is loosing the first events here since it is waiting before it is subscribing
|
|
|
- //its loosing the descaling event triggered at the beginning of coffee initialization
|
|
|
- sleep(1); // Wait for other components to initialize
|
|
|
- int tmp = sqlGetConf(CFGdisplaylang);
|
|
|
- if (!tmp || tmp >= lang_last)
|
|
|
- tmp = DEFAULT_LANG;
|
|
|
- displaySetLang((display_lang_t) tmp);
|
|
|
+ //sleep(1); // Wait for other components to initialize
|
|
|
displayTimer.start();
|
|
|
- event_subscribe("statechange", &displayStateUpdated);
|
|
|
- event_subscribe("modechange", &displayModeUpdated);
|
|
|
- event_subscribe("pagechange", &displayPageUpdated);
|
|
|
- event_subscribe("terminate", &displayTerminate);
|
|
|
- event_subscribe("descaling", &displayDescaling);
|
|
|
while (1) {
|
|
|
pause();
|
|
|
if (1) {
|
|
@@ -294,6 +286,21 @@ void displayInit(void) {
|
|
|
|
|
|
logger(V_BASIC, "Initialized display with a refresh rate of %d Hz\n",
|
|
|
REFRESH_RATE);
|
|
|
+ /**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
|
|
|
+ * This should fix the TO_DO where a descaling event was triggered during startup of the coffeethread and
|
|
|
+ * the displaythread did not react to it since it hadn't subscribed to the event yet
|
|
|
+ */
|
|
|
+ int tmp = sqlGetConf(CFGdisplaylang);
|
|
|
+ if (!tmp || tmp >= lang_last)
|
|
|
+ tmp = DEFAULT_LANG;
|
|
|
+ displaySetLang((display_lang_t) tmp);
|
|
|
+ event_subscribe("statechange", &displayStateUpdated);
|
|
|
+ event_subscribe("modechange", &displayModeUpdated);
|
|
|
+ event_subscribe("pagechange", &displayPageUpdated);
|
|
|
+ event_subscribe("terminate", &displayTerminate);
|
|
|
+ event_subscribe("descaling", &displayDescaling);
|
|
|
}
|
|
|
|
|
|
/**
|