acassis commented on code in PR #16838: URL: https://github.com/apache/nuttx/pull/16838#discussion_r2285117845
########## boards/arm/rp2040/common/src/rp2040_common_bringup.c: ########## @@ -569,6 +574,16 @@ int rp2040_common_bringup(void) } #endif +#ifdef CONFIG_SENSORS_TMP112 + /* Try to register TMP112 device at I2C0 with a common address */ + + ret = board_tmp112_initialize(rp2040_i2cbus_initialize(0), 0, 0x48); Review Comment: @nmaggioni just a comment here: normally on NuttX code we don't do function "nesting" this way. Maybe it was just @patacongo personal preference, but I tried to follow the same standard to make the code more consistent and pleasure to read. There is nothing wrong with your code and I saw that sht4x_register, mcp9600_register and ms56xx_register do this way. But if you enter inside nuttx/boards and "git grep i2cbus_initialize" you will see that only rp2040 is doing this way. So my suggesting it to you follow the most common way and I will submit a fix to these other sensors. I don't want to be picky, but I think a good thing about NuttX code is its consistence, it makes the code easy to port from a board to other, etc. Does it makes sense for you? @xiaoxiang781216 @raiden00pl what do you think? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org