Skip to content

Commit

Permalink
Perform LCD panel hardware reset in response to the GPIO reset line
Browse files Browse the repository at this point in the history
  • Loading branch information
calc84maniac committed Nov 22, 2023
1 parent 9cb4a1f commit d8fbb9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "mem.h"
#include "cpu.h"
#include "lcd.h"
#include "panel.h"
#include "spi.h"
#include "bus.h"
#include "debug/debug.h"
Expand Down Expand Up @@ -145,6 +146,9 @@ static void control_write(const uint16_t pio, const uint8_t byte, bool poke) {
control.readBatteryStatus = control.setBatteryStatus == BATTERY_DISCHARGED ? 0 : byte & 0x80 ? 0 : 3;
break;
}
if ((control.ports[index] & ~byte) >> 2 & 1) {
panel_hw_reset();
}
if (asic.python && (control.ports[index] ^ byte) >> 4 & 1) {
spi_device_select(byte >> 4 & 1);
}
Expand Down
3 changes: 2 additions & 1 deletion core/panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ static void panel_sw_reset(void) {
panel.tear = false;
}

static void panel_hw_reset(void) {
void panel_hw_reset(void) {
panel.mac = 0;
panel.ifBpp = 0x66;
panel_sw_reset();
}

Expand Down
1 change: 1 addition & 0 deletions core/panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void panel_reset(void);
bool panel_restore(FILE *image);
bool panel_save(FILE *image);

void panel_hw_reset(void);
bool panel_hsync(void);
bool panel_vsync(void);
bool panel_refresh_pixel(void);
Expand Down

0 comments on commit d8fbb9e

Please sign in to comment.