File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
source/hic_hal/nxp/lpc4322 Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,14 @@ unsigned anadeci_new(unsigned msel)
385
385
}
386
386
return (msel & 0x3c ) + 4 ;
387
387
}
388
+
389
+ /* bandwidth: compute selp from msel */
390
+ unsigned anadecp_new (unsigned msel )
391
+ {
392
+ if (msel < 60 ) return (msel >>1 ) + 1 ;
393
+ return 31 ;
394
+ }
395
+
388
396
/******************************************************************************
389
397
* SetClock
390
398
******************************************************************************/
@@ -483,8 +491,7 @@ static void SetClock (void) {
483
491
/* M divider */
484
492
x = mdec_new (PLL0USB_M );
485
493
486
- if (PLL0USB_M < 60 ) selp = (PLL0USB_M >> 1 ) + 1 ;
487
- else selp = 31 ;
494
+ selp = anadecp_new (PLL0USB_M );
488
495
seli = anadeci_new (PLL0USB_M );
489
496
LPC_CGU -> PLL0USB_MDIV = (selp << 17 ) |
490
497
(seli << 22 ) |
You can’t perform that action at this time.
0 commit comments