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
TypeDirectionArgument NameDescription
uint16_tN/AresetReason

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.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AresetReason

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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

The value of the counter will be preserved across resets.


reset_disableResetCounter#

void reset_disableResetCounter (void )

Clear and disable the reset counter.

Parameters
TypeDirectionArgument NameDescription
voidN/A

reset_resetCounterEnabled#

bool reset_resetCounterEnabled (void )

Check whether the reset counter is enabled.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • True if reset counter is enabled, else false.


reset_incrementResetCounter#

void reset_incrementResetCounter (void )

Increment the reset counter by one.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • The reset reason


reset_invalidateResetReason#

void reset_invalidateResetReason (void )

Invalidate the reset reason.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns