Skip to content

Commit

Permalink
ssd1681-lvgl fix color
Browse files Browse the repository at this point in the history
Signed-off-by: iotah <[email protected]>
  • Loading branch information
IotaHydrae committed Mar 12, 2024
1 parent 3fc0703 commit 67b99e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion ssd1681-lvgl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ int main(void)
{
hardware_init();

// for (;;);
lv_init();
lv_port_disp_init();

Expand Down
4 changes: 2 additions & 2 deletions ssd1681-lvgl/port/lv_port_disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void lv_port_disp_init( void )
/*Finally register the driver*/
lv_disp_t * disp = lv_disp_drv_register( &disp_drv );
/* set a mono theme */
lv_theme_t *th = lv_theme_mono_init(disp, 1, &lv_font_montserrat_12);
lv_theme_t *th = lv_theme_mono_init(disp, 0, &lv_font_montserrat_12);
lv_disp_set_theme(disp, th);
}

Expand All @@ -164,7 +164,7 @@ static void disp_exit( void )
static void disp_set_pix_cb(struct _lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
lv_color_t color, lv_opa_t opa)
{
if(lv_color_brightness(color) > 128)
if(lv_color_brightness(color) < 128)
buf[y * 25 + (x / 8)] &= ~( 1 << ( 7 - (x % 8) ) );
else
buf[y * 25 + (x / 8)] |= ( 1 << ( 7 - (x % 8) ) );
Expand Down

0 comments on commit 67b99e8

Please sign in to comment.