Skip to content

Commit

Permalink
Ensure that all 3 pins controlling the backlight are set to specific …
Browse files Browse the repository at this point in the history
…values : LOW is set to 0 (enable) and MEDIUM/HIGH are set to 1 (disable).
  • Loading branch information
JF002 committed Sep 4, 2024
1 parent ae02f94 commit ce0b45c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libs/pinetime_boot/src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
#define DISPLAY_CS 25 // LCD_CS (P0.25): Chip select
#define DISPLAY_DC 18 // LCD_RS (P0.18): Clock/data pin (CD)
#define DISPLAY_RST 26 // LCD_RESET (P0.26): Display reset
#define DISPLAY_LOW 14 // LCD_BACKLIGHT_{LOW,MID,HIGH} (P0.14, 22, 23): Backlight (active low)
#define DISPLAY_HIGH 23 // LCD_BACKLIGHT_{LOW,MID,HIGH} (P0.14, 22, 23): Backlight (active low)
#define DISPLAY_LOW 14 // LCD_BACKLIGHT_LOW (P0.14): Backlight (active low)
#define DISPLAY_MEDIUM 22 // LCD_BACKLIGHT_MEDIUM (P0.22): Backlight (active low)
#define DISPLAY_HIGH 23 // LCD_BACKLIGHT_HIGH (P0.23): Backlight (active low)
#define BATCH_SIZE 256 // Max number of SPI data bytes to be transmitted
#define PUSH_BUTTON_IN 13 // GPIO Pin P0.13: PUSH BUTTON_IN

Expand Down Expand Up @@ -217,6 +218,8 @@ static int init_display(void) {
rc = hal_gpio_init_out(DISPLAY_DC, 0); assert(rc == 0);
// Switch on backlight
rc = hal_gpio_init_out(DISPLAY_LOW, 0); assert(rc == 0);
rc = hal_gpio_init_out(DISPLAY_MEDIUM, 1); assert(rc == 0);
rc = hal_gpio_init_out(DISPLAY_HIGH, 1); assert(rc == 0);

hard_reset();
write_command(SWRESET, NULL, 0);
Expand Down

0 comments on commit ce0b45c

Please sign in to comment.