Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic in scanvideo.c with recurring sys_clk #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/rp2_common/pico_scanvideo_dpi/scanvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,11 +1383,11 @@ bool scanvideo_setup_with_timing(const scanvideo_mode_t *mode, const scanvideo_t
uint sys_clk = clock_get_hz(clk_sys);
video_clock_down_times_2 = sys_clk / timing->clock_freq;
#if PICO_SCANVIDEO_ENABLE_CLOCK_PIN
if (video_clock_down_times_2 * timing->clock_freq != sys_clk) {
if (timing->clock_freq != sys_clk / video_clock_down_times_2) {
panic("System clock (%d) must be an integer multiple of 2 times the requested pixel clock (%d).", sys_clk, timing->clock_freq);
}
#else
if (video_clock_down_times_2 * timing->clock_freq != sys_clk) {
if (timing->clock_freq != sys_clk / video_clock_down_times_2) {
panic("System clock (%d) must be an integer multiple of the requested pixel clock (%d).", sys_clk, timing->clock_freq);
}
#endif
Expand Down