13.5.3.3 APP_TIMER_SetTimer

C

uint16_t APP_TIMER_SetTimer(uint8_t timerId, uint32_t timeout, bool isPeriodicTimer);

Description

The function is used to set and start a timer.

Parameters

ParameterDescription
[in] timerIdTimer ID. See APP_TIMER_TimerId_T.
[in] timeoutTimeout value (unit: ms)
[in] isPeriodicTimerSet as true to let the timer expire repeatedly with a frequency set by the timeout parameter. Set as false to let the timer be a one-shot timer.

Return values

Return valueDescription
APP_RES_SUCCESSSet and start a timer successfully.
APP_RES_FAILFailed to start the timer.
APP_RES_OOMNo available memory.
APP_RES_NO_RESOURCEFailed to create a new timer.