Skip to content

Commit

Permalink
Updated vendored display_drivers version
Browse files Browse the repository at this point in the history
Pull in the updated display_drivers code for proper declarations
of the MV,MX and MY bits which are used directly by some of the
code in the checks.
  • Loading branch information
alees24 committed Nov 7, 2024
1 parent 8a07bc1 commit 62df75d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion vendor/display_drivers.lock.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
upstream:
{
url: https://github.com/engdoreis/display_drivers.git
rev: d0ea11852c43bd7db2ba9316e4170b8297a1d6a0
rev: 66f87a03b1ef637c80cb507d2b6d556168418e6a
}
}
10 changes: 5 additions & 5 deletions vendor/display_drivers/st7735/lcd_st7735.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ Result lcd_st7735_init(St7735Context *ctx, LCD_Interface *interface) {

Result lcd_st7735_set_orientation(St7735Context *ctx, LCD_Orientation orientation) {
const static uint8_t st7735_orientation_map[] = {
ST77_MADCTL_MY | ST77_MADCTL_MV,
ST77_MADCTL_MX | ST77_MADCTL_MV,
ST77_MADCTL_MV | ST77_MADCTL_MX,
ST77_MADCTL_MX | ST77_MADCTL_MY,
ST77_MADCTL_MV | ST77_MADCTL_MY,
0,
};

Expand Down Expand Up @@ -201,13 +201,13 @@ Result lcd_st7735_putchar(St7735Context *ctx, LCD_Point origin, char character)

set_address(ctx, origin.x, origin.y, origin.x + char_descriptor->width - 1, origin.y + font->height - 1);
ctx->parent.interface->gpio_write(ctx->parent.interface->handle, false, true);
const uint8_t *char_bitmap = &font->bitmap_table[char_descriptor->position - 1];
const uint8_t *char_bitmap = &font->bitmap_table[char_descriptor->position];
for (int row = 0; row < font->height; row++) {
for (int column = 0; column < char_descriptor->width; column++) {
uint8_t bit = (uint8_t)(column % 8);
char_bitmap += (uint8_t)(bit == 0);
buffer[column] =
(uint16_t)((*char_bitmap & (0x01 << bit)) ? ctx->parent.foreground_color : ctx->parent.background_color);
(uint16_t)((char_bitmap[-1] & (0x01 << bit)) ? ctx->parent.foreground_color : ctx->parent.background_color);
}
write_buffer(ctx, (uint8_t *)buffer, sizeof(buffer));
}
Expand Down Expand Up @@ -286,4 +286,4 @@ extern Result lcd_st7735_set_font_colors(St7735Context *ctx, uint32_t background

extern Result lcd_st7735_get_resolution(St7735Context *ctx, size_t *height, size_t *width);

Result lcd_st7735_close(St7735Context *ctx) { return (Result){.code = 0}; }
Result lcd_st7735_close(St7735Context *ctx) { return (Result){.code = 0}; }
6 changes: 3 additions & 3 deletions vendor/display_drivers/st7735/lcd_st7735_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ typedef enum {
} ST7735_Cmd;

typedef enum {
ST77_MADCTL_MX = 0x01 << 7, // Column Address Order
ST77_MADCTL_MV = 0x01 << 6, // Row/Column Exchange
ST77_MADCTL_MY = 0x01 << 5, // Row Address Order
ST77_MADCTL_MY = 0x01 << 7, // Row Address Order
ST77_MADCTL_MX = 0x01 << 6, // Column Address Order
ST77_MADCTL_MV = 0x01 << 5, // Row/Column Exchange
ST77_MADCTL_ML = 0x01 << 4,
ST77_MADCTL_RGB = 0x01 << 3,
ST77_MADCTL_MH = 0x01 << 2
Expand Down

0 comments on commit 62df75d

Please sign in to comment.