diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/chsys.c | 10 | ||||
-rw-r--r-- | src/include/sys.h | 19 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/chsys.c b/src/chsys.c index 21fbe1048..347b75da3 100644 --- a/src/chsys.c +++ b/src/chsys.c @@ -94,16 +94,6 @@ void chSysTimerHandlerI(void) { chVTDoTickI(); } -/** - * Abonormal system termination handler. Invoked by the ChibiOS/RT when an - * abnormal unrecoverable condition is met. - */ -void chSysHalt(void) { - - chSysDisable(); - sys_halt(); -} - #if !defined(CH_OPTIMIZE_SPEED) /** * Enters the ChibiOS/RT system mutual exclusion zone. diff --git a/src/include/sys.h b/src/include/sys.h index 6c6b65704..cf7cf78a4 100644 --- a/src/include/sys.h +++ b/src/include/sys.h @@ -32,6 +32,12 @@ #define chSysPuts(msg) sys_puts(msg)
/**
+ * Abonormal system termination handler. Invoked by the ChibiOS/RT when an
+ * abnormal unrecoverable condition is met.
+ */
+#define chSysHalt() sys_halt()
+
+/**
* Performs a context switch.
* This is the most critical code in any port, this function is responsible
* for the context switch between 2 threads.
@@ -52,8 +58,8 @@ #define chSysEnable() sys_enable()
/**
- * Raises the system interrupt priority mask to system level. - * @note The implementation is architecture dependent, it may just enable the
+ * Raises the system interrupt priority mask to system level.
+ * @note The implementation is architecture dependent, it may just disable the
* interrupts.
* @note This API should only be invoked from the main thread in order to stop
* ChibiOS/RT, hardware de/re-initialization should follow. It would then
@@ -63,6 +69,14 @@ #define chSysDisable() sys_disable()
/**
+ * Raises the system interrupt priority mask to the maximum level thus disabling
+ * any mask-able interrupt source..
+ * @note The implementation is architecture dependent, it may just disable the
+ * interrupts or be exactly equivalent to @p chSysDisable().
+ */
+#define chSysDisableAll() sys_disable_all()
+
+/**
* Enters the ChibiOS/RT system mutual exclusion zone from within an interrupt
* handler.
* @note This API may do nothing on some architectures, it is required because
@@ -161,7 +175,6 @@ extern "C" { #endif
void chSysInit(void);
void chSysTimerHandlerI(void);
- void chSysHalt(void);
#if !defined(CH_OPTIMIZE_SPEED)
void chSysLock(void);
void chSysUnlock(void);
|