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.
SystemTimer.cpp
00001 #include <Misc/SystemTimer.h> 00002 00003 00004 SystemTimer::SystemTimer(){ 00005 00006 systemUptimeMillis = 0; 00007 00008 systemTicker.attach_us(this,&SystemTimer::systemTickerHandler,1000); 00009 00010 } 00011 00012 void SystemTimer::systemTickerHandler(){ 00013 00014 systemUptimeMillis++; 00015 00016 } 00017 00018 00019 uint64_t SystemTimer::getUptimeMillis(){ 00020 return systemUptimeMillis; 00021 } 00022 00023 00024 bool SystemTimer::isTimeoutPassed(uint64_t *timestampMillis, uint32_t timeoutMillis){ 00025 00026 if((systemUptimeMillis - *timestampMillis) > timeoutMillis){ 00027 *timestampMillis = systemUptimeMillis; 00028 return true; 00029 }else{ 00030 return false; 00031 } 00032 00033 }
Generated on Thu Jul 28 2022 08:08:43 by
1.7.2