@@ -96,8 +96,6 @@ bool nfcEnabled = false;
96
96
#endif
97
97
#define BLE_HANDLE_MAX 0xFFFF /**< Max handle value in BLE. */
98
98
99
- #define DEAD_BEEF 0xDEADBEEF /**< Value used as error code on stack dump, can be used to identify stack location on stack unwind. */
100
-
101
99
static ble_nus_t m_nus ; /**< Structure to identify the Nordic UART Service. */
102
100
static uint16_t m_conn_handle = BLE_CONN_HANDLE_INVALID ; /**< Handle of the current connection. */
103
101
#if CENTRAL_LINK_COUNT > 0
@@ -215,9 +213,19 @@ Called when an NFC field is no longer detected
215
213
* @details
216
214
*/
217
215
void ble_app_error_handler (uint32_t error_code , uint32_t line_num , const uint8_t * p_file_name ) {
218
- jsiConsolePrintf ("NRF ERROR 0x%x at %s:%d\n" , error_code , p_file_name , line_num );
216
+ #ifdef LED1_PININDEX
217
+ jshPinOutput (LED1_PININDEX , LED1_ONSTATE );
218
+ #endif
219
+ #ifdef LED2_PININDEX
220
+ jshPinOutput (LED2_PININDEX , LED2_ONSTATE );
221
+ #endif
222
+ #ifdef LED3_PININDEX
223
+ jshPinOutput (LED3_PININDEX , LED3_ONSTATE );
224
+ #endif
225
+ jsiConsolePrintf ("NRF ERROR 0x%x at %s:%d\n" , error_code , p_file_name ?p_file_name :"?" , line_num );
219
226
jsiConsolePrint ("REBOOTING.\n" );
220
227
jshTransmitFlush ();
228
+ jshDelayMicroseconds (1000000 );
221
229
NVIC_SystemReset ();
222
230
}
223
231
@@ -232,11 +240,15 @@ void ble_app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t
232
240
* @param[in] line_num Line number of the failing ASSERT call.
233
241
* @param[in] p_file_name File name of the failing ASSERT call.
234
242
*/
235
- void assert_nrf_callback (uint16_t line_num , const uint8_t * p_file_name )
236
- {
237
- ble_app_error_handler (DEAD_BEEF , line_num , p_file_name );
243
+ void assert_nrf_callback (uint16_t line_num , const uint8_t * p_file_name ) {
244
+ ble_app_error_handler (0xDEADBEEF , line_num , p_file_name );
245
+ }
246
+
247
+ void app_error_fault_handler (uint32_t id , uint32_t pc , uint32_t info ) {
248
+ ble_app_error_handler (id , pc , 0 );
238
249
}
239
250
251
+
240
252
#ifdef USE_BOOTLOADER
241
253
/**@brief Function for stopping advertising.
242
254
*/
0 commit comments