Skip to content

Commit 457c725

Browse files
committed
minor demo1 fixes
1 parent 7b53edc commit 457c725

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scanvideo/demo1/demo1.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
#include <string.h>
99
#include "pico.h"
10-
#include "hardware/uart.h"
1110
#include "hardware/gpio.h"
12-
#include "hardware/divider.h"
1311
#include "spans.h"
1412
#include "pico/scanvideo.h"
1513
#include "pico/scanvideo/composable_scanline.h"
@@ -421,12 +419,13 @@ int vga_main(void) {
421419
#endif
422420
#ifndef IRQS_ON_CORE1
423421
setup_video();
422+
#else
423+
sem_acquire_blocking(&video_setup_complete);
424424
#endif
425425
#ifdef RENDER_ON_CORE0
426426
render_loop();
427427
#else
428428

429-
sem_acquire(&video_setup_complete);
430429
while (true) {
431430
#ifndef TEST_WAIT_FOR_SCANLINE
432431
// Just use vblank to print out a value every second
@@ -439,7 +438,7 @@ int vga_main(void) {
439438
#else
440439
static uint32_t sl = 0;
441440
sl = scanvideo_wait_for_scanline_complete(sl);
442-
scanline_color = (scanline_color + 0x10u) & 0xffu;
441+
scanline_color = (scanline_color + 1) & 0x1fu;
443442
#endif
444443
}
445444
#endif
@@ -554,7 +553,7 @@ bool render_scanline_test_pattern(struct scanvideo_scanline_buffer *dest, int co
554553
#ifndef TEST_WAIT_FOR_SCANLINE
555554
uint16_t c = 0xffff;
556555
#else
557-
uint16_t c = 0x0421 * (scanline_color >> 4);
556+
uint16_t c = PICO_SCANVIDEO_PIXEL_FROM_RGB5(1,1,1) * scanline_color;
558557
#endif
559558
if (w == 1) {
560559
buf16[pos++] = COMPOSABLE_RAW_1P;

0 commit comments

Comments
 (0)