iOSのBLEコントローラアプリ「RCBController」と接続し、コントローラの操作を取得するサンプルプログラムです。 mbed HRM1017で動作を確認しています。 2014.08.20時点でのBLEライブラリに対応しました。
Fork of BLE_RCBController by
HRM1017/nordic/ble/ble_debug_assert_handler.cpp@4:ebda47d22091, 2014-08-20 (annotated)
- Committer:
- jksoft
- Date:
- Wed Aug 20 13:41:01 2014 +0000
- Revision:
- 4:ebda47d22091
- Parent:
- nRF51822/nordic/ble/ble_debug_assert_handler.cpp@1:48f6e08a3ac2
?????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8c643bfe55b7 | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
jksoft | 0:8c643bfe55b7 | 2 | * |
jksoft | 0:8c643bfe55b7 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 0:8c643bfe55b7 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 0:8c643bfe55b7 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 0:8c643bfe55b7 | 6 | * |
jksoft | 0:8c643bfe55b7 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 0:8c643bfe55b7 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 0:8c643bfe55b7 | 9 | * the file. |
jksoft | 0:8c643bfe55b7 | 10 | * |
jksoft | 0:8c643bfe55b7 | 11 | */ |
jksoft | 0:8c643bfe55b7 | 12 | |
jksoft | 0:8c643bfe55b7 | 13 | #include "ble_debug_assert_handler.h" |
jksoft | 0:8c643bfe55b7 | 14 | #include <string.h> |
jksoft | 0:8c643bfe55b7 | 15 | #include "nrf51.h" |
jksoft | 0:8c643bfe55b7 | 16 | #include "ble_error_log.h" |
jksoft | 0:8c643bfe55b7 | 17 | #include "nordic_common.h" |
jksoft | 0:8c643bfe55b7 | 18 | |
jksoft | 0:8c643bfe55b7 | 19 | #define MAX_LENGTH_FILENAME 128 /**< Max length of filename to copy for the debug error handlier. */ |
jksoft | 0:8c643bfe55b7 | 20 | |
jksoft | 0:8c643bfe55b7 | 21 | |
jksoft | 0:8c643bfe55b7 | 22 | // WARNING - DO NOT USE THIS FUNCTION IN END PRODUCT. - WARNING |
jksoft | 0:8c643bfe55b7 | 23 | // WARNING - FOR DEBUG PURPOSES ONLY. - WARNING |
jksoft | 0:8c643bfe55b7 | 24 | void ble_debug_assert_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name) |
jksoft | 0:8c643bfe55b7 | 25 | { |
jksoft | 0:8c643bfe55b7 | 26 | // Copying parameters to static variables because parameters may not be accessible in debugger. |
jksoft | 0:8c643bfe55b7 | 27 | static volatile uint8_t s_file_name[MAX_LENGTH_FILENAME]; |
jksoft | 0:8c643bfe55b7 | 28 | static volatile uint16_t s_line_num; |
jksoft | 0:8c643bfe55b7 | 29 | static volatile uint32_t s_error_code; |
jksoft | 0:8c643bfe55b7 | 30 | |
jksoft | 0:8c643bfe55b7 | 31 | strncpy((char *)s_file_name, (const char *)p_file_name, MAX_LENGTH_FILENAME - 1); |
jksoft | 0:8c643bfe55b7 | 32 | s_file_name[MAX_LENGTH_FILENAME - 1] = '\0'; |
jksoft | 0:8c643bfe55b7 | 33 | s_line_num = line_num; |
jksoft | 0:8c643bfe55b7 | 34 | s_error_code = error_code; |
jksoft | 0:8c643bfe55b7 | 35 | UNUSED_VARIABLE(s_file_name); |
jksoft | 0:8c643bfe55b7 | 36 | UNUSED_VARIABLE(s_line_num); |
jksoft | 0:8c643bfe55b7 | 37 | UNUSED_VARIABLE(s_error_code); |
jksoft | 0:8c643bfe55b7 | 38 | |
jksoft | 0:8c643bfe55b7 | 39 | // WARNING: The PRIMASK register is set to disable ALL interrups during writing the error log. |
jksoft | 0:8c643bfe55b7 | 40 | // |
jksoft | 0:8c643bfe55b7 | 41 | // Do not use __disable_irq() in normal operation. |
jksoft | 0:8c643bfe55b7 | 42 | __disable_irq(); |
jksoft | 0:8c643bfe55b7 | 43 | |
jksoft | 0:8c643bfe55b7 | 44 | // This function will write error code, filename, and line number to the flash. |
jksoft | 0:8c643bfe55b7 | 45 | // In addition, the Cortex-M0 stack memory will also be written to the flash. |
jksoft | 0:8c643bfe55b7 | 46 | //(void) ble_error_log_write(error_code, p_file_name, line_num); |
jksoft | 0:8c643bfe55b7 | 47 | |
jksoft | 0:8c643bfe55b7 | 48 | // For debug purposes, this function never returns. |
jksoft | 0:8c643bfe55b7 | 49 | // Attach a debugger for tracing the error cause. |
jksoft | 0:8c643bfe55b7 | 50 | for (;;) |
jksoft | 0:8c643bfe55b7 | 51 | { |
jksoft | 0:8c643bfe55b7 | 52 | // Do nothing. |
jksoft | 0:8c643bfe55b7 | 53 | } |
jksoft | 0:8c643bfe55b7 | 54 | } |
jksoft | 0:8c643bfe55b7 | 55 |