Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ? RGB-patch.diff
- Index: hd44780-piplate.c
- ===================================================================
- RCS file: /cvsroot/lcdproc/lcdproc/server/drivers/hd44780-piplate.c,v
- retrieving revision 1.1
- diff -u -5 -p -r1.1 hd44780-piplate.c
- --- hd44780-piplate.c 7 Apr 2013 11:50:29 -0000 1.1
- +++ hd44780-piplate.c 22 Feb 2014 08:04:37 -0000
- @@ -209,22 +209,22 @@ hd_init_i2c_piplate(Driver *drvthis)
- i2c_write_reg(p, MCP23017_IODIRA,
- (unsigned char) (L_KEY_BIT | U_KEY_BIT | D_KEY_BIT | R_KEY_BIT | S_KEY_BIT) & ~(G_BIT | R_BIT));
- /* IODIRB - LCD control/data bus signals as outputs */
- i2c_write_reg(p, MCP23017_IODIRB,
- - (unsigned char) ~(RS_BIT | RW_BIT | EN_BIT | D0_BIT | D1_BIT | D2_BIT | D3_BIT | B_BIT));
- + (unsigned char) ~(RS_BIT | RW_BIT | EN_BIT | D0_BIT | D1_BIT | D2_BIT | D3_BIT ));//B_BIT));
- /* GPPUA - Pullups for key switch inputs */
- i2c_write_reg(p, MCP23017_GPPUA,
- (unsigned char) (L_KEY_BIT | U_KEY_BIT | D_KEY_BIT | R_KEY_BIT | S_KEY_BIT) & ~(G_BIT | R_BIT));
- /* GPPUB - Pullups disabled */
- i2c_write_reg(p, MCP23017_GPPUB, (unsigned char) 0x00);
- /* Set driver functions */
- hd44780_functions->senddata = i2c_piplate_HD44780_senddata;
- - hd44780_functions->backlight = i2c_piplate_HD44780_backlight;
- + hd44780_functions->backlight = NULL; //i2c_piplate_HD44780_backlight;
- hd44780_functions->scankeypad = i2c_piplate_HD44780_scankeypad;
- hd44780_functions->close = i2c_piplate_HD44780_close;
- /* Initialize the LCD */
- hd44780_functions->senddata(p, 0, RS_INSTR, 0x33);
- @@ -278,12 +278,12 @@ i2c_piplate_HD44780_senddata(PrivateData
- write_val &= ~RS_BIT;
- else
- write_val |= RS_BIT;
- /* Set the blue backlight bit if backlight is on */
- - if (p->backlightstate == BACKLIGHT_OFF)
- - write_val |= B_BIT;
- + //if (p->backlightstate == BACKLIGHT_OFF)
- + // write_val |= R_BIT;
- /* Set enable bit */
- i2c_write_reg(p, MCP23017_GPIOB, write_val | EN_BIT);
- p->hd44780_functions->uPause(p, 1);
- @@ -319,22 +319,22 @@ i2c_piplate_HD44780_backlight(PrivateDat
- if (i2c_read_reg(p, MCP23017_GPIOB, &gpiob) != 0) {
- return;
- }
- /* Set or clear the RGB bits. Backlight is ON if the bits are CLEAR */
- - if (state == BACKLIGHT_ON) {
- - gpioa &= ~(R_BIT | G_BIT);
- - gpiob &= ~(B_BIT);
- - }
- - else {
- - gpioa |= (R_BIT | G_BIT);
- - gpiob |= (B_BIT);
- - }
- + //if (state == BACKLIGHT_ON) {
- + // gpioa &= ~(R_BIT | G_BIT);
- + // gpiob &= ~(B_BIT);
- + //}
- + //else {
- + // gpioa |= (R_BIT | G_BIT);
- + // gpiob |= (B_BIT);
- + //}
- /* Write the RGB bits */
- - i2c_write_reg(p, MCP23017_GPIOA, gpioa);
- - i2c_write_reg(p, MCP23017_GPIOB, gpiob);
- + //i2c_write_reg(p, MCP23017_GPIOA, gpioa);
- + //i2c_write_reg(p, MCP23017_GPIOB, gpiob);
- }
- /**
- * Scan the LCD keys
- * \param p Pointer to driver's private data structure.
- Index: hd44780.c
- ===================================================================
- RCS file: /cvsroot/lcdproc/lcdproc/server/drivers/hd44780.c,v
- retrieving revision 1.110
- diff -u -5 -p -r1.110 hd44780.c
- --- hd44780.c 29 Jan 2014 21:48:04 -0000 1.110
- +++ hd44780.c 22 Feb 2014 08:04:38 -0000
- @@ -156,11 +156,11 @@ HD44780_init(Driver *drvthis)
- p->cellheight = 8; /* Do not change this !!! This is a
- * controller property, not a display
- * property !!! */
- p->cellwidth = 5;
- p->ccmode = standard;
- - p->backlightstate = -1; /* Init to invalid value */
- + p->backlightstate = 1; /* Init to invalid value */
- p->fd = -1;
- /* READ THE CONFIG FILE */
- @@ -397,14 +397,14 @@ HD44780_init(Driver *drvthis)
- /* consistency check: no local output function => no output */
- if (p->hd44780_functions->output == NULL)
- p->have_output = 0;
- /* set contrast */
- - HD44780_set_contrast(drvthis, p->contrast);
- + //HD44780_set_contrast(drvthis, p->contrast);
- /* Display startup parameters on the LCD */
- - HD44780_clear(drvthis);
- + //HD44780_clear(drvthis);
- sprintf(buf, "HD44780 %dx%d", p->width, p->height);
- HD44780_string(drvthis, 1, 1, buf);
- switch(if_type) {
- case IF_TYPE_USB:
- sprintf(buf, "USB %s%s%s",
- @@ -876,11 +876,11 @@ HD44780_set_brightness(Driver *drvthis,
- /*
- * Make last backlight state invalid to force update on next
- * rendering
- */
- - p->backlightstate = -1;
- + //p->backlightstate = -1;
- }
- /**
- * Turn the LCD backlight on or off.
- @@ -895,11 +895,11 @@ HD44780_backlight(Driver *drvthis, int o
- /* Immediately return if no backlight is available or no change is necessary */
- if (!p->have_backlight || p->backlightstate == on)
- return;
- if (p->hd44780_functions->backlight != NULL)
- - p->hd44780_functions->backlight(p, on);
- + // p->hd44780_functions->backlight(p, on);
- p->backlightstate = on;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement