Compile error fix.
Nokia GE8 - scale contrast correctly.
This commit is contained in:
parent
77872d8560
commit
8408e020b4
3 changed files with 5 additions and 6 deletions
|
@ -52,7 +52,6 @@
|
||||||
#ifndef GDISP_RAM_Y_OFFSET
|
#ifndef GDISP_RAM_Y_OFFSET
|
||||||
#define GDISP_RAM_Y_OFFSET 2 /* Offset in RAM of visible area */
|
#define GDISP_RAM_Y_OFFSET 2 /* Offset in RAM of visible area */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#ifndef GDISP_SLEEP_POS
|
#ifndef GDISP_SLEEP_POS
|
||||||
#define GDISP_SLEEP_POS ((GDISP_SCAN_LINES-GDISP_SLEEP_SIZE)/2 & ~3)
|
#define GDISP_SLEEP_POS ((GDISP_SCAN_LINES-GDISP_SLEEP_SIZE)/2 & ~3)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
#define GDISP_SLEEP_POS ((GDISP_SCAN_LINES-GDISP_SLEEP_SIZE)/2)
|
#define GDISP_SLEEP_POS ((GDISP_SCAN_LINES-GDISP_SLEEP_SIZE)/2)
|
||||||
#endif
|
#endif
|
||||||
#ifndef GDISP_INITIAL_CONTRAST
|
#ifndef GDISP_INITIAL_CONTRAST
|
||||||
#define GDISP_INITIAL_CONTRAST 38
|
#define GDISP_INITIAL_CONTRAST 60
|
||||||
#endif
|
#endif
|
||||||
#ifndef GDISP_INITIAL_BACKLIGHT
|
#ifndef GDISP_INITIAL_BACKLIGHT
|
||||||
#define GDISP_INITIAL_BACKLIGHT 100
|
#define GDISP_INITIAL_BACKLIGHT 100
|
||||||
|
@ -162,8 +162,8 @@ LLDSPEC bool_t gdisp_lld_init(GDISPDriver *g) {
|
||||||
// P1: 0x00 = page address normal, column address normal, address scan in column direction
|
// P1: 0x00 = page address normal, column address normal, address scan in column direction
|
||||||
// P2: 0x00 = RGB sequence (default value)
|
// P2: 0x00 = RGB sequence (default value)
|
||||||
// P3: 0x02 = 4 bits per colour (Type A)
|
// P3: 0x02 = 4 bits per colour (Type A)
|
||||||
write_cmd2(VOLCTR, GDISP_INITIAL_CONTRAST, 0x03); // Voltage control (contrast setting)
|
write_cmd2(VOLCTR, 63*GDISP_INITIAL_CONTRAST/100, 0x03); // Voltage control (contrast setting)
|
||||||
// P1 = Contrast
|
// P1 = Contrast (0..63)
|
||||||
// P2 = 3 resistance ratio (only value that works)
|
// P2 = 3 resistance ratio (only value that works)
|
||||||
delayms(100); // Allow power supply to stabilise
|
delayms(100); // Allow power supply to stabilise
|
||||||
write_cmd(DISON); // Turn on the display
|
write_cmd(DISON); // Turn on the display
|
||||||
|
@ -554,7 +554,7 @@ LLDSPEC bool_t gdisp_lld_init(GDISPDriver *g) {
|
||||||
case GDISP_CONTROL_CONTRAST:
|
case GDISP_CONTROL_CONTRAST:
|
||||||
if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100;
|
if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100;
|
||||||
acquire_bus();
|
acquire_bus();
|
||||||
write_cmd2(VOLCTR, (unsigned)g->p.ptr, 0x03);
|
write_cmd2(VOLCTR, 63*(unsigned)g->p.ptr/100, 0x03);
|
||||||
release_bus();
|
release_bus();
|
||||||
g->g.Contrast = (unsigned)g->p.ptr;
|
g->g.Contrast = (unsigned)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -227,7 +227,7 @@ static inline void write_data(uint16_t data) {
|
||||||
*/
|
*/
|
||||||
static inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
#error "gdispNokia6610GE8: GDISP_HARDWARE_READPIXEL and GDISP_HARDWARE_SCROLL are not supported on this board"
|
#error "gdispNokia6610GE8: GDISP_HARDWARE_READPIXEL and GDISP_HARDWARE_SCROLL are not supported on this board"
|
||||||
return 0;
|
return pSPI->SPI_RDR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue