Explorar o código

i2c bus scan logic

namrota ghosh hai 8 meses
pai
achega
ad245183c3
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      src/interfaces/i2c_peripherals_scan.c

+ 1 - 2
src/interfaces/i2c_peripherals_scan.c

@@ -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);
         }