Jelajahi Sumber

Implement function to get current date

Date wit number of milliseconds
DricomDragon 5 tahun lalu
induk
melakukan
91d123b402
2 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 4 0
      prog/sources/time.cpp
  2. 2 0
      prog/sources/time.h

+ 4 - 0
prog/sources/time.cpp

@@ -34,3 +34,7 @@ void busyWaitUntil (USER_MODE_ const uint32_t inDeadLineMS) {
 void systickInterruptServiceRoutine (SECTION_MODE) {
 	gUptime += 1;
 }
+
+uint32_t millis(ANY_MODE) {
+	return gUptime;
+}

+ 2 - 0
prog/sources/time.h

@@ -12,3 +12,5 @@ void busyWaitUntil (USER_MODE_ const uint32_t inDeadLineMS);
 //$interrupt-section SysTick
 
 void systickInterruptServiceRoutine (SECTION_MODE) asm ("interrupt.section.SysTick");
+
+uint32_t millis(ANY_MODE);