[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:
Shu Chen
2017-07-10 16:01:27 -07:00
committed by Jonathan Hui
parent 529c291f7a
commit 129c419107
104 changed files with 775 additions and 614 deletions
+5 -5
View File
@@ -36,7 +36,7 @@
#include "alarm.tmh"
uint32_t
otPlatAlarmGetNow()
otPlatAlarmMilliGetNow()
{
// Return number of 'ticks'
LARGE_INTEGER PerformanceCounter = KeQueryPerformanceCounter(NULL);
@@ -46,22 +46,22 @@ otPlatAlarmGetNow()
}
void
otPlatAlarmStop(
otPlatAlarmMilliStop(
_In_ otInstance *otCtx
)
{
LogVerbose(DRIVER_DEFAULT, "otPlatAlarmStop");
LogVerbose(DRIVER_DEFAULT, "otPlatAlarmMilliStop");
otLwfEventProcessingIndicateNewWaitTime(otCtxToFilter(otCtx), (ULONG)(-1));
}
void
otPlatAlarmStartAt(
otPlatAlarmMilliStartAt(
_In_ otInstance *otCtx,
uint32_t now,
uint32_t waitTime
)
{
UNREFERENCED_PARAMETER(now);
LogVerbose(DRIVER_DEFAULT, "otPlatAlarmStartAt %u ms", waitTime);
LogVerbose(DRIVER_DEFAULT, "otPlatAlarmMilliStartAt %u ms", waitTime);
otLwfEventProcessingIndicateNewWaitTime(otCtxToFilter(otCtx), waitTime);
}
@@ -863,7 +863,7 @@ otLwfEventWorkerThread(
pFilter->EventTimerState = OT_EVENT_TIMER_NOT_RUNNING;
// Indicate to OpenThread that the alarm has fired
otPlatAlarmFired(pFilter->otCtx);
otPlatAlarmMilliFired(pFilter->otCtx);
}
else if (status == STATUS_WAIT_0 + 1) // EventWorkerThreadProcessNBLs fired
{
+1 -1
View File
@@ -77,7 +77,7 @@ RtlCopyBufferToMdl(
#include <openthread/platform/logging-windows.h>
#include <openthread/platform/radio.h>
#include <openthread/platform/misc.h>
#include <openthread/platform/alarm.h>
#include <openthread/platform/alarm-milli.h>
#include <openthread/platform/settings.h>
#include <openthread/platform/messagepool.h>
#include <ncp/spinel.h>