aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/various/cpp_wrappers/ch.cpp10
-rw-r--r--os/various/cpp_wrappers/ch.hpp26
2 files changed, 36 insertions, 0 deletions
diff --git a/os/various/cpp_wrappers/ch.cpp b/os/various/cpp_wrappers/ch.cpp
index ea27eddb1..e6d7442c8 100644
--- a/os/various/cpp_wrappers/ch.cpp
+++ b/os/various/cpp_wrappers/ch.cpp
@@ -812,6 +812,16 @@ namespace chibios_rt {
return chMBFetchI(&mb, msgp);
}
+
+ cnt_t Mailbox::getFreeCountI(void) {
+
+ return chMBGetFreeCountI(&mb);
+ }
+
+ cnt_t Mailbox::getUsedCountI(void) {
+
+ return chMBGetUsedCountI(&mb);
+ }
#endif /* CH_USE_MAILBOXES */
#if CH_USE_MEMPOOLS
diff --git a/os/various/cpp_wrappers/ch.hpp b/os/various/cpp_wrappers/ch.hpp
index c60572de9..ac17b2659 100644
--- a/os/various/cpp_wrappers/ch.hpp
+++ b/os/various/cpp_wrappers/ch.hpp
@@ -2019,6 +2019,32 @@ namespace chibios_rt {
* @iclass
*/
msg_t fetchI(msg_t *msgp);
+
+ /**
+ * @brief Returns the number of free message slots into a mailbox.
+ * @note Can be invoked in any system state but if invoked out of a
+ * locked state then the returned value may change after reading.
+ * @note The returned value can be less than zero when there are waiting
+ * threads on the internal semaphore.
+ *
+ * @return The number of empty message slots.
+ *
+ * @iclass
+ */
+ cnt_t getFreeCountI(void);
+
+ /**
+ * @brief Returns the number of used message slots into a mailbox.
+ * @note Can be invoked in any system state but if invoked out of a
+ * locked state then the returned value may change after reading.
+ * @note The returned value can be less than zero when there are waiting
+ * threads on the internal semaphore.
+ *
+ * @return The number of queued messages.
+ *
+ * @iclass
+ */
+ cnt_t getUsedCountI(void);
};
/*------------------------------------------------------------------------*