From 50dbb8a22f74cfd79387bc5d2bc95246e25e3493 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Sat, 21 Aug 2021 01:46:39 +1000 Subject: [PATCH] Fix transposed variable names --- rp2040-hal/src/i2c.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rp2040-hal/src/i2c.rs b/rp2040-hal/src/i2c.rs index 3c0679c..8926a1e 100644 --- a/rp2040-hal/src/i2c.rs +++ b/rp2040-hal/src/i2c.rs @@ -126,8 +126,8 @@ macro_rules! hal { // There are some subtleties to I2C timing which we are completely ignoring here // See: https://github.com/raspberrypi/pico-sdk/blob/bfcbefafc5d2a210551a4d9d80b4303d4ae0adf7/src/rp2_common/hardware_i2c/i2c.c#L69 let period = (freq_in + freq / 2) / freq; - let hcnt = period * 3 / 5; // oof this one hurts - let lcnt = period - hcnt; + let lcnt = period * 3 / 5; // oof this one hurts + let hcnt = period - lcnt; // Check for out-of-range divisors: assert!(hcnt < 0xffff);