Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: millis.cpp
- Revision:
- 0:7b4f46b34f01
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/millis.cpp Wed Nov 14 01:03:45 2018 +0000
@@ -0,0 +1,21 @@
+/*
+ * @author: Natasha Sarkar, 2018
+ */
+
+#include "mbed.h"
+#include "millis.h"
+
+volatile unsigned long _millis;
+
+void millis_begin(void) {
+ SysTick_Config(SystemCoreClock / 1000);
+}
+
+extern "C" void SysTick_Handler(void) {
+ _millis++;
+}
+
+unsigned long millis(void) {
+ return _millis;
+}
+