Skip to content

Commit

Permalink
remove unsused code
Browse files Browse the repository at this point in the history
  • Loading branch information
hnhoan committed Jan 12, 2017
1 parent 702aec4 commit 507be85
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
1 change: 0 additions & 1 deletion ARM/Nordic/include/ble_periph_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ extern "C" {
// ***
// Require user implementations
//
void BlePeriphAppInitUserStorage();
void BlePeriphAppInitServices();
void BlePeriphAppEvtDispatch(ble_evt_t * p_ble_evt);

Expand Down
47 changes: 0 additions & 47 deletions ARM/Nordic/src/ble_periph_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ BLEAPP_DATA g_BleAppData = {

pm_peer_id_t g_PeerMngrIdToDelete = PM_PEER_ID_INVALID;

std::atomic<bool> g_bFdsInitialized(false);

static inline void BleConnLedOff() {
if (g_BleAppData.ConnLedPort < 0 || g_BleAppData.ConnLedPin < 0)
return;
Expand All @@ -124,35 +122,10 @@ static inline void BleConnLedOn() {
IOPinClear(g_BleAppData.ConnLedPort, g_BleAppData.ConnLedPin);
}

// Simple event handler to handle errors during initialization.
static void fds_evt_handler(fds_evt_t const * const p_fds_evt)
{
switch (p_fds_evt->id)
{
case FDS_EVT_INIT:
if (p_fds_evt->result == FDS_SUCCESS)
{
// Initialization failed.
g_bFdsInitialized = true;
}
break;
case FDS_EVT_WRITE:
if (p_fds_evt->result == FDS_SUCCESS)
{
//printf("\r\nWrite\r\n");
}
break;
default:
break;
}
}

void BlePeriphAppDfuCallback(fs_evt_t const * const evt, fs_ret_t result)
{
if (result == FS_SUCCESS)
{
// (void)sd_ble_gap_disconnect(p_m_dfu->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);

NVIC_SystemReset();
}
}
Expand Down Expand Up @@ -783,26 +756,6 @@ void BlePeriphAppInit(const BLEAPP_CFG *pBleAppCfg, bool bEraseBond)
err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
APP_ERROR_CHECK(err_code);

ret_code_t ret = fds_register(fds_evt_handler);
if (ret != FDS_SUCCESS)
{
// Registering of the event handler has failed.
}
ret = fds_init();
if (ret != FDS_SUCCESS)
{
// Handle error.
}

// Wait until FDS is initialized
while (g_bFdsInitialized == false)
{
app_sched_execute();
}

BlePeriphAppInitUserStorage();


BlePeriphAppPeerMngrInit(pBleAppCfg->SecType, pBleAppCfg->SecExchg, bEraseBond);

gap_params_init(pBleAppCfg);
Expand Down

0 comments on commit 507be85

Please sign in to comment.