File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -495,15 +495,29 @@ void os_ThrowError(uint8_t error);
495
495
void * os_GetSystemStats (void );
496
496
497
497
/**
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
499
512
*
500
513
* @param routine Error handling routine
501
514
* @see os_PopErrorHandler
502
515
*/
503
- void os_PushErrorHandler (void * routine );
516
+ int os_PushErrorHandler (void );
504
517
505
518
/**
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.
507
521
*
508
522
* @see os_PushErrorHandler
509
523
*/
You can’t perform that action at this time.
0 commit comments