BLE FOTA APP

Dependencies:   BLE_API mbed

It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.

Committer:
yihui
Date:
Fri Oct 10 03:36:28 2014 +0000
Revision:
1:a607cd9655d7
use NVIC_SystemReset() to run bootloader

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 1:a607cd9655d7 1 #ifndef __DEBUG_H_
yihui 1:a607cd9655d7 2 #define __DEBUG_H_
yihui 1:a607cd9655d7 3
yihui 1:a607cd9655d7 4 #include <stdint.h>
yihui 1:a607cd9655d7 5 #include <stdio.h>
yihui 1:a607cd9655d7 6
yihui 1:a607cd9655d7 7 /**
yihui 1:a607cd9655d7 8 * @defgroup app_trace Debug Logger
yihui 1:a607cd9655d7 9 * @ingroup app_common
yihui 1:a607cd9655d7 10 * @{
yihui 1:a607cd9655d7 11 * @brief Enables debug logs/ trace over UART.
yihui 1:a607cd9655d7 12 * @details Enables debug logs/ trace over UART. Tracing is enabled only if
yihui 1:a607cd9655d7 13 * ENABLE_DEBUG_LOG_SUPPORT is defined in the project.
yihui 1:a607cd9655d7 14 */
yihui 1:a607cd9655d7 15 #ifdef ENABLE_DEBUG_LOG_SUPPORT
yihui 1:a607cd9655d7 16 /**
yihui 1:a607cd9655d7 17 * @brief Module Initialization.
yihui 1:a607cd9655d7 18 *
yihui 1:a607cd9655d7 19 * @details Initializes the module to use UART as trace output.
yihui 1:a607cd9655d7 20 *
yihui 1:a607cd9655d7 21 * @warning This function will configure UART using default board configuration (described in @ref nrf51_setups).
yihui 1:a607cd9655d7 22 * Do not call this function if UART is configured from a higher level in the application.
yihui 1:a607cd9655d7 23 */
yihui 1:a607cd9655d7 24 void app_trace_init(void);
yihui 1:a607cd9655d7 25
yihui 1:a607cd9655d7 26 /**
yihui 1:a607cd9655d7 27 * @brief Log debug messages.
yihui 1:a607cd9655d7 28 *
yihui 1:a607cd9655d7 29 * @details This API logs messages over UART. The module must be initialized before using this API.
yihui 1:a607cd9655d7 30 *
yihui 1:a607cd9655d7 31 * @note Though this is currently a macro, it should be used used and treated as function.
yihui 1:a607cd9655d7 32 */
yihui 1:a607cd9655d7 33 #define app_trace_log printf
yihui 1:a607cd9655d7 34
yihui 1:a607cd9655d7 35 /**
yihui 1:a607cd9655d7 36 * @brief Dump auxiliary byte buffer to the debug trace.
yihui 1:a607cd9655d7 37 *
yihui 1:a607cd9655d7 38 * @details This API logs messages over UART. The module must be initialized before using this API.
yihui 1:a607cd9655d7 39 *
yihui 1:a607cd9655d7 40 * @param[in] p_buffer Buffer to be dumped on the debug trace.
yihui 1:a607cd9655d7 41 * @param[in] len Size of the buffer.
yihui 1:a607cd9655d7 42 */
yihui 1:a607cd9655d7 43 void app_trace_dump(uint8_t * p_buffer, uint32_t len);
yihui 1:a607cd9655d7 44
yihui 1:a607cd9655d7 45 #else // ENABLE_DEBUG_LOG_SUPPORT
yihui 1:a607cd9655d7 46
yihui 1:a607cd9655d7 47 #define app_trace_init(...)
yihui 1:a607cd9655d7 48 #define app_trace_log(...)
yihui 1:a607cd9655d7 49 #define app_trace_dump(...)
yihui 1:a607cd9655d7 50
yihui 1:a607cd9655d7 51 #endif // ENABLE_DEBUG_LOG_SUPPORT
yihui 1:a607cd9655d7 52
yihui 1:a607cd9655d7 53 /** @} */
yihui 1:a607cd9655d7 54
yihui 1:a607cd9655d7 55 #endif //__DEBUG_H_