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 2018/04/30 13:26:26 UTC

[GitHub] andrzej-kaczmarek closed pull request #74: nimble/phy: Build fixes

andrzej-kaczmarek closed pull request #74: nimble/phy: Build fixes
URL: https://github.com/apache/mynewt-nimble/pull/74
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/nimble/drivers/nrf52/src/ble_phy.c b/nimble/drivers/nrf52/src/ble_phy.c
index b9756b57..8948d655 100644
--- a/nimble/drivers/nrf52/src/ble_phy.c
+++ b/nimble/drivers/nrf52/src/ble_phy.c
@@ -251,7 +251,7 @@ ble_phy_mode_pdu_start_off(int phy_mode)
     return g_ble_phy_mode_pkt_start_off[phy_mode];
 }
 
-#if MYNEWT_VAL(BSP_NRF52840)
+#if NRF52840_XXAA
 static inline bool
 ble_phy_mode_is_coded(uint8_t phy_mode)
 {
@@ -314,7 +314,7 @@ ble_phy_mode_set(uint8_t new_phy_mode, uint8_t txtorx_phy_mode)
         return;
     }
 
-#if MYNEWT_VAL(BSP_NRF52840)
+#if NRF52840_XXAA
     ble_phy_apply_nrf52840_errata(new_phy_mode);
 #endif
 
@@ -1213,12 +1213,27 @@ ble_phy_isr(void)
 static inline void
 ble_phy_dbg_time_setup_gpiote(int index, int pin)
 {
-    hal_gpio_init_out(pin, 0);
+    NRF_GPIO_Type *port;
+
+#if NRF52840_XXAA
+    port = pin > 31 ? NRF_P1 : NRF_P0;
+    pin &= 0x1f;
+#else
+    port = NRF_P0;
+#endif
+
+    /* Configure GPIO directly to avoid dependency to hal_gpio (for porting) */
+    port->DIRSET = (1 << pin);
+    port->OUTCLR = (1 << pin);
 
     NRF_GPIOTE->CONFIG[index] =
                         (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) |
                         ((pin & 0x1F) << GPIOTE_CONFIG_PSEL_Pos) |
+#if NRF52840_XXAA
                         ((pin > 31) << GPIOTE_CONFIG_PORT_Pos);
+#else
+                        0;
+#endif
 }
 #endif
 
@@ -1259,7 +1274,11 @@ ble_phy_dbg_time_setup(void)
     ble_phy_dbg_time_setup_gpiote(--gpiote_idx,
                               MYNEWT_VAL(BLE_PHY_DBG_TIME_WFR_PIN));
 
+#if NRF52840_XXAA
     NRF_PPI->CH[18].EEP = (uint32_t)&(NRF_RADIO->EVENTS_RXREADY);
+#else
+    NRF_PPI->CH[18].EEP = (uint32_t)&(NRF_RADIO->EVENTS_READY);
+#endif
     NRF_PPI->CH[18].TEP = (uint32_t)&(NRF_GPIOTE->TASKS_SET[gpiote_idx]);
     NRF_PPI->CH[19].EEP = (uint32_t)&(NRF_RADIO->EVENTS_DISABLED);
     NRF_PPI->CH[19].TEP = (uint32_t)&(NRF_GPIOTE->TASKS_CLR[gpiote_idx]);


 

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