Searching for solution for vals::Omask not found. Is found locally, but not on build server

This commit is contained in:
anton smeenk 2023-10-28 08:58:08 +02:00
parent 26e37c673d
commit a03407d08c
3 changed files with 11 additions and 21 deletions

View File

@ -1,6 +1,6 @@
#![macro_use]
use stm32_metapac::i2c::vals;
use stm32_metapac::i2c::vals::Oamsk;
use crate::interrupt;
@ -45,35 +45,25 @@ pub enum Address2Mask {
}
impl Address2Mask {
#[inline(always)]
pub const fn to_vals_impl(self) -> vals::Oamsk {
pub const fn to_vals_impl(self) -> Oamsk {
match self {
Address2Mask::NOMASK => vals::Oamsk::NOMASK,
Address2Mask::MASK1 => vals::Oamsk::MASK1,
Address2Mask::MASK2 => vals::Oamsk::MASK2,
Address2Mask::MASK3 => vals::Oamsk::MASK3,
Address2Mask::MASK4 => vals::Oamsk::MASK4,
Address2Mask::MASK5 => vals::Oamsk::MASK5,
Address2Mask::MASK6 => vals::Oamsk::MASK6,
Address2Mask::MASK7 => vals::Oamsk::MASK7,
Address2Mask::NOMASK => Oamsk::NOMASK,
Address2Mask::MASK1 => Oamsk::MASK1,
Address2Mask::MASK2 => Oamsk::MASK2,
Address2Mask::MASK3 => Oamsk::MASK3,
Address2Mask::MASK4 => Oamsk::MASK4,
Address2Mask::MASK5 => Oamsk::MASK5,
Address2Mask::MASK6 => Oamsk::MASK6,
Address2Mask::MASK7 => Oamsk::MASK7,
}
}
}
#[repr(u8)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub enum Dir {
WRITE,
READ,
}
impl Dir {
#[inline(always)]
pub const fn to_vals_impl(self) -> vals::Dir {
match self {
Dir::READ => vals::Dir::READ,
Dir::WRITE => vals::Dir::WRITE,
}
}
}
pub(crate) mod sealed {
use super::*;

View File

@ -1527,6 +1527,7 @@ mod eh1 {
Self::Crc => embedded_hal_1::i2c::ErrorKind::Other,
Self::Overrun => embedded_hal_1::i2c::ErrorKind::Overrun,
Self::ZeroLengthTransfer => embedded_hal_1::i2c::ErrorKind::Other,
Self::BufferSize => embedded_hal_1::i2c::ErrorKind::Other,
}
}
}

View File

@ -115,7 +115,6 @@ async fn main(spawner: Spawner) {
let mut buf_20 = [0; 20]; // buffer is shorter than master will send: wait for STOP condition
let mut buf_20a = [0; 20];
let mut buf_2 = [0; 2];
let mut buf_1 = [0; 1];
let mut errors = 0;
let mut address = 0;
let mut dir = Dir::READ;