Merge branch 'i2c_detect' into dev_environment
This commit is contained in:
commit
a9b9c0c33d
1 changed files with 10 additions and 6 deletions
|
|
@ -40,6 +40,7 @@ export default function DeviceScannedComponents(props: Props){
|
|||
const [openDialog, setOpenDialog] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
console.log(scannedComponents)
|
||||
if (scannedComponents.i2c) setScannedI2C(scannedComponents.i2c)
|
||||
//makes the array empty for testing
|
||||
// if (scannedComponents.i2c) {
|
||||
|
|
@ -65,13 +66,16 @@ export default function DeviceScannedComponents(props: Props){
|
|||
useEffect(()=>{
|
||||
let valid: quack.AddressData[] = []
|
||||
//filter the address data
|
||||
scannedI2C?.settings?.foundAddresses.forEach(addrData => {
|
||||
if(!i2cBlacklistAddresses.includes(addrData.address)){
|
||||
if(!(addrData.address === 0x71 && addrData.expansionLine === undefined)){
|
||||
valid.push(addrData)
|
||||
let addr = scannedI2C?.settings?.foundAddresses
|
||||
if(addr){
|
||||
addr.forEach(addrData => {
|
||||
if(!i2cBlacklistAddresses.includes(addrData.address)){
|
||||
if(!(addrData.address === 0x71 && addrData.expansionLine === undefined)){
|
||||
valid.push(addrData)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
setValidComponentAddresses(valid)
|
||||
},[scannedI2C])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue