23 #include "softdevice_handler.h"
25 #include "app_util_platform.h"
34 #define CENTRAL_LINK_COUNT 0
35 #define PERIPHERAL_LINK_COUNT 1
38 #define DEAD_BEEF 0xDEADBEEF
47 static void m_ble_evt_dispatch(ble_evt_t * p_ble_evt)
59 ble_conn_bw_counts_t count = {{1,0,0},{1,0,0}};
62 nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;
63 SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
66 ble_enable_params_t ble_enable_params = {0};
68 ble_enable_params.common_enable_params.p_conn_bw_counts = &count;
71 opt.common_opt.conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;
72 opt.common_opt.conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;
73 opt.common_opt.conn_bw.role = BLE_GAP_ROLE_PERIPH;
78 err_code = softdevice_enable(&ble_enable_params);
79 APP_ERROR_CHECK(err_code);
81 err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &opt);
82 APP_ERROR_CHECK(err_code);
85 APP_ERROR_CHECK(err_code);
89 err_code = sd_nvic_SetPriority(SD_EVT_IRQn, APP_IRQ_PRIORITY_LOW);
90 APP_ERROR_CHECK(err_code);
104 APP_ERROR_CHECK(err_code);
116 #ifdef DEBUG_OUT_ENABLE
void pru_on_ble_evt(ble_evt_t *p_ble_evt)
Handle BLE event.
uint32_t sd_radio_init(void)
Initialize SD Radio API.
int main()
Application main function.
static void m_ble_evt_dispatch(ble_evt_t *p_ble_evt)
Dispatches a BLE stack event to all profiles.
void pru_init(app_sm_evt_handler_t sm_evt_handler)
Initialize PRU. This function must be called before any other PRU function can be called...
#define APP_TIMER_OP_QUEUE_SIZE
#define CENTRAL_LINK_COUNT
#define APP_TIMER_PRESCALER
#define PRU_BUTTON_PRESS_LENGTH_DFU_MS
void debug(void)
Process debug commands.
void pru_start(void)
Enable the PRU profile. When enabled sensor reading and signal generation will be enabled...
#define PERIPHERAL_LINK_COUNT
static void m_ble_stack_init(void)
BLE stack initialization.