Jelajahi Sumber

tests: Make sure ticks functions return an increasing number.

Signed-off-by: Damien George <dpgeorge@georgerobotics.com.au>
Damien George 2 tahun lalu
induk
melakukan
e9049f61ec
2 mengubah file dengan 8 tambahan dan 4 penghapusan
  1. 4 2
      tests/debug_print/cyw43_configport.h
  2. 4 2
      tests/sdio/cyw43_configport.h

+ 4 - 2
tests/debug_print/cyw43_configport.h

@@ -40,11 +40,13 @@
 #define CYW43_HAL_MAC_WLAN0                 (0)
 
 static inline unsigned int cyw43_hal_ticks_us(void) {
-    return 0;
+    static unsigned int t = 0;
+    return t++;
 }
 
 static inline unsigned int cyw43_hal_ticks_ms(void) {
-    return 0;
+    static unsigned int t = 0;
+    return t++;
 }
 
 static inline void cyw43_delay_us(unsigned int us) {

+ 4 - 2
tests/sdio/cyw43_configport.h

@@ -33,11 +33,13 @@
 #define CYW43_HAL_MAC_WLAN0                 (0)
 
 static inline unsigned int cyw43_hal_ticks_us(void) {
-    return 0;
+    static unsigned int t = 0;
+    return t++;
 }
 
 static inline unsigned int cyw43_hal_ticks_ms(void) {
-    return 0;
+    static unsigned int t = 0;
+    return t++;
 }
 
 static inline void cyw43_delay_us(unsigned int us) {