Description

Methods to reset from the bootloader to the app.

Functions

void reset_resetWithReason (uint16_t resetReason)
void reset_setResetReason (uint16_t resetReason)
void reset_enableResetCounter (void)
void reset_disableResetCounter (void)
bool reset_resetCounterEnabled (void)
void reset_incrementResetCounter (void)
uint8_t reset_getResetCounter (void)
uint16_t reset_getResetReason (void)
void reset_invalidateResetReason (void)
uint16_t reset_classifyReset (void)

Function Documentation

void reset_resetWithReason ( uint16_t resetReason )

Reset from the bootloader with a reset cause.

Note
This function does not return.
Parameters
resetReason A reset reason as defined in the bootloader interface
void reset_setResetReason ( uint16_t resetReason )

Set a reset reason.

Parameters
resetReason A reset reason as defined in the bootloader interface
void reset_enableResetCounter ( void )

Use the lower 4 bits of the reset cause signature to store a reset counter able to count up to 15 before wrapping around. The value of the counter will be preserved across resets.

void reset_disableResetCounter ( void )

Clear and disable the reset counter.

bool reset_resetCounterEnabled ( void )

Check if the reset counter is enabled.

Returns
True if reset counter is enabled, else false.
void reset_incrementResetCounter ( void )

Increment the reset counter by one.

Wraps around to 0 if the current counter value is equal to 15.

uint8_t reset_getResetCounter ( void )

Get the reset counter value.

Note
The reset counter has to be enabled for this value to be valid.
Returns
The reset counter value
uint16_t reset_getResetReason ( void )

Get the reset reason without verifying it.

Returns
The reset reason
void reset_invalidateResetReason ( void )

Invalidate the reset reason.

Note
This will also disable the reset counter if it is in use.
uint16_t reset_classifyReset ( void )

Classify reset and get the reset reason.

Returns
Reset cause or BOOTLOADER_RESET_REASON_UNKNOWN