Reset#
Methods to reset from the bootloader to the app.
Functions#
Reset from the bootloader with a reset cause.
Set a reset reason.
Use the lower 4 bits of the reset cause signature to store a reset counter able to count up to 15 before wrapping around.
Clear and disable the reset counter.
Check whether the reset counter is enabled.
Increment the reset counter by one.
Get the reset counter value.
Get the reset reason without verifying it.
Invalidate the reset reason.
Classify reset and get the reset reason.
Function Documentation#
reset_resetWithReason#
void reset_resetWithReason (uint16_t resetReason)
Reset from the bootloader with a reset cause.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | resetReason | A reset reason as defined in the bootloader interface |
Note
This function does not return.
reset_setResetReason#
void reset_setResetReason (uint16_t resetReason)
Set a reset reason.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | resetReason | A reset reason as defined in the bootloader interface |
reset_enableResetCounter#
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
The value of the counter will be preserved across resets.
reset_disableResetCounter#
void reset_disableResetCounter (void )
Clear and disable the reset counter.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
reset_resetCounterEnabled#
bool reset_resetCounterEnabled (void )
Check whether the reset counter is enabled.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
True if reset counter is enabled, else false.
reset_incrementResetCounter#
void reset_incrementResetCounter (void )
Increment the reset counter by one.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Wraps around to 0 if the current counter value is equal to 15.
reset_getResetCounter#
uint8_t reset_getResetCounter (void )
Get the reset counter value.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Note
The reset counter has to be enabled for this value to be valid.
Returns
The reset counter value
reset_getResetReason#
uint16_t reset_getResetReason (void )
Get the reset reason without verifying it.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
The reset reason
reset_invalidateResetReason#
void reset_invalidateResetReason (void )
Invalidate the reset reason.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Note
This will also disable the reset counter if it is in use.
reset_classifyReset#
uint16_t reset_classifyReset (void )
Classify reset and get the reset reason.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
Reset cause or BOOTLOADER_RESET_REASON_UNKNOWN