@@ -95,7 +95,8 @@ void identifyBoard()
9595 bool husb238Present = i2cIsDevicePresent (i2c_0, 0x08 );
9696
9797 // 0x10 - MFI343S00177 Authentication Coprocessor
98- bool mfiPresent = i2cIsDevicePresent (i2c_0, 0x10 );
98+ // The authentication coprocessor can be asleep. It needs special treatment
99+ bool mfiPresent = i2cIsDeviceRegisterPresent (i2c_0, 0x10 , 0x00 , 0x07 );
99100
100101 i2c_0->end ();
101102
@@ -1803,12 +1804,19 @@ bool i2cBusInitialization(TwoWire *i2cBus, int sda, int scl, int clockKHz)
18031804 // SDA/GND shorted: 14ms, response 5
18041805 timer = millis ();
18051806
1806- // If there is nothing else on the bus, the authentication coprocessor can be asleep
1807- // Ping it twice to be sure
1808- if (addr == 0x10 )
1809- i2cIsDevicePresent (i2cBus, addr); // Throw away result. Just wake it up.
1807+ // The authentication coprocessor can be asleep. It needs special treatment
1808+ if ((addr == 0x10 ) && (i2cIsDeviceRegisterPresent (i2cBus, addr, 0x00 , 0x07 )))
1809+ {
1810+ if (deviceFound == false )
1811+ {
1812+ systemPrintln (" I2C Devices:" );
1813+ deviceFound = true ;
1814+ }
18101815
1811- if (i2cIsDevicePresent (i2cBus, addr))
1816+ systemPrintf (" 0x%02X - MFI343S00177 Authentication Coprocessor\r\n " , addr);
1817+ i2cAuthCoPro = i2cBus; // Record the bus
1818+ }
1819+ else if (i2cIsDevicePresent (i2cBus, addr))
18121820 {
18131821 if (deviceFound == false )
18141822 {
@@ -1819,7 +1827,7 @@ bool i2cBusInitialization(TwoWire *i2cBus, int sda, int scl, int clockKHz)
18191827 switch (addr)
18201828 {
18211829 default : {
1822- systemPrintf (" 0x%02X\r\n " , addr);
1830+ systemPrintf (" 0x%02X - Unknown \r\n " , addr);
18231831 break ;
18241832 }
18251833
@@ -1833,12 +1841,6 @@ bool i2cBusInitialization(TwoWire *i2cBus, int sda, int scl, int clockKHz)
18331841 break ;
18341842 }
18351843
1836- case 0x10 : {
1837- systemPrintf (" 0x%02X - MFI343S00177 Authentication Coprocessor\r\n " , addr);
1838- i2cAuthCoPro = i2cBus; // Record the bus
1839- break ;
1840- }
1841-
18421844 case 0x18 : {
18431845 systemPrintf (" 0x%02X - PCA9557 GPIO Expander with Reset\r\n " , addr);
18441846 break ;
0 commit comments