|
|
@@ -8,8 +8,6 @@
|
|
|
Scans all the addresses of the peripherals:
|
|
|
*/
|
|
|
void I2C_scanBus(I2C_Regs *i2c) {
|
|
|
- printf("Scanning I2C Bus...\n");
|
|
|
-
|
|
|
// **Step 1: Reset I2C Controller if Busy**
|
|
|
if (DL_I2C_getControllerStatus(i2c) & DL_I2C_CONTROLLER_STATUS_BUSY_BUS) {
|
|
|
printf("I2C Bus Busy! Resetting I2C Controller...\n");
|
|
|
@@ -28,6 +26,7 @@ void I2C_scanBus(I2C_Regs *i2c) {
|
|
|
printf("Device found at: 0x%02X\n", addr);
|
|
|
}else {
|
|
|
// Clear the error by resetting the I2C controller
|
|
|
+ printf("Device not found...\n");
|
|
|
DL_I2C_disableController(i2c);
|
|
|
DL_I2C_enableController(i2c);
|
|
|
}
|