![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
For test
time.cpp
- Committer:
- shennongmin
- Date:
- 2015-02-05
- Revision:
- 35:90be2bc2a492
- Parent:
- 10:9d4ec0359a5c
File content as of revision 35:90be2bc2a492:
#include "time.h" static unsigned long one_millisecond_counter = 0; static void one_millisecond_callback(void) { one_millisecond_counter++; } unsigned long millis(void) { static Ticker milli_timer; static bool attach_flag = true; if (attach_flag) { attach_flag = false; milli_timer.attach_us(&one_millisecond_callback, 1000); } return one_millisecond_counter; } void delay(int t) { wait_ms(t); }