diff options
Diffstat (limited to 'os/rt/ports/SIMIA32/chcore.c')
-rw-r--r-- | os/rt/ports/SIMIA32/chcore.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/os/rt/ports/SIMIA32/chcore.c b/os/rt/ports/SIMIA32/chcore.c index a2dbbbe71..92d0fed7f 100644 --- a/os/rt/ports/SIMIA32/chcore.c +++ b/os/rt/ports/SIMIA32/chcore.c @@ -25,6 +25,8 @@ * @{
*/
+#include <windows.h>
+
#include "ch.h"
/*===========================================================================*/
@@ -35,6 +37,9 @@ /* Module exported variables. */
/*===========================================================================*/
+bool port_isr_context_flag;
+syssts_t port_irq_sts;
+
/*===========================================================================*/
/* Module local types. */
/*===========================================================================*/
@@ -98,4 +103,18 @@ void _port_thread_start(msg_t (*pf)(void *), void *p) { while(1);
}
+
+/**
+ * @brief Returns the current value of the realtime counter.
+ *
+ * @return The realtime counter value.
+ */
+rtcnt_t port_rt_get_counter_value(void) {
+ LARGE_INTEGER n;
+
+ QueryPerformanceCounter(&n);
+
+ return (rtcnt_t)(n.QuadPart / 1000LL);
+}
+
/** @} */
|