summaryrefslogtreecommitdiff
path: root/imon.c
diff options
context:
space:
mode:
Diffstat (limited to 'imon.c')
-rw-r--r--imon.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/imon.c b/imon.c
index d897d92..43d48a6 100644
--- a/imon.c
+++ b/imon.c
@@ -176,22 +176,32 @@ int ciMonLCD::open(const char* szDevice, eProtocol pro)
esyslog("iMonLCD: unable to create framebuffer backing store");
return -1;
}
- backingstore->SetPixel(0,0);//make dirty
- SendCmd(this->cmd_clear_alarm);
- SendCmd(this->cmd_display_on);
- SendCmd(CMD_INIT); /* unknown, required init command */
- SendCmd(CMD_SET_ICONS);
- /* clear the progress-bars on top and bottom of the display */
- SendCmd(CMD_SET_LINES0);
- SendCmd(CMD_SET_LINES1);
- SendCmd(CMD_SET_LINES2);
+ if(SendCmdInit()) {
+ Contrast(theSetup.m_nContrast);
+ dsyslog("iMonLCD: init() done");
+ return 0;
+ }
+ return -1;
+}
- Contrast(theSetup.m_nContrast);
+/*
+ * turning backlight off (confirmed for a Silverstone LCD) (as "cybrmage" at
+ * mediaportal pointed out, his LCD is an Antec built-in one and turns completely
+ * off with this command)
+ */
+bool ciMonLCD::SendCmdInit() {
- dsyslog("iMonLCD: init() done");
+ backingstore->SetPixel(0,0);//make dirty
- return 0;
+ return SendCmd(this->cmd_clear_alarm)
+ && SendCmd(this->cmd_display_on)
+ && SendCmd(CMD_INIT) /* unknown, required init command */
+ && SendCmd(CMD_SET_ICONS)
+ /* clear the progress-bars on top and bottom of the display */
+ && SendCmd(CMD_SET_LINES0)
+ && SendCmd(CMD_SET_LINES1)
+ && SendCmd(CMD_SET_LINES2);
}
/*