You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/09 17:54:21 UTC

[GitHub] [incubator-nuttx] phfbertoleti opened a new pull request #3014: BMP180 sensor support to RP2040

phfbertoleti opened a new pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014


   ## Summary
   This commit adds BMP180 sensor support to RP2040 (at this moment: Raspberry Pi Pico board).
   BMP180 sensor should be wired to I2C0 (there's no support for it in I2C1).
   
   ## Impact
   None, once it only adds BMP180 sensor support in RP2040 boards.
   
   ## Testing
   Successfully tested in a Raspberry Pi Pico Board, as seen in figure below:
   
   ![image](https://user-images.githubusercontent.com/16869652/110515564-e5b6f580-80de-11eb-98e9-97547a07c9b6.png)
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590695142



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/include/rp2040_bmp180.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H
+#define __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Type Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Inline Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno);
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H */

Review comment:
       ```suggestion
   #endif /* __BOARDS_ARM_RP2040_COMMON_INCLUDE_RP2040_BMP180_H */
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#issuecomment-794431175


   @phfbertoleti, could you please shorten the commit message?
   Although NuttX does not have a explicit rule for commit messages, you may take a look at the project history as a basis.
   Usually we follow the something like this: `component[/sub-component]: Add a brief description`.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#issuecomment-794448617


   @gustavonihei , I've changed commit to your suggestion,


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590623062



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.h

Review comment:
       Thanks @acassis !




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei edited a comment on pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei edited a comment on pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#issuecomment-794431175


   @phfbertoleti, could you please shorten the commit message?
   Although NuttX does not have a explicit rule for commit messages, you may take a look at the project history as a basis.
   Usually we follow the something like this: `component[/sub-component]: Add a brief description`.
   
   As a suggestion, I'd recommend [this article](https://chris.beams.io/posts/git-commit/) from Chris Beams.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590648782



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       @gustavonihei , it seems verification considers this blank line required. 
   
   pedro@pedro-270E5G-270E5U:~/nuttxspace/fork_repo/incubator-nuttx$ ./tools/checkpatch.sh -f boards/arm/rp2040/common/src/rp2040_bmp180.c 
   /home/pedro/nuttxspace/fork_repo/incubator-nuttx/boards/arm/rp2040/common/src/rp2040_bmp180.c:88:1: error: Missing blank line after comment
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590694978



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/include/rp2040_bmp180.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H
+#define __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H

Review comment:
       ```suggestion
   #ifndef __BOARDS_ARM_RP2040_COMMON_INCLUDE_RP2040_BMP180_H
   #define __BOARDS_ARM_RP2040_COMMON_INCLUDE_RP2040_BMP180_H
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti closed pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti closed pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590664346



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       It seems you've removed the wrong blank line. Actually @acassis suggestion was for removing line 91. Line 88 is indeed required.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590610140



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       There is not need for this empty between "i2c = rp2040..." and "if (i2c)", please the NuttX Coding Standard, in the section "4.8 Use of goto" there are many examples showing that there is not need for this empty line. It seams that someone included it in the code and now it is reproducing fast. :-)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590699583



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/include/rp2040_bmp180.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H
+#define __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Type Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Inline Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno);
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H */

Review comment:
       @gustavonihei , thanks for the review. I've just fixed it. Please, would you review it again?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590601038



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.h

Review comment:
       Thanks Alan. I've just fixed it. Please, would you review it again?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590646909



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       @gustavonihei , I've checksed as you requested and an error is generated:
   
   pedro@pedro-270E5G-270E5U:~/nuttxspace/fork_repo/incubator-nuttx$ ./tools/checkpatch.sh -f boards/arm/rp2040/common/src/rp2040_bmp180.c 
   /home/pedro/nuttxspace/fork_repo/incubator-nuttx/boards/arm/rp2040/common/src/rp2040_bmp180.c:88:1: error: Missing blank line after comment




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590612495



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.h

Review comment:
       That is perfect @phfbertoleti ! I just found an extra empty line that I think is better to remove. It is better to keep the saved variable next to its "if ()" test condition.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis merged pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
acassis merged pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590648782



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       @gustavonihei , it seems verification considers this blank line required. 
   
   pedro@pedro-270E5G-270E5U:~/nuttxspace/fork_repo/incubator-nuttx$ ./tools/checkpatch.sh -f boards/arm/rp2040/common/src/rp2040_bmp180.c 
   /home/pedro/nuttxspace/fork_repo/incubator-nuttx/boards/arm/rp2040/common/src/rp2040_bmp180.c:88:1: error: Missing blank line after comment
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590644565



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       Hi @phfbertoleti, could you perform this simple test?
   Please, remove this blank line and run `./tools/checkpatch.sh -f boards/arm/rp2040/common/src/rp2040_bmp180.c`
   If NxStyle indeed reports this issue, I'd say it is an issue with the verification.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590666357



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       @gustavonihei and @acassis, sorry, I think I've understood it wrong. I just removed tjhe blankline between rp2040_i2cbus_initialize and futher if command.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590596363



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.h

Review comment:
       the relative path is incorrect, this should be ..../common/include/....




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#issuecomment-794440468


   > > @phfbertoleti, could you please shorten the commit message?
   > > Although NuttX does not have a explicit rule for commit messages, you may take a look at the project history as a basis.
   > > Usually we follow the something like this: `component[/sub-component]: Add a brief description`.
   > > You can use the commit body for a more detailed explanation.
   > > As a suggestion, I'd recommend [this article](https://chris.beams.io/posts/git-commit/) from Chris Beams.
   > 
   > @gustavonihei , I've just shortened commit message to "This commit adds BMP180 sensor support to RP2040.". Is it ok?
   
   Way better. But, if you want to fit the template that I suggested before:
   `boards/raspberrypi-pico: Add BMP180 sensor support`
   I think it is cleaner.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590610140



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       There is not need for this empty line (break line) between "i2c = rp2040..." and "if (i2c)", please the NuttX Coding Standard, in the section "4.8 Use of goto" there are many examples showing that there is not need for this empty line. It seams that someone included it in the code and now it is reproducing fast. :-)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#issuecomment-794437242


   > @phfbertoleti, could you please shorten the commit message?
   > Although NuttX does not have a explicit rule for commit messages, you may take a look at the project history as a basis.
   > Usually we follow the something like this: `component[/sub-component]: Add a brief description`.
   > You can use the commit body for a more detailed explanation.
   > 
   > As a suggestion, I'd recommend [this article](https://chris.beams.io/posts/git-commit/) from Chris Beams.
   
   @gustavonihei , I've just shortened commit message to "This commit adds BMP180 sensor support to RP2040.". Is it ok?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#issuecomment-794443939


   > > > @phfbertoleti, could you please shorten the commit message?
   > > > Although NuttX does not have a explicit rule for commit messages, you may take a look at the project history as a basis.
   > > > Usually we follow the something like this: `component[/sub-component]: Add a brief description`.
   > > > You can use the commit body for a more detailed explanation.
   > > > As a suggestion, I'd recommend [this article](https://chris.beams.io/posts/git-commit/) from Chris Beams.
   > > 
   > > 
   > > @gustavonihei , I've just shortened commit message to "This commit adds BMP180 sensor support to RP2040.". Is it ok?
   > 
   > Way better. But, if you want to fit the template that I suggested before:
   > `boards/raspberrypi-pico: Add BMP180 sensor support`
   > I think it is cleaner.
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590699682



##########
File path: boards/arm/rp2040/common/include/rp2040_bmp180.h
##########
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/include/rp2040_bmp180.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H
+#define __BOARDS_ARM_RP2040_COMMON_INCLUDE_BOARD_BMP180_H

Review comment:
       @gustavonihei , thanks for the review. I've just fixed it. Please, would you review it again?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei edited a comment on pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei edited a comment on pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#issuecomment-794431175


   @phfbertoleti, could you please shorten the commit message?
   Although NuttX does not have a explicit rule for commit messages, you may take a look at the project history as a basis.
   Usually we follow the something like this: `component[/sub-component]: Add a brief description`.
   You can use the commit body for a more detailed explanation.
   
   As a suggestion, I'd recommend [this article](https://chris.beams.io/posts/git-commit/) from Chris Beams.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590697567



##########
File path: boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c
##########
@@ -102,5 +102,17 @@ int rp2040_bringup(void)
     }
 #endif
 
+#ifdef CONFIG_SENSORS_BMP180
+  /* Try to register BMP180 device in I2C0 */
+
+  ret = board_bmp180_initialize(0);
+

Review comment:
       This blank line can also be removed




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590612086



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       Alan, per my understanding, this space is required by Nuttx code standard. Remebering the previous experiences in Nutttx for esp32, if I remove this space, code check will fail




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590647467



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       @gustavonihei in this case, I should maintain the code as it is (once current verification require this blank like), right?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] phfbertoleti commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
phfbertoleti commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590701078



##########
File path: boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c
##########
@@ -102,5 +102,17 @@ int rp2040_bringup(void)
     }
 #endif
 
+#ifdef CONFIG_SENSORS_BMP180
+  /* Try to register BMP180 device in I2C0 */
+
+  ret = board_bmp180_initialize(0);
+
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "Failed to initialize BMP180 driver: %d\n", ret);
+      return ret;

Review comment:
       @gustavonihei , thanks for the review. I've just fixed it. Please, would you review it again?

##########
File path: boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c
##########
@@ -102,5 +102,17 @@ int rp2040_bringup(void)
     }
 #endif
 
+#ifdef CONFIG_SENSORS_BMP180
+  /* Try to register BMP180 device in I2C0 */
+
+  ret = board_bmp180_initialize(0);
+

Review comment:
       @gustavonihei , thanks for the review. I've just fixed it. Please, would you review it again?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590699581



##########
File path: boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c
##########
@@ -102,5 +102,17 @@ int rp2040_bringup(void)
     }
 #endif
 
+#ifdef CONFIG_SENSORS_BMP180
+  /* Try to register BMP180 device in I2C0 */
+
+  ret = board_bmp180_initialize(0);
+
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "Failed to initialize BMP180 driver: %d\n", ret);
+      return ret;

Review comment:
       This return can be removed.
   Otherwise the board will fail to bringup just because of a problem with the sensor.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590664346



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       It seems you've removed the wrong blank line. Actually @acassis suggestion was for removing line 91. The blank line at line 89 is indeed required.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3014: BMP180 sensor support to RP2040

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3014:
URL: https://github.com/apache/incubator-nuttx/pull/3014#discussion_r590644565



##########
File path: boards/arm/rp2040/common/src/rp2040_bmp180.c
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * boards/arm/rp2040/common/src/esp32_bmp180.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/sensors/bmp180.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include "rp2040_i2c.h"
+#include "rp2040_bmp180.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_bmp180_initialize
+ *
+ * Description:
+ *   Initialize and register the BMP180 Pressure Sensor driver.
+ *
+ * Input Parameters:
+ *   devno - The device number, used to build the device path as /dev/pressN
+ *   busno - The I2C bus number
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int board_bmp180_initialize(int busno)
+{
+  struct i2c_master_s *i2c;
+  char devpath[12];
+  int ret;
+  const int devno = 0;
+
+  sninfo("Initializing BMP180!\n");
+
+  /* Initialize BMP180 */
+
+  i2c = rp2040_i2cbus_initialize(busno);
+

Review comment:
       Hi @phfbertoleti, could you perform this simple test?
   Please, remove this blank line and run:
   `./tools/checkpatch.sh -f boards/arm/rp2040/common/src/rp2040_bmp180.c`
   If NxStyle indeed reports this issue, I'd say it is an issue with the verification.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org