Bootloader project main file.
More...
|
void | app_error_handler (uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name) |
| Function for error handling, which is called when an error has occurred. More...
|
|
void | assert_nrf_callback (uint16_t line_num, const uint8_t *p_file_name) |
| Callback function for asserts in the SoftDevice. More...
|
|
static void | leds_init (void) |
| Function for initialization of LEDs. More...
|
|
static void | leds_off (void) |
| Function for clearing the LEDs. More...
|
|
static void | gpiote_init (void) |
| Function for initializing the GPIOTE handler module.
|
|
static void | timers_init (void) |
| Function for the Timer initialization. More...
|
|
static void | buttons_init (void) |
| Function for initializing the button module.
|
|
int | main (void) |
| Function for application main entry.
|
|
- Receive start data package.
- Based on start packet, prepare NVM area to store received data.
- Receive data packet.
- Validate data packet.
- Write Data packet to NVM.
- If not finished - Wait for next packet.
- Receive stop data packet.
- Activate Image, boot application.
#define BOOTLOADER_BUTTON_PIN BUTTON7 |
Button used to enter SW update mode.
#define APP_GPIOTE_MAX_USERS 2 |
Number of GPIOTE users in total. Used by button module and dfu_transport_serial module (flow control).
#define APP_TIMER_PRESCALER 0 |
Value of the RTC1 PRESCALER register.
#define APP_TIMER_MAX_TIMERS 3 |
Maximum number of simultaneously created timers.
#define APP_TIMER_OP_QUEUE_SIZE 4 |
Size of timer operation queues.
Delay from a GPIOTE event until a button is reported as pushed (in number of timer ticks).
void app_error_handler |
( |
uint32_t |
error_code, |
|
|
uint32_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
- Warning
- This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of error.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the handler is called. |
[in] | p_file_name | Pointer to the file name. |
void assert_nrf_callback |
( |
uint16_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
This function will be called in case of an assert in the SoftDevice.
- Warning
- This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of Assert.
-
On assert from the SoftDevice, the system can only recover on reset.
- Parameters
-
[in] | line_num | Line number of the failing ASSERT call. |
[in] | file_name | File name of the failing ASSERT call. |
static void leds_init |
( |
void |
| ) |
|
|
static |
Initializes all LEDs used by the application.
static void leds_off |
( |
void |
| ) |
|
|
static |
Clears all LEDs used by the application.
static void timers_init |
( |
void |
| ) |
|
|
static |
Initializes the timer module.