aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/chcore.c24
-rw-r--r--src/templates/chcore.h24
-rw-r--r--src/templates/chtypes.h39
3 files changed, 55 insertions, 32 deletions
diff --git a/src/templates/chcore.c b/src/templates/chcore.c
index 2aaa0b06a..95427c161 100644
--- a/src/templates/chcore.c
+++ b/src/templates/chcore.c
@@ -55,6 +55,30 @@ void chSysHalt(void) {
}
/**
+ * Enters the ChibiOS/RT system mutual exclusion zone. The implementation is
+ * architecture dependent, on single core systems usually this function usually
+ * just disables the interrupts.
+ * @note The code in the system mutual exclusion zone must be as light and
+ * fast as possible, the system performance is affected by this.
+ * @note The use of system mutual exclusion zones are not recommended in
+ * the user code, it is a better idea to use the Semaphores instead.
+ */
+void chSysLock(void) {
+}
+
+/**
+ * Leaves the ChibiOS/RT system mutual exclusion zone. The implementation is
+ * architecture dependent, on single core systems usually this function usually
+ * just enables the interrupts.
+ * @note The code in the system mutual exclusion zone must be as light and
+ * fast as possible, the system performance is affected by this.
+ * @note The use of system mutual exclusion zones are not recommended in
+ * the user code, it is a better idea to use the Semaphores instead.
+ */
+void chSysUnlock(void) {
+}
+
+/**
* Context switch.
*/
void chSysSwitchI(Thread *otp, Thread *ntp) {}
diff --git a/src/templates/chcore.h b/src/templates/chcore.h
index c84a237f8..1be2d7145 100644
--- a/src/templates/chcore.h
+++ b/src/templates/chcore.h
@@ -84,28 +84,6 @@ typedef struct {
#define WorkingArea(s, n) uint8_t s[UserStackSize(n)];
/**
- * Enters the ChibiOS/RT system mutual exclusion zone, the implementation is
- * architecture dependent, on single core systems usually this function
- * just disables the interrupts.
- * @note The code in the system mutual exclusion zone must be as light and
- * fast as possible, the system performance is affected by this.
- * @note The use of system mutual exclusion zones are not recommended in
- * the user code, it is a better idea to use the Semaphores instead.
- */
-#define chSysLock()
-
-/**
- * Leaves the ChibiOS/RT system mutual exclusion zone, the implementation is
- * architecture dependent, on single core systems usually this function
- * just enables the interrupts.
- * @note The code in the system mutual exclusion zone must be as light and
- * fast as possible, the system performance is affected by this.
- * @note The use of system mutual exclusion zones are not recommended in
- * the user code, it is a better idea to use the Semaphores instead.
- */
-#define chSysUnlock()
-
-/**
* Enables the interrupts, it is only invoked once into \p chSysInit().
*/
#define chSysEnable()
@@ -130,6 +108,8 @@ extern "C" {
#endif
void _IdleThread(void *p);
void chSysHalt(void);
+ void chSysLock(void);
+ void chSysUnlock(void);
void chSysSwitchI(Thread *otp, Thread *ntp);
void chSysPuts(char *msg);
#ifdef __cplusplus
diff --git a/src/templates/chtypes.h b/src/templates/chtypes.h
index 6c51687ad..92b5dc443 100644
--- a/src/templates/chtypes.h
+++ b/src/templates/chtypes.h
@@ -33,16 +33,35 @@
#include <stdint.h>
#endif
-typedef int32_t bool_t; /* Signed boolean. */
-typedef uint8_t tmode_t; /* Thread mode flags, uint8_t is ok. */
-typedef uint8_t tstate_t; /* Thread state, uint8_t is ok. */
-typedef uint16_t tid_t; /* Thread id. */
-typedef uint32_t tprio_t; /* Priority, use the fastest unsigned type. */
-typedef int32_t msg_t; /* Message, use signed pointer equivalent.*/
-typedef int32_t eventid_t; /* Event Id, use fastest signed.*/
-typedef uint32_t eventmask_t;/* Event Mask, recommended fastest unsigned.*/
-typedef uint32_t systime_t; /* System Time, recommended fastest unsigned.*/
-typedef int32_t cnt_t; /* Counter, recommended fastest signed.*/
+/** Signed boolean. */
+typedef int32_t bool_t;
+
+/** Thread mode flags, uint8_t is ok. */
+typedef uint8_t tmode_t;
+
+/** Thread state, uint8_t is ok. */
+typedef uint8_t tstate_t;
+
+/** Thread id. */
+typedef uint16_t tid_t;
+
+/** Priority, use the fastest unsigned type. */
+typedef uint32_t tprio_t;
+
+/** Message, use signed pointer equivalent.*/
+typedef int32_t msg_t;
+
+/** Event Id, use fastest signed.*/
+typedef int32_t eventid_t;
+
+/** Event Mask, recommended fastest unsigned.*/
+typedef uint32_t eventmask_t;
+
+/** System Time, recommended fastest unsigned.*/
+typedef uint32_t systime_t;
+
+/** Counter, recommended fastest signed.*/
+typedef int32_t cnt_t;
#define INLINE inline
#define PACK_STRUCT_STRUCT __attribute__((packed))