File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -303,9 +303,9 @@ impl CFGR {
303
303
let vco_clkin_mhz = ( base_clk as f32 / pllm as f32 ) / 1_000_000.0 ;
304
304
let mut sysclk_mhz: f32 = sysclk as f32 / 1_000_000.0 ;
305
305
306
- // PLLN, main scaler, must result in >= 192MHz and <= 432MHz, min
307
- // 50, max 432, this constraint is allways respected when vco_clkin
308
- // <= 2 MHz
306
+ // PLLN, main scaler, must result in VCO frequency >=100MHz and <=432MHz,
307
+ // PLLN min 50, max 432, this constraint is always respected when
308
+ // vco_clkin <= 2 MHz
309
309
let mut plln: f32 = 100.0 ;
310
310
let allowed_pllp: [ u8 ; 4 ] = [ 2 , 4 , 6 , 8 ] ;
311
311
let pllp_val = * allowed_pllp
@@ -314,7 +314,12 @@ impl CFGR {
314
314
plln = ( ( sysclk_mhz * ( * pllp as f32 ) ) / vco_clkin_mhz) . floor ( ) ;
315
315
let error = sysclk_mhz - ( ( plln / ( * pllp as f32 ) ) * vco_clkin_mhz) ;
316
316
317
- if error < 0.0 || plln * vco_clkin_mhz > 432.0 || plln > 432.0 || plln < 100.0 {
317
+ if error < 0.0
318
+ || plln * vco_clkin_mhz < 100.0
319
+ || plln * vco_clkin_mhz > 432.0
320
+ || plln < 50.0
321
+ || plln > 432.0
322
+ {
318
323
core:: u32:: MAX
319
324
} else {
320
325
( error * 1_000.0 ) as u32
You can’t perform that action at this time.
0 commit comments