![](/media/cache/profiles/312e53ccba0b2ddfefd4a1f05b55bcdd.jpg.50x50_q85.jpg)
BLE FOTA APP
It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.
nRF51822/nordic/nrf-sdk/app_common/crc16.h@1:a607cd9655d7, 2014-10-10 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 1:a607cd9655d7 | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
yihui | 1:a607cd9655d7 | 2 | * |
yihui | 1:a607cd9655d7 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
yihui | 1:a607cd9655d7 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
yihui | 1:a607cd9655d7 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
yihui | 1:a607cd9655d7 | 6 | * |
yihui | 1:a607cd9655d7 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
yihui | 1:a607cd9655d7 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
yihui | 1:a607cd9655d7 | 9 | * the file. |
yihui | 1:a607cd9655d7 | 10 | * |
yihui | 1:a607cd9655d7 | 11 | */ |
yihui | 1:a607cd9655d7 | 12 | |
yihui | 1:a607cd9655d7 | 13 | /** @file |
yihui | 1:a607cd9655d7 | 14 | * |
yihui | 1:a607cd9655d7 | 15 | * @defgroup crc_compute CRC compute |
yihui | 1:a607cd9655d7 | 16 | * @{ |
yihui | 1:a607cd9655d7 | 17 | * @ingroup hci_transport |
yihui | 1:a607cd9655d7 | 18 | * |
yihui | 1:a607cd9655d7 | 19 | * @brief This module implements the CRC-16 calculation in the blocks. |
yihui | 1:a607cd9655d7 | 20 | */ |
yihui | 1:a607cd9655d7 | 21 | |
yihui | 1:a607cd9655d7 | 22 | #ifndef CRC16_H__ |
yihui | 1:a607cd9655d7 | 23 | #define CRC16_H__ |
yihui | 1:a607cd9655d7 | 24 | |
yihui | 1:a607cd9655d7 | 25 | #include <stdint.h> |
yihui | 1:a607cd9655d7 | 26 | |
yihui | 1:a607cd9655d7 | 27 | #ifdef __cplusplus |
yihui | 1:a607cd9655d7 | 28 | extern "C" { |
yihui | 1:a607cd9655d7 | 29 | #endif |
yihui | 1:a607cd9655d7 | 30 | |
yihui | 1:a607cd9655d7 | 31 | /**@brief Function for calculating CRC-16 in blocks. |
yihui | 1:a607cd9655d7 | 32 | * |
yihui | 1:a607cd9655d7 | 33 | * Feed each consecutive data block into this function, along with the current value of p_crc as |
yihui | 1:a607cd9655d7 | 34 | * returned by the previous call of this function. The first call of this function should pass NULL |
yihui | 1:a607cd9655d7 | 35 | * as the initial value of the crc in p_crc. |
yihui | 1:a607cd9655d7 | 36 | * |
yihui | 1:a607cd9655d7 | 37 | * @param[in] p_data The input data block for computation. |
yihui | 1:a607cd9655d7 | 38 | * @param[in] size The size of the input data block in bytes. |
yihui | 1:a607cd9655d7 | 39 | * @param[in] p_crc The previous calculated CRC-16 value or NULL if first call. |
yihui | 1:a607cd9655d7 | 40 | * |
yihui | 1:a607cd9655d7 | 41 | * @return The updated CRC-16 value, based on the input supplied. |
yihui | 1:a607cd9655d7 | 42 | */ |
yihui | 1:a607cd9655d7 | 43 | uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc); |
yihui | 1:a607cd9655d7 | 44 | |
yihui | 1:a607cd9655d7 | 45 | #ifdef __cplusplus |
yihui | 1:a607cd9655d7 | 46 | } |
yihui | 1:a607cd9655d7 | 47 | #endif |
yihui | 1:a607cd9655d7 | 48 | |
yihui | 1:a607cd9655d7 | 49 | |
yihui | 1:a607cd9655d7 | 50 | #endif // CRC16_H__ |
yihui | 1:a607cd9655d7 | 51 | |
yihui | 1:a607cd9655d7 | 52 | /** @} */ |