From b88dc2cbf3a231e5b0c2aa231f9cfc35f75e28c8 Mon Sep 17 00:00:00 2001 From: claudiol Date: Fri, 8 Jan 2021 09:04:46 -0500 Subject: [PATCH] Update multiboot to use the new LCD poweron procedure. --- firmware/sys/target_prime1/boot_multiload.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/firmware/sys/target_prime1/boot_multiload.c b/firmware/sys/target_prime1/boot_multiload.c index 204f23b..3ad01e5 100644 --- a/firmware/sys/target_prime1/boot_multiload.c +++ b/firmware/sys/target_prime1/boot_multiload.c @@ -44,6 +44,7 @@ static void tobin(uint32_t value, char *buffer) { void printline(char *left_text, char *right_text) { if(line==-1) { + lcd_poweron(); lcd_setmode(BPPMODE_4BPP, (unsigned int *)MEM_PHYS_SCREEN); lcd_on(); @@ -69,9 +70,14 @@ int esc_pressed() { *GPDCON = (*GPDCON & 0xffff0000) | 0X5555; // ALL ROWS TO OUTPUT *GPDUDP = (*GPDUDP &0xffff0000) | 0x5555; // PULL DOWN ENABLE ON ALL OUTPUTS (TEMPORARILY SET TO INPUTS DURING SCAN) *GPDDAT &= 0xffff0000; // ALL ROWS LOW - *GPDDAT |= (1 << 6); + *GPDDAT |= (1 << 6); // JUST 1 ROW ENABLED - return *GPGDAT & (1 << 4); + // READ MANY TIMES TO ALLOW SIGNALS TO STABILIZE + int k; + for(k=0;k<500;++k) { + if(*GPGDAT & (1 << 4)) return 1; + } + return 0; } // Initialize global variables region to zero