Fix transposed variable names

This commit is contained in:
9names 2021-08-21 01:46:39 +10:00
parent 6d913f1231
commit 50dbb8a22f

View file

@ -126,8 +126,8 @@ macro_rules! hal {
// There are some subtleties to I2C timing which we are completely ignoring here // 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 // 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 period = (freq_in + freq / 2) / freq;
let hcnt = period * 3 / 5; // oof this one hurts let lcnt = period * 3 / 5; // oof this one hurts
let lcnt = period - hcnt; let hcnt = period - lcnt;
// Check for out-of-range divisors: // Check for out-of-range divisors:
assert!(hcnt < 0xffff); assert!(hcnt < 0xffff);