Skip to content

Commit 8b05510

Browse files
committed
Fixed error handler function documentation.
1 parent 5260d10 commit 8b05510

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/ce/tice.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,15 +495,29 @@ void os_ThrowError(uint8_t error);
495495
void *os_GetSystemStats(void);
496496

497497
/**
498-
* Sets up the defualt error handlers if an OS routine encounters an error when running
498+
* This function can return twice (like setjmp).
499+
* First return always happens with a return value of 0.
500+
* Second return only happens if an error occurs before os_PopErrorHandler is called,
501+
* with the errNo as the return value.
502+
*
503+
* @code
504+
* int errno = os_PushErrorHandler();
505+
* if (errno) {
506+
* // handle error, but do not call os_PopErrorHandler()
507+
* } else {
508+
* // run some code that may error
509+
* os_PopErrorHandler();
510+
* }
511+
* @endcode
499512
*
500513
* @param routine Error handling routine
501514
* @see os_PopErrorHandler
502515
*/
503-
void os_PushErrorHandler(void *routine);
516+
int os_PushErrorHandler(void);
504517

505518
/**
506-
* Restores state after a call to os_PushErrorHandler
519+
* Restores state after a call to os_PushErrorHandler, but should not be called along the error
520+
* path, and restores stack and ix to their state before the call to os_PushErrorHandler.
507521
*
508522
* @see os_PushErrorHandler
509523
*/

0 commit comments

Comments
 (0)