You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/01/04 19:23:53 UTC

[GitHub] andrzej-kaczmarek commented on a change in pull request #1588: NRF52840 i2c pin config handles Port1

andrzej-kaczmarek commented on a change in pull request #1588: NRF52840 i2c pin config handles Port1
URL: https://github.com/apache/mynewt-core/pull/1588#discussion_r245395597
 
 

 ##########
 File path: hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
 ##########
 @@ -297,8 +297,22 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg)
     scl_port = HAL_GPIO_PORT(cfg->scl_pin);
     sda_port = HAL_GPIO_PORT(cfg->sda_pin);
 
-    scl_port->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF;
+    /* Handle pin configuration for nrf52840 on port 1*/
+#if MYNEWT_VAL(BSP_NRF52840)
+    if (sda_port == NRF_P1) {
+        sda_port->PIN_CNF[cfg->sda_pin-32] = NRF52_SDA_PIN_CONF;
 
 Review comment:
   there's no need for any branching or conditional compilation here, just use `HAL_GPIO_INDEX` macro to calculate pin index

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services