Skip to content

Commit

Permalink
i2c probe patch
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek-samsung committed Mar 10, 2022
1 parent 7723684 commit b7c52af
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions apps/examples/hello/hello_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@
* hello_main
****************************************************************************/

int counter = 0;

#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int hello_main(int argc, char *argv[])
#endif
{
sleep(2);
counter++;
printf("Hello, World!!\n");
if (counter == 3) {
printf("registering i2s driver\n");
struct i2s_dev_s *i2s = amebad_i2s_initialize(0);
}
return 0;
}
2 changes: 1 addition & 1 deletion apps/system/i2c/i2c_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ int i2ccmd_dev(FAR struct i2ctool_s *i2ctool, int argc, char **argv)
ret = I2C_TRANSFER(dev, msg, 2);
}

if (ret == OK) {
if (ret > 0) {
i2ctool_printf(i2ctool, "%02x ", addr);
} else {
i2ctool_printf(i2ctool, "-- ");
Expand Down
3 changes: 2 additions & 1 deletion apps/system/i2c/i2c_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,13 @@ int i2ctool_get(FAR struct i2ctool_s *i2ctool, FAR struct i2c_dev_s *dev, uint8_

/* Return the result of the read operation */

if (ret == OK) {
if (ret > 0) {
if (i2ctool->width == 8) {
*result = (uint16_t)u.data8;
} else {
*result = u.data16;
}
ret = 0;
}

return ret;
Expand Down
1 change: 1 addition & 0 deletions apps/system/i2c/i2c_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ int i2ctool_set(FAR struct i2ctool_s *i2ctool, FAR struct i2c_dev_s *dev, uint8_
}
} else {
ret = I2C_TRANSFER(dev, msg, 2);
if (ret > 0) ret = 0;
}

return ret;
Expand Down
2 changes: 2 additions & 0 deletions os/board/rtl8721csm/src/rtl8721csm_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ void board_initialize(void)
}
}
#endif
#ifdef CONFIG_AUDIO_UB6470
rtl_ub6470_initialize(0);
#endif

#ifdef CONFIG_FTL_ENABLED
app_ftl_init();
Expand Down

0 comments on commit b7c52af

Please sign in to comment.