aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-18 14:58:58 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-18 14:58:58 +0000
commit5597fabe0b53a7aa76c0c7052ab8edd460b0abfd (patch)
tree71183820771930517ed6b3981172c763697c625d /os
parent4d2101edd8200a6db20b69827b85554d3a45351c (diff)
downloadChibiOS-5597fabe0b53a7aa76c0c7052ab8edd460b0abfd.tar.gz
ChibiOS-5597fabe0b53a7aa76c0c7052ab8edd460b0abfd.tar.bz2
ChibiOS-5597fabe0b53a7aa76c0c7052ab8edd460b0abfd.zip
CPP wrapper. In mailbox class added methods getFreeCountI() and getUsedCountI()
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5594 35acf78f-673a-0410-8e92-d51de3d6d3f4
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);
};
/*------------------------------------------------------------------------*