Skip to content

Commit 029b697

Browse files
authored
Merge pull request #666 from MichaelBell/galactic-ghost-buster
Fix ghosting on the Galactic Unicorn
2 parents c4decc5 + 3371b6c commit 029b697

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

libraries/galactic_unicorn/galactic_unicorn.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,14 @@ namespace pimoroni {
154154
uint8_t *p = &bitstream[row * ROW_BYTES + (BCD_FRAME_BYTES * frame)];
155155

156156
p[ 0] = WIDTH - 1; // row pixel count
157-
p[56] = row; // row select
157+
p[ 1] = row; // row select
158158

159159
// set the number of bcd ticks for this frame
160160
uint32_t bcd_ticks = (1 << frame);
161-
p[57] = (bcd_ticks & 0xff) >> 0;
162-
p[58] = (bcd_ticks & 0xff00) >> 8;
163-
p[59] = (bcd_ticks & 0xff0000) >> 16;
161+
p[56] = (bcd_ticks & 0xff) >> 0;
162+
p[57] = (bcd_ticks & 0xff00) >> 8;
163+
p[58] = (bcd_ticks & 0xff0000) >> 16;
164+
p[59] = (bcd_ticks & 0xff000000) >> 24;
164165
}
165166
}
166167

@@ -485,7 +486,7 @@ namespace pimoroni {
485486

486487
// set the appropriate bits in the separate bcd frames
487488
for(uint8_t frame = 0; frame < BCD_FRAME_COUNT; frame++) {
488-
uint8_t *p = &bitstream[y * ROW_BYTES + (BCD_FRAME_BYTES * frame) + 1 + x];
489+
uint8_t *p = &bitstream[y * ROW_BYTES + (BCD_FRAME_BYTES * frame) + 2 + x];
489490

490491
uint8_t red_bit = gamma_r & 0b1;
491492
uint8_t green_bit = gamma_g & 0b1;

libraries/galactic_unicorn/galactic_unicorn.pio

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
; loop over row pixels
3535
out y, 8 ; get row pixel count (minus 1 because test is pre decrement)
36+
out pins, 8 ; output row select
3637
pixels:
3738

3839
; red bit
@@ -63,15 +64,14 @@ pixels:
6364

6465
jmp y-- pixels
6566

66-
out null, 16 ; discard dummy bytes
67+
out null, 8 ; discard dummy bytes
6768

68-
out pins, 8 ; output row select
6969

7070
set pins, 0b110 [5] ; latch high, blank high
7171
set pins, 0b000 ; blank low (enable output)
7272

7373
; loop over bcd delay period
74-
out y, 24 ; get bcd delay counter value
74+
out y, 32 ; get bcd delay counter value
7575
bcd_delay:
7676
jmp y-- bcd_delay
7777

0 commit comments

Comments
 (0)