mirror of
https://github.com/espressif/openthread.git
synced 2026-07-22 12:04:06 +00:00
[timer] multiple microseconds timer support (#1962)
* [timer] multiple microseconds timer support * Remove TimerSchedulerLocator, Timer inherit from Ip6Locator instead to get TimerScheduler. * Add separate UsecTimer and UsecTimerScheduler for multiple microseconds timer support. * [timer] refine Timer names * Rename alarm header files to alarm-milli.h and alarm-micro.h * Rename alarm APIs to start with otPlatAlarmMilli and otPlatAlarmMicro * Rename Timer classes to TimerMilli/TimerMilliScheduler and TimerMicro/TimerMicroScheduler * [Timer] Refactor Timer code structure * Create TimerBase and TimerSchedulerBase class for common functions; * Use TimerMilli/TimerMicro and TimerMilliScheduler/TimerMicroScheduler for different functions; * Define AlarmApi, so then TimerMilliScheduler/TimerMicroScheduler could use different AlarmApi.
This commit is contained in:
+3
-3
@@ -243,7 +243,7 @@ Interpreter::Interpreter(otInstance *aInstance):
|
||||
mLength(8),
|
||||
mCount(1),
|
||||
mInterval(1000),
|
||||
mPingTimer(aInstance->mIp6.mTimerScheduler, &Interpreter::s_HandlePingTimer, this),
|
||||
mPingTimer(aInstance->mIp6, &Interpreter::s_HandlePingTimer, this),
|
||||
#if OPENTHREAD_ENABLE_DNS_CLIENT
|
||||
mResolvingInProgress(0),
|
||||
#endif
|
||||
@@ -1607,7 +1607,7 @@ void Interpreter::HandleIcmpReceive(Message &aMessage, const Ip6::MessageInfo &a
|
||||
if (aMessage.Read(aMessage.GetOffset(), sizeof(uint32_t), ×tamp) >=
|
||||
static_cast<int>(sizeof(uint32_t)))
|
||||
{
|
||||
mServer->OutputFormat(" time=%dms", Timer::GetNow() - HostSwap32(timestamp));
|
||||
mServer->OutputFormat(" time=%dms", TimerMilli::GetNow() - HostSwap32(timestamp));
|
||||
}
|
||||
|
||||
mServer->OutputFormat("\r\n");
|
||||
@@ -1690,7 +1690,7 @@ void Interpreter::s_HandlePingTimer(Timer &aTimer)
|
||||
void Interpreter::HandlePingTimer()
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint32_t timestamp = HostSwap32(Timer::GetNow());
|
||||
uint32_t timestamp = HostSwap32(TimerMilli::GetNow());
|
||||
|
||||
otMessage *message;
|
||||
const otMessageInfo *messageInfo = static_cast<const otMessageInfo *>(&mMessageInfo);
|
||||
|
||||
Reference in New Issue
Block a user