diff options
| author | datdenkikniet <jcdra1@gmail.com> | 2023-04-14 21:59:37 +0200 |
|---|---|---|
| committer | datdenkikniet <jcdra1@gmail.com> | 2023-04-16 13:08:36 +0200 |
| commit | dc02818ef1abe74b4d089dd7212984ef7e0654fe (patch) | |
| tree | 6164f643417ae9bdc2444fc6a485902358c7cc7b /examples/rp2040_local_i2c_init/src | |
| parent | 5a9135961f34505714e23f12e4cf4bacfa492dcd (diff) | |
rp2040_local_i2c_init: update to latest version
Diffstat (limited to 'examples/rp2040_local_i2c_init/src')
| -rw-r--r-- | examples/rp2040_local_i2c_init/src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/rp2040_local_i2c_init/src/main.rs b/examples/rp2040_local_i2c_init/src/main.rs index 3d881aa..6776892 100644 --- a/examples/rp2040_local_i2c_init/src/main.rs +++ b/examples/rp2040_local_i2c_init/src/main.rs @@ -25,8 +25,6 @@ mod app { use panic_probe as _; - rtic_monotonics::make_rp2040_monotonic_handler!(); - type I2CBus = I2C< pac::I2C1, ( @@ -51,8 +49,11 @@ mod app { i2c_ctx: MaybeUninit<I2CBus> = MaybeUninit::uninit() ])] fn init(mut ctx: init::Context) -> (Shared, Local) { + // Initialize the interrupt for the RP2040 timer and obtain the token + // proving that we have. + let rp2040_timer_token = rtic_monotonics::create_rp2040_monotonic_token!(); // Configure the clocks, watchdog - The default is to generate a 125 MHz system clock - Timer::start(ctx.device.TIMER, &mut ctx.device.RESETS); // default rp2040 clock-rate is 125MHz + Timer::start(ctx.device.TIMER, &mut ctx.device.RESETS, rp2040_timer_token); // default rp2040 clock-rate is 125MHz let mut watchdog = Watchdog::new(ctx.device.WATCHDOG); let clocks = clocks::init_clocks_and_plls( XOSC_CRYSTAL_FREQ, |
