20 #include "softdevice_handler.h"
22 #include "app_util_platform.h"
31 #define CENTRAL_LINK_COUNT 0
32 #define PERIPHERAL_LINK_COUNT 1
41 static void m_ble_evt_dispatch(ble_evt_t * p_ble_evt)
53 ble_conn_bw_counts_t count = {{1,0,0},{1,0,0}};
56 nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;
57 SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
60 ble_enable_params_t ble_enable_params = {0};
62 ble_enable_params.common_enable_params.p_conn_bw_counts = &count;
65 opt.common_opt.conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;
66 opt.common_opt.conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;
67 opt.common_opt.conn_bw.role = BLE_GAP_ROLE_PERIPH;
72 err_code = softdevice_enable(&ble_enable_params);
73 APP_ERROR_CHECK(err_code);
75 err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &opt);
76 APP_ERROR_CHECK(err_code);
79 APP_ERROR_CHECK(err_code);
83 err_code = sd_nvic_SetPriority(SD_EVT_IRQn, APP_IRQ_PRIORITY_LOW);
84 APP_ERROR_CHECK(err_code);
107 #ifdef DEBUG_OUT_ENABLE
void pru_on_ble_evt(ble_evt_t *p_ble_evt)
Handle BLE event.
static void m_ble_stack_init(void)
BLE stack initialization.
int main()
Application main function.
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 PERIPHERAL_LINK_COUNT
#define APP_TIMER_PRESCALER
static void m_ble_evt_dispatch(ble_evt_t *p_ble_evt)
Dispatches a BLE stack event to all profiles.
#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...