Changeset 36636


Ignore:
Timestamp:
12/18/15 20:05:25 (8 years ago)
Author:
gost
Message:

[titan] add oled 7020hd

Location:
titan/titan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/header.h

    r36585 r36636  
    10111011struct fb* oledaddfb(int width, int height);
    10121012int oledtext(char *value);
     1013void initOLEDdream1();
    10131014
    10141015#ifdef MIPSEL
  • titan/titan/oled.h

    r34127 r36636  
    55{
    66        unsigned char* lfb1 = NULL;
     7        unsigned char* lfb2 = NULL;
    78        int i = 0;
    89        int bi = 0;
     10        int ret = 0;
    911       
    1012        lfb1 = malloc(xres * yres);
     
    1921        }
    2022       
    21         int lcdfd1 = open("/dev/dbox/oled0", O_RDWR);
    22         write(lcdfd1, lfb1, xres * yres);
     23        int lcdfd1 = open(getconfig("vfddev", NULL), O_RDWR);
     24       
     25        if(checkchipset("BCM7424") == 1)
     26        {
     27                ret = write(lcdfd1, lfb1, xres * yres);
     28                if(ret != xres * yres)
     29                        err("write to oled - %s - was not ok", getconfig("vfddev", NULL));
     30        }
     31        //Die Displays der dm7020hd, dm7025+(?), dm7080 und dm8000 haben 128*64*4bpp, DM800se hat 96*64*16bpp (RGB565), dm800 und dm7025(?) haben 132*64*1bpp (ältere ggf. 120*64 oder 128*64)
     32        else if(checkbox("DM7020HD") == 1)
     33        {
     34                unsigned char byte;
     35                bi = 0;
     36                lfb2 = malloc(xres * yres / 2);
     37                if(lfb2 == NULL)
     38                        return;
     39                for(i = 0; i <= xres*yres; i = i + 2)
     40                {
     41                        byte = lfb1[i] * 15 / 255;
     42                        lfb2[bi] = (byte << 4) & 0xf0;
     43                        byte = lfb1[i+1] * 15 / 255;
     44                        lfb2[bi] |= byte & 0x0f;
     45                        bi = bi + 1;
     46                }
     47                ret = write(lcdfd1, lfb2, xres * yres / 2);
     48                if(ret != xres * yres / 2)
     49                        err("write to oled - %s - was not ok", getconfig("vfddev", NULL));
     50                free(lfb2);
     51        }
     52               
    2353        close(lcdfd1);
    2454       
     
    2959int oledtext(char *value)
    3060{
    31         struct skin* OLED_nemesis = NULL;
     61        struct skin* OLED_all = NULL;
    3262       
    3363        if(getconfigint("oled_off", NULL) == 1)
    3464                return 0;
     65
     66        m_lock(&status.drawingmutex, 0);
    3567       
    36         //if(getconfigint("oled_mutex", NULL) == 1)
    37         //{
    38         m_lock(&status.drawingmutex, 0);
    39         //}
     68        if(checkchipset("BCM7424") == 1)
     69        {
     70                if(status.updatevfd == PAUSE)
     71                        OLED_all = getscreen("OLED_nemesis_menu");
     72                else if(status.standby > 0)
     73                        OLED_all = getscreen("OLED_nemesis_standby");
     74                else
     75                {
     76                        if(getskinconfig("OLED_nemesis", NULL) == NULL)
     77                                OLED_all = getscreen("OLED_nemesis");
     78                        else
     79                                OLED_all = getscreen(getskinconfig("OLED_nemesis", NULL));
     80                }
     81        }
     82        else if(checkbox("DM7020HD") == 1)
     83        {
     84                if(status.updatevfd == PAUSE)
     85                        OLED_all = getscreen("OLED_dream1_menu");
     86                else if(status.standby > 0)
     87                        OLED_all = getscreen("OLED_dream1_standby");
     88                else
     89                {
     90                        if(getskinconfig("OLED_dream1", NULL) == NULL)
     91                                OLED_all = getscreen("OLED_dream1");
     92                        else
     93                                OLED_all = getscreen(getskinconfig("OLED_dream1", NULL));
     94                }
     95        }       
     96               
    4097       
    41         if(status.updatevfd == PAUSE)
    42                 OLED_nemesis = getscreen("OLED_nemesis_menu");
    43         else if(status.standby > 0)
    44                 OLED_nemesis = getscreen("OLED_nemesis_standby");
    45         else
    46         {
    47                 if(getskinconfig("OLED_nemesis", NULL) == NULL)
    48                         OLED_nemesis = getscreen("OLED_nemesis");
    49                 else
    50                         OLED_nemesis = getscreen(getskinconfig("OLED_nemesis", NULL));
    51         }
    52        
    53         struct skin* textbox = getscreennode(OLED_nemesis, "textbox");
     98        struct skin* textbox = getscreennode(OLED_all, "textbox");
    5499       
    55100        if(status.standby == 2 && status.epgscanlistthread != NULL)
     
    57102        else
    58103                changetext(textbox, value);
    59         //if(getconfigint("oled_mutex", NULL) == 1)
    60         //{
    61         drawscreen(OLED_nemesis, 0, 2);
     104
     105        drawscreen(OLED_all, 0, 2);
    62106        m_unlock(&status.drawingmutex, 0);
    63         //}
    64         //else
    65         //      drawscreen(OLED_nemesis, 0, 0);
    66        
    67        
    68107       
    69108        return 0;
     
    90129        newnode->fd = -1;
    91130        newnode->fixfbsize = 4 * width * height;
     131        newnode->data_phys = 0;
    92132       
    93133        return newnode;
     134}
     135
     136void initOLEDdream1()
     137{
     138#ifndef LCD_IOCTL_ASC_MODE
     139#define LCDSET                  0x1000
     140#define LCD_IOCTL_ASC_MODE              (21|LCDSET)
     141#define LCD_MODE_ASC                    0
     142#define LCD_MODE_BIN                    1
     143#endif
     144
     145        int i=LCD_MODE_BIN;
     146        //int lcdfd = open("/dev/dbox/oled0", O_RDWR);
     147        int lcdfd1 = open(getconfig("vfddev", NULL), O_RDWR);
     148        if(lcdfd1 > -1)
     149        {
     150                ioctl(lcdfd1, LCD_IOCTL_ASC_MODE, &i);
     151                close(lcdfd1);
     152        }
    94153}       
    95154
  • titan/titan/skin.h

    r36560 r36636  
    42074207                if(oledskinfb == NULL) {
    42084208                        if(node->name != NULL && ostrstr(node->name, "OLED_nemesis") != NULL) {
    4209                                 debug(100, "alloc OLED framebuffer");
     4209                                debug(100, "alloc OLED_nemesis framebuffer");
    42104210                                oledskinfb = oledaddfb(256, 64);
     4211                                if(oledskinfb == NULL)
     4212                                {
     4213                                        if(flag == 0 || flag == 4)
     4214                                                m_unlock(&status.drawingmutex, 0);
     4215                                        return -2;
     4216                                }
     4217                        }
     4218                        else if(node->name != NULL && ostrstr(node->name, "OLED_dream1") != NULL) {
     4219                                debug(100, "alloc OLED_dream1 framebuffer");
     4220                                oledskinfb = oledaddfb(128, 64);
    42114221                                if(oledskinfb == NULL)
    42124222                                {
Note: See TracChangeset for help on using the changeset viewer.