Reset#

Methods to reset from the bootloader to the app.

Functions#

void
reset_resetWithReason(uint16_t resetReason)

Reset from the bootloader with a reset cause.

void
reset_setResetReason(uint16_t resetReason)

Set a reset reason.

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.

void

Clear and disable the reset counter.

bool

Check whether the reset counter is enabled.

void

Increment the reset counter by one.

uint8_t

Get the reset counter value.

uint16_t

Get the reset reason without verifying it.

void

Invalidate the reset reason.

uint16_t

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.

Parameters
N/AresetReason

A reset reason as defined in the bootloader interface

Note

  • This function does not return.


Definition at line 43 of file platform/bootloader/core/btl_reset.h

reset_setResetReason#

void reset_setResetReason (uint16_t resetReason)

Set a reset reason.

Parameters
N/AresetReason

A reset reason as defined in the bootloader interface


Definition at line 51 of file platform/bootloader/core/btl_reset.h

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.

Parameters
N/A

The value of the counter will be preserved across resets.


Definition at line 58 of file platform/bootloader/core/btl_reset.h

reset_disableResetCounter#

void reset_disableResetCounter (void )

Clear and disable the reset counter.

Parameters
N/A

Definition at line 63 of file platform/bootloader/core/btl_reset.h

reset_resetCounterEnabled#

bool reset_resetCounterEnabled (void )

Check whether the reset counter is enabled.

Parameters
N/A

Returns

  • True if reset counter is enabled, else false.


Definition at line 70 of file platform/bootloader/core/btl_reset.h

reset_incrementResetCounter#

void reset_incrementResetCounter (void )

Increment the reset counter by one.

Parameters
N/A

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


Definition at line 77 of file platform/bootloader/core/btl_reset.h

reset_getResetCounter#

uint8_t reset_getResetCounter (void )

Get the reset counter value.

Parameters
N/A

Note

  • The reset counter has to be enabled for this value to be valid.

Returns

  • The reset counter value


Definition at line 86 of file platform/bootloader/core/btl_reset.h

reset_getResetReason#

uint16_t reset_getResetReason (void )

Get the reset reason without verifying it.

Parameters
N/A

Returns

  • The reset reason


Definition at line 93 of file platform/bootloader/core/btl_reset.h

reset_invalidateResetReason#

void reset_invalidateResetReason (void )

Invalidate the reset reason.

Parameters
N/A

Note

  • This will also disable the reset counter if it is in use.


Definition at line 100 of file platform/bootloader/core/btl_reset.h

reset_classifyReset#

uint16_t reset_classifyReset (void )

Classify reset and get the reset reason.

Parameters
N/A

Returns


Definition at line 107 of file platform/bootloader/core/btl_reset.h