Skip to content

Commit 4d4089e

Browse files
authored
[RTOS] Added deprecated RtosTimer constructor
Reintroduced the original RtosTimer constructor as an additional deprecated constructor for backwards compatibility.
1 parent 511117a commit 4d4089e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rtos/rtos/RtosTimer.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ namespace rtos {
3737
*/
3838
class RtosTimer {
3939
public:
40+
/** Create timer.
41+
@param func function to be executed by this timer.
42+
@param type osTimerOnce for one-shot or osTimerPeriodic for periodic behaviour. (default: osTimerPeriodic)
43+
@param argument argument to the timer call back function. (default: NULL)
44+
@deprecated Replaced with RtosTimer(Callback<void()>, os_timer_type)
45+
*/
46+
MBED_DEPRECATED("Replaced with RtosTimer(Callback<void()>, os_timer_type)")
47+
RtosTimer(void (*func)(void const *argument), os_timer_type type=osTimerPeriodic, void *argument=NULL) {
48+
constructor(mbed::Callback<void()>(argument, (void (*)(void *))func), type);
49+
}
50+
4051
/** Create timer.
4152
@param func function to be executed by this timer.
4253
@param type osTimerOnce for one-shot or osTimerPeriodic for periodic behaviour. (default: osTimerPeriodic)

0 commit comments

Comments
 (0)