Changeset 36636
- Timestamp:
- 12/18/15 20:05:25 (8 years ago)
- Location:
- titan/titan
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/header.h
r36585 r36636 1011 1011 struct fb* oledaddfb(int width, int height); 1012 1012 int oledtext(char *value); 1013 void initOLEDdream1(); 1013 1014 1014 1015 #ifdef MIPSEL -
titan/titan/oled.h
r34127 r36636 5 5 { 6 6 unsigned char* lfb1 = NULL; 7 unsigned char* lfb2 = NULL; 7 8 int i = 0; 8 9 int bi = 0; 10 int ret = 0; 9 11 10 12 lfb1 = malloc(xres * yres); … … 19 21 } 20 22 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 23 53 close(lcdfd1); 24 54 … … 29 59 int oledtext(char *value) 30 60 { 31 struct skin* OLED_ nemesis= NULL;61 struct skin* OLED_all = NULL; 32 62 33 63 if(getconfigint("oled_off", NULL) == 1) 34 64 return 0; 65 66 m_lock(&status.drawingmutex, 0); 35 67 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 40 97 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"); 54 99 55 100 if(status.standby == 2 && status.epgscanlistthread != NULL) … … 57 102 else 58 103 changetext(textbox, value); 59 //if(getconfigint("oled_mutex", NULL) == 1) 60 //{ 61 drawscreen(OLED_nemesis, 0, 2); 104 105 drawscreen(OLED_all, 0, 2); 62 106 m_unlock(&status.drawingmutex, 0); 63 //}64 //else65 // drawscreen(OLED_nemesis, 0, 0);66 67 68 107 69 108 return 0; … … 90 129 newnode->fd = -1; 91 130 newnode->fixfbsize = 4 * width * height; 131 newnode->data_phys = 0; 92 132 93 133 return newnode; 134 } 135 136 void 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 } 94 153 } 95 154 -
titan/titan/skin.h
r36560 r36636 4207 4207 if(oledskinfb == NULL) { 4208 4208 if(node->name != NULL && ostrstr(node->name, "OLED_nemesis") != NULL) { 4209 debug(100, "alloc OLED framebuffer");4209 debug(100, "alloc OLED_nemesis framebuffer"); 4210 4210 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); 4211 4221 if(oledskinfb == NULL) 4212 4222 {
Note: See TracChangeset
for help on using the changeset viewer.