Skip to content

Commit 68f6101

Browse files
committed
Possible fix for stellar pio?
1 parent aabe789 commit 68f6101

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

libraries/stellar_unicorn/stellar_unicorn.cpp

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ namespace pimoroni {
153153
// find the offset of this row and frame in the bitstream
154154
uint8_t *p = &bitstream[row * ROW_BYTES + (BCD_FRAME_BYTES * frame)];
155155

156-
p[ 0] = 64 - 1; // row pixel count
156+
p[ 0] = 32 - 1; // row pixel count
157157
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[68] = (bcd_ticks & 0xff) >> 0;
162-
p[69] = (bcd_ticks & 0xff00) >> 8;
163-
p[70] = (bcd_ticks & 0xff0000) >> 16;
164-
p[71] = (bcd_ticks & 0xff000000) >> 24;
161+
p[36] = (bcd_ticks & 0xff) >> 0;
162+
p[37] = (bcd_ticks & 0xff00) >> 8;
163+
p[38] = (bcd_ticks & 0xff0000) >> 16;
164+
p[39] = (bcd_ticks & 0xff000000) >> 24;
165165
}
166166
}
167167

@@ -463,15 +463,6 @@ namespace pimoroni {
463463
x = (WIDTH - 1) - x;
464464
y = (HEIGHT - 1) - y;
465465

466-
// map coordinates into display space
467-
if(y < 16) {
468-
// move to top half of display (which is actually the right half of the framebuffer)
469-
x += 32;
470-
}else{
471-
// remap y coordinate
472-
y -= 16;
473-
}
474-
475466
r = (r * this->brightness) >> 8;
476467
g = (g * this->brightness) >> 8;
477468
b = (b * this->brightness) >> 8;
@@ -482,11 +473,11 @@ namespace pimoroni {
482473

483474
// for each row:
484475
// for each bcd frame:
485-
// 0: 00111111 // row pixel count (minus one)
486-
// 1 - 64: xxxxxbgr, xxxxxbgr, xxxxxbgr, ... // pixel data
487-
// 65 - 67: xxxxxxxx, xxxxxxxx, xxxxxxxx // dummy bytes to dword align
488-
// 68: xxxxrrrr // row select bits
489-
// 69 - 71: tttttttt, tttttttt, tttttttt // bcd tick count (0-65536)
476+
// 0: 00011111 // row pixel count (minus one)
477+
// 1 - 32: xxxxxbgr, xxxxxbgr, xxxxxbgr, ... // pixel data
478+
// 33 - 35: xxxxxxxx, xxxxxxxx, xxxxxxxx // dummy bytes to dword align
479+
// 36: xxxxrrrr // row select bits
480+
// 37 - 39: tttttttt, tttttttt, tttttttt // bcd tick count (0-65536)
490481
//
491482
// .. and back to the start
492483

libraries/stellar_unicorn/stellar_unicorn.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace pimoroni {
4848
private:
4949
static const uint32_t ROW_COUNT = 16;
5050
static const uint32_t BCD_FRAME_COUNT = 14;
51-
static const uint32_t BCD_FRAME_BYTES = 72;
51+
static const uint32_t BCD_FRAME_BYTES = 40;
5252
static const uint32_t ROW_BYTES = BCD_FRAME_COUNT * BCD_FRAME_BYTES;
5353
static const uint32_t BITSTREAM_LENGTH = (ROW_COUNT * ROW_BYTES);
5454
static const uint SYSTEM_FREQ = 22050;

libraries/stellar_unicorn/stellar_unicorn.pio

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
; for each row:
2222
; for each bcd frame:
23-
; 0: 00111111 // row pixel count (minus one)
23+
; 0: 00011111 // row pixel count (minus one)
2424
; 1: xxxxrrrr // row select bits
2525
; 2 - 65: xxxxxbgr, xxxxxbgr, xxxxxbgr, ... // pixel data
2626
; 66 - 67: xxxxxxxx, xxxxxxxx // dummy bytes to dword align

0 commit comments

Comments
 (0)