-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpm_timer.h
More file actions
44 lines (34 loc) · 811 Bytes
/
Copy pathpm_timer.h
File metadata and controls
44 lines (34 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* File : pm_timer.h
* COPYRIGHT (C) 2012-2017, Shanghai Real-Thread Technology Co., Ltd
*
* Change Logs:
* Date Author Notes
* 2017-11-05 realthread the first version
*/
#pragma once
#include <pm_widget.h>
#include <sigslot.h>
#include <rtgui/rtgui_system.h>
namespace Persimmon
{
class Timer: private utils::noncopyable<Timer>
{
public:
enum flag
{
ONE_SHOT = RT_TIMER_FLAG_ONE_SHOT,
PERIODIC = RT_TIMER_FLAG_PERIODIC,
SOFT_TIMER = RT_TIMER_FLAG_SOFT_TIMER,
};
Timer(int time, enum flag flag);
~Timer();
void start();
void stop();
void setTimeout(int time);
Signal<void> timeout;
private:
struct rtgui_timer *m_timer;
static void _onTimeout(struct rtgui_timer *timer, void *parameter);
};
}