Skip to content
Permalink
Browse files

Bluetooth: controller: Add GPIO Debug Pins for HFCLK state

Add implementation to toggle GPIO Debug pins on HFCLK
request and release by the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
  • Loading branch information...
cvinayak authored and carlescufi committed May 3, 2019
1 parent 54e78b9 commit 4b9dee8a74f868d5f4e5b0cdee7d07a948615c58
Showing with 17 additions and 3 deletions.
  1. +17 −3 subsys/bluetooth/controller/ll_sw/ctrl.c
@@ -4623,6 +4623,7 @@ static inline void isr_close_conn(void)
static inline void isr_radio_state_close(void)
{
u32_t dont_close = 0U;
int err;

switch (_radio.role) {
case ROLE_ADV:
@@ -4676,7 +4677,10 @@ static inline void isr_radio_state_close(void)

event_inactive(0, 0, 0, NULL);

clock_control_off(_radio.hf_clock, NULL);
err = clock_control_off(_radio.hf_clock, NULL);
if (!err) {
DEBUG_RADIO_XTAL(0);
}

mayfly_enable(RADIO_TICKER_USER_ID_WORKER, RADIO_TICKER_USER_ID_JOB, 1);

@@ -4945,10 +4949,15 @@ static void event_inactive(u32_t ticks_at_expire, u32_t remainder,

static void mayfly_xtal_start(void *params)
{
int err;

ARG_UNUSED(params);

/* turn on 16MHz clock, non-blocking mode. */
clock_control_on(_radio.hf_clock, NULL);
err = clock_control_on(_radio.hf_clock, NULL);
LL_ASSERT(!err || (err == -EINPROGRESS));

DEBUG_RADIO_XTAL(1);
}

static void event_xtal(u32_t ticks_at_expire, u32_t remainder,
@@ -4972,9 +4981,14 @@ static void event_xtal(u32_t ticks_at_expire, u32_t remainder,

static void mayfly_xtal_stop(void *params)
{
int err;

ARG_UNUSED(params);

clock_control_off(_radio.hf_clock, NULL);
err = clock_control_off(_radio.hf_clock, NULL);
if (!err) {
DEBUG_RADIO_XTAL(0);
}

DEBUG_RADIO_CLOSE(0);
}

0 comments on commit 4b9dee8

Please sign in to comment.
You can’t perform that action at this time.