File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55### Added
66- Added ` build.rs ` to check if memory.x changed
77
8+ ### Fixed
9+ - PllaClock was not setting the freq. correctly.
10+
811## [ v0.4.6] 2025-03-31
912
1013### Changed
Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ impl Token<PllaClock> {
1818 source : & impl PllaSource ,
1919 PllaConfig { div, mult } : PllaConfig ,
2020 ) -> Result < PllaClock , ClockError > {
21- if !( 2 ..=63 ) . contains ( & mult) {
21+ if !( 2 ..=62 ) . contains ( & mult) {
2222 return Err ( ClockError :: InvalidPllaCk ) ;
2323 }
24+ // Datasheet error, sec 31.17 (step 6) & 31.20.10 differ.
2425 if div == 0 || div > 127 {
2526 return Err ( ClockError :: InvalidPllaCk ) ;
2627 }
@@ -38,7 +39,8 @@ impl Token<PllaClock> {
3839 while self . pmc ( ) . sr ( ) . read ( ) . locka ( ) . bit_is_clear ( ) { }
3940
4041 Ok ( PllaClock {
41- freq : ( source. freq ( ) . convert ( ) / div as u32 ) * mult as u32 ,
42+ // Per datasheet sec. 31.20.10, chip adds 1 to the multiplier.
43+ freq : ( source. freq ( ) . convert ( ) / div as u32 ) * ( mult + 1 ) as u32 ,
4244 } )
4345 }
4446}
You can’t perform that action at this time.
0 commit comments