Skip to content

Commit 7de925d

Browse files
committed
add maintenance notes around the fix for rust-lang/rust#90195
1 parent c245e78 commit 7de925d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/llio/src/api.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ impl Into<u32> for UartType {
4545
}
4646

4747
/////////////////////// I2C
48-
pub (crate) const I2C_MAX_LEN: usize = 33;
4948
// a small book-keeping struct used to report back to I2C requestors as to the status of a transaction
5049
#[derive(Debug, Copy, Clone, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Eq, PartialEq)]
5150
pub enum I2cStatus {
@@ -76,10 +75,12 @@ pub(crate) enum I2cCallback {
7675
// maybe once things stabilize, it's probably a good idea to make this structure private to the crate,
7776
// and create a "public" version for return values via callbacks. But for now, it's pretty
7877
// convenient to reach into the state of the I2C machine to debug problems in the callbacks.
78+
pub (crate) const I2C_MAX_LEN: usize = 33; // note: due to a regression in Rust 1.56, we can't use the I2C_MAX_LEN symbol in the structure below. So you must manually update that if you change it here.
7979
#[derive(Debug, Copy, Clone, Archive, Serialize, Deserialize)]
8080
pub struct I2cTransaction {
8181
pub bus_addr: u8,
8282
// write address and read address are encoded in the packet field below
83+
// NOTE: the number 33 that appears twice below mirrors I2C_MAX_LEN; due to a regression in Rust 1.56 we can't use constants in array types
8384
pub txbuf: Option<[u8; 33]>, // long enough for a 256-byte operation + 2 bytes of "register address"
8485
pub txlen: u32,
8586
pub rxbuf: Option<[u8; 33]>,

0 commit comments

Comments
 (0)