Skip to content

Commit 1be301f

Browse files
authored
Spike fix (#9)
* Fixed pixel count * fix comments
1 parent 3b78d91 commit 1be301f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/dmd_interface_spike.pio

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515

1616
.program dmd_reader_spike
17-
; initialize y with 4095, number of pixels (128x32) - 1 because counting starts at 0.
18-
set x, 31 ; load 31, 5 bits is max allowed (0b11111)
19-
in x, 5 ; shift in 5 bits, isr is 31 now
20-
set x, 31 ; load 31, 5 bits is max allowed (0b11111)
21-
in x, 5 ; shift in 5 bits, isr is 1023 now
22-
set x, 3 ; load 3
23-
in x, 2 ; shift in 2 bits, isr is 4095 now (128x32 - 1)
24-
mov y, isr ; copy 4095 to y
17+
; initialize y with 16383, number of pixels (128x32x4) - 1 because counting starts at 0.
18+
set x, 31 ; x = 31 (max 5-bit value)
19+
in x, 5 ; shift in 5 bits, isr = 31
20+
set x, 31 ; x = 31
21+
in x, 5 ; shift in 5 bits, isr = 1023
22+
set x, 31 ; x = 31
23+
in x, 4 ; shift in 4 bits, isr = 16383
24+
mov y, isr ; y = 16383
2525

2626
.wrap_target
2727
mov x, y ; load number of pixels

0 commit comments

Comments
 (0)