added setContrast, setBrightness and removed SetParam(bright, contrast)
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Wed, 9 Nov 2005 02:15:09 +0000 (02:15 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Wed, 9 Nov 2005 02:15:09 +0000 (02:15 +0000)
lib/gdi/lcd.cpp
lib/gdi/lcd.h

index 6b3532302dec6a7c6d211bf86b78856363b75a0e..776173dd66d6a0d4984f295e7228fda68829ecb6 100644 (file)
@@ -64,11 +64,6 @@ eDBoxLCD::eDBoxLCD(): eLCD(eSize(128, 64))
        {
                int i=LCD_MODE_BIN;
                ioctl(lcdfd, LCD_IOCTL_ASC_MODE, &i);
-               int lcdbrightness=0, lcdcontrast=0;
-
-               lcdbrightness=130;
-               lcdcontrast=32;
-               setLCDParameter(lcdbrightness, lcdcontrast);
                inverted=0;
        }
 }
@@ -79,7 +74,7 @@ void eDBoxLCD::setInverted(unsigned char inv)
        update();       
 }
 
-int eDBoxLCD::setLCDParameter(int brightness, int contrast)
+int eDBoxLCD::setLCDContrast(int contrast)
 {
        int fp;
        if((fp=open("/dev/dbox/fp0", O_RDWR))<=0)
@@ -92,12 +87,22 @@ int eDBoxLCD::setLCDParameter(int brightness, int contrast)
        {
                eDebug("[LCD] can't set lcd contrast");
        }
+       return(0);
+}
+
+int eDBoxLCD::setLCDBrightness(int brightness)
+{
+       int fp;
+       if((fp=open("/dev/dbox/fp0", O_RDWR))<=0)
+       {
+               eDebug("[LCD] can't open /dev/dbox/fp0");
+               return(-1);
+       }
 
        if(ioctl(fp, FP_IOCTL_LCD_DIMM, &brightness))
        {
                eDebug("[LCD] can't set lcd brightness");
        }
-       eDebug("[LCD] set brightness %d, contrast %d", brightness, contrast);
        return(0);
 }
 
index aee1417d1bd088f5a043ea27f9a010e34a54808d..f2e707f035b6801852f316a40da91b279f5e6e1f 100644 (file)
@@ -39,7 +39,8 @@ class eDBoxLCD: public eLCD
        unsigned char inverted;
 public:
        static eDBoxLCD *getInstance();
-       int setLCDParameter(int brightness, int contrast);
+       int eDBoxLCD::setLCDContrast(int contrast);
+       int eDBoxLCD::setLCDBrightness(int brightness);
        void setInverted( unsigned char );
        eDBoxLCD();
        ~eDBoxLCD();