Skip to content
Permalink
Browse files

bluetooth: controller: Move Nordic specific code

Move lll_chan_set into Nordic LLL.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
  • Loading branch information...
thoh-ot authored and nashif committed Apr 1, 2019
1 parent a202c14 commit 3ac8fa5c00b6d57ad3098b3ffbbf0af84a3045cb
@@ -21,35 +21,6 @@ static u16_t chan_prn(u16_t counter, u16_t chan_id);
#endif /* CONFIG_BT_CTLR_CHAN_SEL_2 */
#endif /* CONFIG_BT_CONN */

void lll_chan_set(u32_t chan)
{
switch (chan) {
case 37:
radio_freq_chan_set(2);
break;

case 38:
radio_freq_chan_set(26);
break;

case 39:
radio_freq_chan_set(80);
break;

default:
if (chan < 11) {
radio_freq_chan_set(4 + (chan * 2U));
} else if (chan < 40) {
radio_freq_chan_set(28 + ((chan - 11) * 2U));
} else {
LL_ASSERT(0);
}
break;
}

radio_whiten_iv_set(chan);
}

#if defined(CONFIG_BT_CONN)
u8_t lll_chan_sel_1(u8_t *chan_use, u8_t hop, u16_t latency, u8_t *chan_map,
u8_t chan_count)
@@ -4,7 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

void lll_chan_set(u32_t chan);
u8_t lll_chan_sel_1(u8_t *chan_use, u8_t hop, u16_t latency, u8_t *chan_map,
u8_t chan_count);
u8_t lll_chan_sel_2(u16_t counter, u16_t chan_id, u8_t *chan_map,
@@ -342,11 +342,43 @@ u32_t lll_preempt_calc(struct evt_hdr *evt, u8_t ticker_id,
return 0;
}


void lll_chan_set(u32_t chan)
{
switch (chan) {
case 37:
radio_freq_chan_set(2);
break;

case 38:
radio_freq_chan_set(26);
break;

case 39:
radio_freq_chan_set(80);
break;

default:
if (chan < 11) {
radio_freq_chan_set(4 + (chan * 2U));
} else if (chan < 40) {
radio_freq_chan_set(28 + ((chan - 11) * 2U));
} else {
LL_ASSERT(0);
}
break;
}

radio_whiten_iv_set(chan);
}


u32_t lll_radio_is_idle(void)
{
return radio_is_idle();
}


static int init_reset(void)
{
return 0;
@@ -13,3 +13,4 @@ int lll_clk_off(void);
u32_t lll_evt_offset_get(struct evt_hdr *evt);
u32_t lll_preempt_calc(struct evt_hdr *evt, u8_t ticker_id,
u32_t ticks_at_event);
void lll_chan_set(u32_t chan);

0 comments on commit 3ac8fa5

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