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/05/10 08:27:02 UTC

[GitHub] sjanc closed pull request #85: nimble/ll: Fix DTM build

sjanc closed pull request #85: nimble/ll: Fix DTM build
URL: https://github.com/apache/mynewt-nimble/pull/85
 
 
   

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/controller/src/ble_ll_dtm.c b/nimble/controller/src/ble_ll_dtm.c
index e014d249..28f68ca0 100644
--- a/nimble/controller/src/ble_ll_dtm.c
+++ b/nimble/controller/src/ble_ll_dtm.c
@@ -38,7 +38,7 @@ struct dtm_ctx {
     uint8_t rf_channel;
     uint8_t phy_mode;
     struct os_mbuf *om;
-    struct os_event evt;
+    struct ble_npl_event evt;
     struct ble_ll_sched_item sch;
 };
 
@@ -141,9 +141,9 @@ ble_ll_dtm_set_next(struct dtm_ctx *ctx)
 }
 
 static void
-ble_ll_dtm_event(struct os_event *evt) {
+ble_ll_dtm_event(struct ble_npl_event *evt) {
     /* It is called in LL context */
-    struct dtm_ctx *ctx = evt->ev_arg;
+    struct dtm_ctx *ctx = ble_npl_event_get_arg(evt);
     int rc;
     os_sr_t sr;
 
@@ -165,11 +165,12 @@ ble_ll_dtm_tx_done(void *arg)
     struct dtm_ctx *ctx;
 
     ctx = arg;
-    if (!ctx->evt.ev_cb) {
+    if (!ctx->active) {
         return;
     }
+
     /* Reschedule event in LL context */
-    os_eventq_put(&g_ble_ll_data.ll_evq, &ctx->evt);
+    ble_npl_eventq_put(&g_ble_ll_data.ll_evq, &ctx->evt);
 
     ble_ll_state_set(BLE_LL_STATE_STANDBY);
 }
@@ -289,8 +290,8 @@ ble_ll_dtm_tx_create_ctx(uint8_t packet_payload, uint8_t len,
                                        os_cputime_usecs_to_ticks(5000);
 
     /* Prepare os_event */
-    g_ble_ll_dtm_ctx.evt.ev_cb = ble_ll_dtm_event;
-    g_ble_ll_dtm_ctx.evt.ev_arg = &g_ble_ll_dtm_ctx;
+    ble_npl_event_init(&g_ble_ll_dtm_ctx.evt, ble_ll_dtm_event,
+                       &g_ble_ll_dtm_ctx);
 
     ble_ll_dtm_calculate_itvl(&g_ble_ll_dtm_ctx, len, phy_mode);
 


 

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