AndroidのBLEラジコンプロポアプリ「BLEPropo」と接続し、RCサーボとDCモータを制御するプログラムです。 BLE Nanoで動作を確認しています。 BLEPropo → https://github.com/lipoyang/BLEPropo

Dependencies:   BLE_API mbed

BLEを使ったAndroid用ラジコンプロポアプリ「BLEPropo」に対応するBLE Nano用ファームウェアです。
BLEPropoは、GitHubにて公開中。
https://github.com/lipoyang/BLEPropo
/media/uploads/lipoyang/blepropo_ui.png
ラジコンは、mbed HRM1017とRCサーボやDCモータを組み合わせて作ります。
/media/uploads/lipoyang/ministeer3.jpg
回路図
/media/uploads/lipoyang/ministeer3.pdf

Committer:
lipoyang
Date:
Sat Mar 14 12:02:48 2015 +0000
Revision:
5:7f89fca19a9e
-convert nRF51822 library to a folder

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lipoyang 5:7f89fca19a9e 1 /* mbed Microcontroller Library
lipoyang 5:7f89fca19a9e 2 * Copyright (c) 2006-2013 ARM Limited
lipoyang 5:7f89fca19a9e 3 *
lipoyang 5:7f89fca19a9e 4 * Licensed under the Apache License, Version 2.0 (the "License");
lipoyang 5:7f89fca19a9e 5 * you may not use this file except in compliance with the License.
lipoyang 5:7f89fca19a9e 6 * You may obtain a copy of the License at
lipoyang 5:7f89fca19a9e 7 *
lipoyang 5:7f89fca19a9e 8 * http://www.apache.org/licenses/LICENSE-2.0
lipoyang 5:7f89fca19a9e 9 *
lipoyang 5:7f89fca19a9e 10 * Unless required by applicable law or agreed to in writing, software
lipoyang 5:7f89fca19a9e 11 * distributed under the License is distributed on an "AS IS" BASIS,
lipoyang 5:7f89fca19a9e 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
lipoyang 5:7f89fca19a9e 13 * See the License for the specific language governing permissions and
lipoyang 5:7f89fca19a9e 14 * limitations under the License.
lipoyang 5:7f89fca19a9e 15 */
lipoyang 5:7f89fca19a9e 16
lipoyang 5:7f89fca19a9e 17 #include "common/common.h"
lipoyang 5:7f89fca19a9e 18 #include "nordic_common.h"
lipoyang 5:7f89fca19a9e 19
lipoyang 5:7f89fca19a9e 20 #include "app_timer.h"
lipoyang 5:7f89fca19a9e 21 #include "btle.h"
lipoyang 5:7f89fca19a9e 22
lipoyang 5:7f89fca19a9e 23 #include "ble_stack_handler_types.h"
lipoyang 5:7f89fca19a9e 24 #include "ble_radio_notification.h"
lipoyang 5:7f89fca19a9e 25 #include "ble_flash.h"
lipoyang 5:7f89fca19a9e 26 #if NEED_BOND_MANAGER
lipoyang 5:7f89fca19a9e 27 #include "ble_bondmngr.h"
lipoyang 5:7f89fca19a9e 28 #endif
lipoyang 5:7f89fca19a9e 29 #include "ble_conn_params.h"
lipoyang 5:7f89fca19a9e 30
lipoyang 5:7f89fca19a9e 31 #include "btle_gap.h"
lipoyang 5:7f89fca19a9e 32 #include "btle_advertising.h"
lipoyang 5:7f89fca19a9e 33 #include "custom/custom_helper.h"
lipoyang 5:7f89fca19a9e 34
lipoyang 5:7f89fca19a9e 35 #include "softdevice_handler.h"
lipoyang 5:7f89fca19a9e 36 #include "pstorage.h"
lipoyang 5:7f89fca19a9e 37
lipoyang 5:7f89fca19a9e 38 #include "GapEvents.h"
lipoyang 5:7f89fca19a9e 39 #include "nRF51Gap.h"
lipoyang 5:7f89fca19a9e 40 #include "nRF51GattServer.h"
lipoyang 5:7f89fca19a9e 41
lipoyang 5:7f89fca19a9e 42 #include "ble_hci.h"
lipoyang 5:7f89fca19a9e 43
lipoyang 5:7f89fca19a9e 44 #if NEED_BOND_MANAGER /* disabled by default */
lipoyang 5:7f89fca19a9e 45 static void service_error_callback(uint32_t nrf_error);
lipoyang 5:7f89fca19a9e 46 #endif
lipoyang 5:7f89fca19a9e 47 extern "C" void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name);
lipoyang 5:7f89fca19a9e 48 void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name);
lipoyang 5:7f89fca19a9e 49
lipoyang 5:7f89fca19a9e 50 #if NEED_BOND_MANAGER /* disabled by default */
lipoyang 5:7f89fca19a9e 51 static error_t bond_manager_init(void);
lipoyang 5:7f89fca19a9e 52 #endif
lipoyang 5:7f89fca19a9e 53
lipoyang 5:7f89fca19a9e 54 static void btle_handler(ble_evt_t *p_ble_evt);
lipoyang 5:7f89fca19a9e 55
lipoyang 5:7f89fca19a9e 56 static void sys_evt_dispatch(uint32_t sys_evt)
lipoyang 5:7f89fca19a9e 57 {
lipoyang 5:7f89fca19a9e 58 pstorage_sys_event_handler(sys_evt);
lipoyang 5:7f89fca19a9e 59 }
lipoyang 5:7f89fca19a9e 60
lipoyang 5:7f89fca19a9e 61 error_t btle_init(void)
lipoyang 5:7f89fca19a9e 62 {
lipoyang 5:7f89fca19a9e 63 const bool useScheduler = false;
lipoyang 5:7f89fca19a9e 64 #ifdef TARGET_HRM1017
lipoyang 5:7f89fca19a9e 65 SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, useScheduler);
lipoyang 5:7f89fca19a9e 66 #else
lipoyang 5:7f89fca19a9e 67 SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, useScheduler);
lipoyang 5:7f89fca19a9e 68 #endif
lipoyang 5:7f89fca19a9e 69
lipoyang 5:7f89fca19a9e 70 // Enable BLE stack
lipoyang 5:7f89fca19a9e 71 /**
lipoyang 5:7f89fca19a9e 72 * Using this call, the application can select whether to include the
lipoyang 5:7f89fca19a9e 73 * Service Changed characteristic in the GATT Server. The default in all
lipoyang 5:7f89fca19a9e 74 * previous releases has been to include the Service Changed characteristic,
lipoyang 5:7f89fca19a9e 75 * but this affects how GATT clients behave. Specifically, it requires
lipoyang 5:7f89fca19a9e 76 * clients to subscribe to this attribute and not to cache attribute handles
lipoyang 5:7f89fca19a9e 77 * between connections unless the devices are bonded. If the application
lipoyang 5:7f89fca19a9e 78 * does not need to change the structure of the GATT server attributes at
lipoyang 5:7f89fca19a9e 79 * runtime this adds unnecessary complexity to the interaction with peer
lipoyang 5:7f89fca19a9e 80 * clients. If the SoftDevice is enabled with the Service Changed
lipoyang 5:7f89fca19a9e 81 * Characteristics turned off, then clients are allowed to cache attribute
lipoyang 5:7f89fca19a9e 82 * handles making applications simpler on both sides.
lipoyang 5:7f89fca19a9e 83 */
lipoyang 5:7f89fca19a9e 84 static const bool IS_SRVC_CHANGED_CHARACT_PRESENT = true;
lipoyang 5:7f89fca19a9e 85 ble_enable_params_t enableParams = {
lipoyang 5:7f89fca19a9e 86 .gatts_enable_params = {
lipoyang 5:7f89fca19a9e 87 .service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT
lipoyang 5:7f89fca19a9e 88 }
lipoyang 5:7f89fca19a9e 89 };
lipoyang 5:7f89fca19a9e 90 if (sd_ble_enable(&enableParams) != NRF_SUCCESS) {
lipoyang 5:7f89fca19a9e 91 return ERROR_INVALID_PARAM;
lipoyang 5:7f89fca19a9e 92 }
lipoyang 5:7f89fca19a9e 93
lipoyang 5:7f89fca19a9e 94 ble_gap_addr_t addr;
lipoyang 5:7f89fca19a9e 95 if (sd_ble_gap_address_get(&addr) != NRF_SUCCESS) {
lipoyang 5:7f89fca19a9e 96 return ERROR_INVALID_PARAM;
lipoyang 5:7f89fca19a9e 97 }
lipoyang 5:7f89fca19a9e 98 if (sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &addr) != NRF_SUCCESS) {
lipoyang 5:7f89fca19a9e 99 return ERROR_INVALID_PARAM;
lipoyang 5:7f89fca19a9e 100 }
lipoyang 5:7f89fca19a9e 101
lipoyang 5:7f89fca19a9e 102 ASSERT_STATUS( softdevice_ble_evt_handler_set(btle_handler));
lipoyang 5:7f89fca19a9e 103 ASSERT_STATUS( softdevice_sys_evt_handler_set(sys_evt_dispatch));
lipoyang 5:7f89fca19a9e 104
lipoyang 5:7f89fca19a9e 105 #if NEED_BOND_MANAGER /* disabled by default */
lipoyang 5:7f89fca19a9e 106 bond_manager_init();
lipoyang 5:7f89fca19a9e 107 #endif
lipoyang 5:7f89fca19a9e 108 btle_gap_init();
lipoyang 5:7f89fca19a9e 109
lipoyang 5:7f89fca19a9e 110 return ERROR_NONE;
lipoyang 5:7f89fca19a9e 111 }
lipoyang 5:7f89fca19a9e 112
lipoyang 5:7f89fca19a9e 113 static void btle_handler(ble_evt_t *p_ble_evt)
lipoyang 5:7f89fca19a9e 114 {
lipoyang 5:7f89fca19a9e 115 /* Library service handlers */
lipoyang 5:7f89fca19a9e 116 #if NEED_BOND_MANAGER /* disabled by default */
lipoyang 5:7f89fca19a9e 117 ble_bondmngr_on_ble_evt(p_ble_evt);
lipoyang 5:7f89fca19a9e 118 #endif
lipoyang 5:7f89fca19a9e 119 #if SDK_CONN_PARAMS_MODULE_ENABLE
lipoyang 5:7f89fca19a9e 120 ble_conn_params_on_ble_evt(p_ble_evt);
lipoyang 5:7f89fca19a9e 121 #endif
lipoyang 5:7f89fca19a9e 122
lipoyang 5:7f89fca19a9e 123 /* Custom event handler */
lipoyang 5:7f89fca19a9e 124 switch (p_ble_evt->header.evt_id) {
lipoyang 5:7f89fca19a9e 125 case BLE_GAP_EVT_CONNECTED: {
lipoyang 5:7f89fca19a9e 126 Gap::Handle_t handle = p_ble_evt->evt.gap_evt.conn_handle;
lipoyang 5:7f89fca19a9e 127 nRF51Gap::getInstance().setConnectionHandle(handle);
lipoyang 5:7f89fca19a9e 128 const Gap::ConnectionParams_t *params = reinterpret_cast<Gap::ConnectionParams_t *>(&(p_ble_evt->evt.gap_evt.params.connected.conn_params));
lipoyang 5:7f89fca19a9e 129 const ble_gap_addr_t *peer = &p_ble_evt->evt.gap_evt.params.connected.peer_addr;
lipoyang 5:7f89fca19a9e 130 nRF51Gap::getInstance().processConnectionEvent(handle, static_cast<Gap::addr_type_t>(peer->addr_type), peer->addr, params);
lipoyang 5:7f89fca19a9e 131 break;
lipoyang 5:7f89fca19a9e 132 }
lipoyang 5:7f89fca19a9e 133
lipoyang 5:7f89fca19a9e 134 case BLE_GAP_EVT_DISCONNECTED: {
lipoyang 5:7f89fca19a9e 135 Gap::Handle_t handle = p_ble_evt->evt.gap_evt.conn_handle;
lipoyang 5:7f89fca19a9e 136 // Since we are not in a connection and have not started advertising,
lipoyang 5:7f89fca19a9e 137 // store bonds
lipoyang 5:7f89fca19a9e 138 nRF51Gap::getInstance().setConnectionHandle (BLE_CONN_HANDLE_INVALID);
lipoyang 5:7f89fca19a9e 139 #if NEED_BOND_MANAGER /* disabled by default */
lipoyang 5:7f89fca19a9e 140 ASSERT_STATUS_RET_VOID ( ble_bondmngr_bonded_centrals_store());
lipoyang 5:7f89fca19a9e 141 #endif
lipoyang 5:7f89fca19a9e 142
lipoyang 5:7f89fca19a9e 143 Gap::DisconnectionReason_t reason;
lipoyang 5:7f89fca19a9e 144 switch (p_ble_evt->evt.gap_evt.params.disconnected.reason) {
lipoyang 5:7f89fca19a9e 145 case BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION:
lipoyang 5:7f89fca19a9e 146 reason = Gap::LOCAL_HOST_TERMINATED_CONNECTION;
lipoyang 5:7f89fca19a9e 147 break;
lipoyang 5:7f89fca19a9e 148 case BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION:
lipoyang 5:7f89fca19a9e 149 reason = Gap::REMOTE_USER_TERMINATED_CONNECTION;
lipoyang 5:7f89fca19a9e 150 break;
lipoyang 5:7f89fca19a9e 151 case BLE_HCI_CONN_INTERVAL_UNACCEPTABLE:
lipoyang 5:7f89fca19a9e 152 reason = Gap::CONN_INTERVAL_UNACCEPTABLE;
lipoyang 5:7f89fca19a9e 153 break;
lipoyang 5:7f89fca19a9e 154 default:
lipoyang 5:7f89fca19a9e 155 /* Please refer to the underlying transport library for an
lipoyang 5:7f89fca19a9e 156 * interpretion of this reason's value. */
lipoyang 5:7f89fca19a9e 157 reason = static_cast<Gap::DisconnectionReason_t>(p_ble_evt->evt.gap_evt.params.disconnected.reason);
lipoyang 5:7f89fca19a9e 158 break;
lipoyang 5:7f89fca19a9e 159 }
lipoyang 5:7f89fca19a9e 160 nRF51Gap::getInstance().processDisconnectionEvent(handle, reason);
lipoyang 5:7f89fca19a9e 161 break;
lipoyang 5:7f89fca19a9e 162 }
lipoyang 5:7f89fca19a9e 163
lipoyang 5:7f89fca19a9e 164 case BLE_GAP_EVT_SEC_PARAMS_REQUEST: {
lipoyang 5:7f89fca19a9e 165 ble_gap_sec_params_t sec_params = {0};
lipoyang 5:7f89fca19a9e 166
lipoyang 5:7f89fca19a9e 167 sec_params.timeout = 30; /*< Timeout for Pairing Request or
lipoyang 5:7f89fca19a9e 168 * Security Request (in seconds). */
lipoyang 5:7f89fca19a9e 169 sec_params.bond = 1; /**< Perform bonding. */
lipoyang 5:7f89fca19a9e 170 sec_params.mitm = CFG_BLE_SEC_PARAM_MITM;
lipoyang 5:7f89fca19a9e 171 sec_params.io_caps = CFG_BLE_SEC_PARAM_IO_CAPABILITIES;
lipoyang 5:7f89fca19a9e 172 sec_params.oob = CFG_BLE_SEC_PARAM_OOB;
lipoyang 5:7f89fca19a9e 173 sec_params.min_key_size = CFG_BLE_SEC_PARAM_MIN_KEY_SIZE;
lipoyang 5:7f89fca19a9e 174 sec_params.max_key_size = CFG_BLE_SEC_PARAM_MAX_KEY_SIZE;
lipoyang 5:7f89fca19a9e 175
lipoyang 5:7f89fca19a9e 176 ASSERT_STATUS_RET_VOID(sd_ble_gap_sec_params_reply(nRF51Gap::getInstance().getConnectionHandle(),
lipoyang 5:7f89fca19a9e 177 BLE_GAP_SEC_STATUS_SUCCESS, &sec_params));
lipoyang 5:7f89fca19a9e 178 }
lipoyang 5:7f89fca19a9e 179 break;
lipoyang 5:7f89fca19a9e 180
lipoyang 5:7f89fca19a9e 181 case BLE_GAP_EVT_TIMEOUT:
lipoyang 5:7f89fca19a9e 182 if (p_ble_evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT) {
lipoyang 5:7f89fca19a9e 183 nRF51Gap::getInstance().processEvent(GapEvents::GAP_EVENT_TIMEOUT);
lipoyang 5:7f89fca19a9e 184 }
lipoyang 5:7f89fca19a9e 185 break;
lipoyang 5:7f89fca19a9e 186
lipoyang 5:7f89fca19a9e 187 case BLE_GATTC_EVT_TIMEOUT:
lipoyang 5:7f89fca19a9e 188 case BLE_GATTS_EVT_TIMEOUT:
lipoyang 5:7f89fca19a9e 189 // Disconnect on GATT Server and Client timeout events.
lipoyang 5:7f89fca19a9e 190 // ASSERT_STATUS_RET_VOID (sd_ble_gap_disconnect(m_conn_handle,
lipoyang 5:7f89fca19a9e 191 // BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION));
lipoyang 5:7f89fca19a9e 192 break;
lipoyang 5:7f89fca19a9e 193
lipoyang 5:7f89fca19a9e 194 default:
lipoyang 5:7f89fca19a9e 195 break;
lipoyang 5:7f89fca19a9e 196 }
lipoyang 5:7f89fca19a9e 197
lipoyang 5:7f89fca19a9e 198 nRF51GattServer::getInstance().hwCallback(p_ble_evt);
lipoyang 5:7f89fca19a9e 199 }
lipoyang 5:7f89fca19a9e 200
lipoyang 5:7f89fca19a9e 201 #if NEED_BOND_MANAGER /* disabled by default */
lipoyang 5:7f89fca19a9e 202 /**************************************************************************/
lipoyang 5:7f89fca19a9e 203 /*!
lipoyang 5:7f89fca19a9e 204 @brief Initialises the bond manager
lipoyang 5:7f89fca19a9e 205
lipoyang 5:7f89fca19a9e 206 @note Bond data will be cleared on reset if the bond delete
lipoyang 5:7f89fca19a9e 207 button is pressed during initialisation (the button is
lipoyang 5:7f89fca19a9e 208 defined as CFG_BLE_BOND_DELETE_BUTTON_NUM).
lipoyang 5:7f89fca19a9e 209
lipoyang 5:7f89fca19a9e 210 @returns
lipoyang 5:7f89fca19a9e 211 */
lipoyang 5:7f89fca19a9e 212 /**************************************************************************/
lipoyang 5:7f89fca19a9e 213 static error_t bond_manager_init(void)
lipoyang 5:7f89fca19a9e 214 {
lipoyang 5:7f89fca19a9e 215 ble_bondmngr_init_t bond_para = {0};
lipoyang 5:7f89fca19a9e 216
lipoyang 5:7f89fca19a9e 217 ASSERT_STATUS ( pstorage_init());
lipoyang 5:7f89fca19a9e 218
lipoyang 5:7f89fca19a9e 219 bond_para.flash_page_num_bond = CFG_BLE_BOND_FLASH_PAGE_BOND;
lipoyang 5:7f89fca19a9e 220 bond_para.flash_page_num_sys_attr = CFG_BLE_BOND_FLASH_PAGE_SYS_ATTR;
lipoyang 5:7f89fca19a9e 221 //bond_para.bonds_delete = boardButtonCheck(CFG_BLE_BOND_DELETE_BUTTON_NUM) ;
lipoyang 5:7f89fca19a9e 222 bond_para.evt_handler = NULL;
lipoyang 5:7f89fca19a9e 223 bond_para.error_handler = service_error_callback;
lipoyang 5:7f89fca19a9e 224
lipoyang 5:7f89fca19a9e 225 ASSERT_STATUS( ble_bondmngr_init( &bond_para ));
lipoyang 5:7f89fca19a9e 226
lipoyang 5:7f89fca19a9e 227 /* Init radio active/inactive notification to flash (to only perform flashing when the radio is inactive) */
lipoyang 5:7f89fca19a9e 228 // ASSERT_STATUS( ble_radio_notification_init(NRF_APP_PRIORITY_HIGH,
lipoyang 5:7f89fca19a9e 229 // NRF_RADIO_NOTIFICATION_DISTANCE_4560US,
lipoyang 5:7f89fca19a9e 230 // ble_flash_on_radio_active_evt) );
lipoyang 5:7f89fca19a9e 231
lipoyang 5:7f89fca19a9e 232 return ERROR_NONE;
lipoyang 5:7f89fca19a9e 233 }
lipoyang 5:7f89fca19a9e 234 #endif // #if NEED_BOND_MANAGER
lipoyang 5:7f89fca19a9e 235
lipoyang 5:7f89fca19a9e 236 #if NEED_BOND_MANAGER /* disabled by default */
lipoyang 5:7f89fca19a9e 237 /**************************************************************************/
lipoyang 5:7f89fca19a9e 238 /*!
lipoyang 5:7f89fca19a9e 239 @brief
lipoyang 5:7f89fca19a9e 240 @param[in] nrf_error
lipoyang 5:7f89fca19a9e 241 @returns
lipoyang 5:7f89fca19a9e 242 */
lipoyang 5:7f89fca19a9e 243 /**************************************************************************/
lipoyang 5:7f89fca19a9e 244 static void service_error_callback(uint32_t nrf_error)
lipoyang 5:7f89fca19a9e 245 {
lipoyang 5:7f89fca19a9e 246 ASSERT_STATUS_RET_VOID( nrf_error );
lipoyang 5:7f89fca19a9e 247 }
lipoyang 5:7f89fca19a9e 248 #endif // #if NEED_BOND_MANAGER
lipoyang 5:7f89fca19a9e 249
lipoyang 5:7f89fca19a9e 250 /**************************************************************************/
lipoyang 5:7f89fca19a9e 251 /*!
lipoyang 5:7f89fca19a9e 252 @brief Callback when an error occurs inside the SoftDevice
lipoyang 5:7f89fca19a9e 253
lipoyang 5:7f89fca19a9e 254 @param[in] line_num
lipoyang 5:7f89fca19a9e 255 @param[in] p-file_name
lipoyang 5:7f89fca19a9e 256
lipoyang 5:7f89fca19a9e 257 @returns
lipoyang 5:7f89fca19a9e 258 */
lipoyang 5:7f89fca19a9e 259 /**************************************************************************/
lipoyang 5:7f89fca19a9e 260 void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name)
lipoyang 5:7f89fca19a9e 261 {
lipoyang 5:7f89fca19a9e 262 ASSERT(false, (void) 0);
lipoyang 5:7f89fca19a9e 263 }
lipoyang 5:7f89fca19a9e 264
lipoyang 5:7f89fca19a9e 265 /**************************************************************************/
lipoyang 5:7f89fca19a9e 266 /*!
lipoyang 5:7f89fca19a9e 267 @brief Handler for general errors above the SoftDevice layer.
lipoyang 5:7f89fca19a9e 268 Typically we can' recover from this so we do a reset.
lipoyang 5:7f89fca19a9e 269
lipoyang 5:7f89fca19a9e 270 @param[in] error_code
lipoyang 5:7f89fca19a9e 271 @param[in] line_num
lipoyang 5:7f89fca19a9e 272 @param[in] p-file_name
lipoyang 5:7f89fca19a9e 273
lipoyang 5:7f89fca19a9e 274 @returns
lipoyang 5:7f89fca19a9e 275 */
lipoyang 5:7f89fca19a9e 276 /**************************************************************************/
lipoyang 5:7f89fca19a9e 277 void app_error_handler(uint32_t error_code,
lipoyang 5:7f89fca19a9e 278 uint32_t line_num,
lipoyang 5:7f89fca19a9e 279 const uint8_t *p_file_name)
lipoyang 5:7f89fca19a9e 280 {
lipoyang 5:7f89fca19a9e 281 ASSERT_STATUS_RET_VOID( error_code );
lipoyang 5:7f89fca19a9e 282 NVIC_SystemReset();
lipoyang 5:7f89fca19a9e 283 }