Skip to content

Commit 5023bfe

Browse files
committed
Fix eventual SPI transfer failures on Python models
1 parent 968fcba commit 5023bfe

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/lcddrvce/lcddrvce.asm

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,19 @@ lcd_Init:
7474
ld hl, .fullinit
7575
srl (hl)
7676
jr nc, .fastinit
77-
; Magic initialization sequence to work on Python models
77+
; Check certificate for Python model
78+
ld de, $0330
79+
call ti.FindFirstCertField
80+
jr nz, .magicinit
81+
call ti.GetFieldSizeFromType
82+
ld de, $0430
83+
call ti.FindField
84+
jr nz, .magicinit
85+
; Reinitializes Python hardware, probably (routine available on rev M+ boot code)
86+
; Without this, LCD SPI transfers start failing a short time after init
87+
call $000654
88+
.magicinit:
89+
; Magic SPI initialization sequence to work on Python models
7890
ld de, ti.spiSpiFrFmt or ti.bmSpiFlash or ti.bmSpiFsPolarity or ti.bmSpiMasterMono
7991
.loop:
8092
ld (ti.mpSpiCtrl0), de

0 commit comments

Comments
 (0)