浏览代码

i2c bus scan logic

namrota ghosh 8 月之前
父节点
当前提交
ad245183c3
共有 1 个文件被更改,包括 1 次插入2 次删除
  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);
         }