From b37c64742fb969610a5adbb2f41be1f73886a9fa Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 12 Feb 2019 14:38:01 +0000 Subject: [PATCH] Dynamic width - function completed (#119) --- gfx/video_crt_switch.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 35586ab9dd..494315653c 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -231,20 +231,20 @@ void crt_video_restore(void) int crt_compute_dynamic_width(int width) { - double p_clock = 18000000; - int min_height = 261; + double p_clock = 18000000; + int min_height = 261; + int dynamic_width = 0; #if defined(HAVE_VIDEOCORE) double p_clock = 32000000; #endif for (int i =1; i < 10; i++) { - if (((width*0.5*i) * min_height * ra_core_hz) > p_clock) - width = width*i; - return width; - break; + dynamic_width = (width*0.5)*i; + if ((dynamic_width * min_height * ra_core_hz) > p_clock) + return dynamic_width; } - return 0; + return width; } #if defined(HAVE_VIDEOCORE)