Add ClockError enum and update system_freq to return Result for error handling

This commit is contained in:
1-rafael-1
2025-05-12 21:33:47 +02:00
parent 133500167c
commit 79e452922a
4 changed files with 50 additions and 22 deletions

View File

@@ -23,7 +23,7 @@ const COUNT_TO: i64 = 10_000_000;
#[embassy_executor::main]
async fn main(_spawner: Spawner) -> ! {
// Set up for clock frequency of 200 MHz, setting all necessary defaults.
let mut config = Config::new(ClockConfig::system_freq(200_000_000));
let mut config = Config::new(ClockConfig::system_freq(200_000_000).unwrap());
// since for the rp235x there is no official support for higher clock frequencies, `system_freq()` will not set a voltage for us.
// We need to guess the core voltage, that is needed for the higher clock frequency. Going with a small increase from the default 1.1V here, based on