From 34ac6b7a0c1990b4c7bae50e2c4ee6232a4ad0af Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Thu, 13 Jul 2023 17:27:36 +0100 Subject: [PATCH] HACK: pico: less overclock for PicoVision It doesn't like 250 --- 32blit-pico/display_picovision.cpp | 7 +++++++ 32blit-pico/main.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/32blit-pico/display_picovision.cpp b/32blit-pico/display_picovision.cpp index c3897d7f3..50dea29cc 100644 --- a/32blit-pico/display_picovision.cpp +++ b/32blit-pico/display_picovision.cpp @@ -1,5 +1,7 @@ #include "display.hpp" +#include "pico/stdlib.h" + #include "config.h" #include "dv_display.hpp" @@ -16,6 +18,11 @@ static void vsync_callback(uint gpio, uint32_t events){ } void init_display() { +// bit of a hack overriding clock here, but 250 does not work +#if OVERCLOCK_250 + set_sys_clock_khz(216000, true); +#endif + display.init(DISPLAY_WIDTH, DISPLAY_HEIGHT, pimoroni::DVDisplay::MODE_RGB555); gpio_set_irq_enabled_with_callback(16/*VSYNC*/, GPIO_IRQ_EDGE_RISE, true, vsync_callback); diff --git a/32blit-pico/main.cpp b/32blit-pico/main.cpp index 6b9122dd1..fce4790e1 100644 --- a/32blit-pico/main.cpp +++ b/32blit-pico/main.cpp @@ -124,7 +124,7 @@ int main() { // this is required for a stable 250MHz on some RP2040s vreg_set_voltage(VREG_VOLTAGE_1_20); sleep_ms(10); - set_sys_clock_khz(250000, false); + set_sys_clock_khz(250000, true); #endif stdio_init_all();