Lines Matching refs:timer
6 The software timer is a software-simulated timer based on system tick interrupts. When the preset t…
8 …ore, the OpenHarmony LiteOS-M kernel provides the software timer function. The software timer allo…
10 The software timer supports the following functions:
12 - Disabling the software timer using a macro
14 - Creating a software timer
16 - Starting a software timer
18 - Stopping a software timer
20 - Deleting a software timer
22 - Obtaining the number of remaining ticks of a software timer
27 The software timer is a system resource. When modules are initialized, a contiguous section of memo…
29 … the First In First Out (FIFO) rule. A timer with a shorter value is always closer to the queue he…
31 …timer counts time in ticks. When a software timer is created and started, the OpenHarmony LiteOS-M…
35 …lete, the software timer task (with the highest priority) will be woken up. In this task, the time…
41 …The timer is not in use. When the timer module is initialized, all timer resources in the system a…
44 …timer is created but not started or the timer is stopped. When **LOS_SwtmrCreate** is called for a…
47 …The timer is running (counting). When **LOS_SwtmrStart** is called for a newly created timer, the …
54 - One-shot timer: Once started, the timer is automatically deleted after triggering only one timer …
56 - Periodic timer: This type of timer periodically triggers timer events until it is manually stoppe…
58 - One-shot timer deleted by calling an API
63 The following table describes APIs available for the OpenHarmony LiteOS-M software timer module. Fo…
65 **Table 1** Software timer APIs
69 | Creating or deleting a timer| **LOS_SwtmrCreate**: creates a timer.<br>**LOS_SwtmrDelete**: delet…
70 | Starting or stopping a timer| **LOS_SwtmrStart**: starts a timer.<br>**LOS_SwtmrStop**: Stops a t…
71 …taining remaining ticks of a software timer| **LOS_SwtmrTimeGet**: obtains the remaining ticks of …
78 1. Configure the software timer.
81 - Configure **OS_SWTMR_HANDLE_QUEUE_SIZE** (maximum length of the software timer queue).
83 2. Call **LOS_SwtmrCreate** to create a software timer.
84 …- Create a software timer with the specified timing duration, timeout handling function, and trigg…
87 3. Call **LOS_SwtmrStart** to start the software timer.
89 4. Call **LOS_SwtmrTimeGet** to obtain the remaining number of ticks of the software timer.
91 5. Call **LOS_SwtmrStop** to stop the software timer.
93 6. Call **LOS_SwtmrDelete** to delete the software timer.
96 > - Avoid too many operations in the callback of the software timer. Do not use APIs or perform ope…
98 …e a queue and a task resource of the system. The priority of the software timer tasks is set to **…
100 …timer resources that can be configured in the system is the total number of software timer resourc…
102 > - If a one-shot software timer is created, the system automatically deletes the timer and reclaim…
104 …software timer that will not be automatically deleted after expiration, you need to call **LOS_Swt…
114 1. Create, start, delete, pause, and restart a software timer.
116 2. Use a one-shot software timer and a periodic software timer
125 …**, **LOSCFG_BASE_CORE_SWTMR_ALIGN** is disabled. The sample code does not involve timer alignment.
129 - The maximum length of the software timer queue (OS_SWTMR_HANDLE_QUEUE_SIZE) is configured.
147 /* Callback 1, for the one-shot software timer. */
154 /* Callback 2, for the periodic software timer. */
164 UINT32 id1; // One-shot software timer.
165 UINT32 id2; // Periodic software timer.
169 …/* Create a one-shot software timer, with the number of ticks set to 1000. Invoke callback 1 when …
173 /* Create a periodic software timer and invoke callback 2 every 100 ticks. */
177 …/* Create a one-shot software timer, with the number of ticks set to 1000. Callback 1 will be invo…
180 /* Create a periodic software timer and invoke callback 2 every 100 ticks. */
184 /* Start the one-time software timer. */
188 /* Short delay. The timer is not triggered yet. */
191 /* The one-short timer is not triggered yet. The timer can be stopped successfully. */
197 /* Long-time delay, triggered by the timer. */
200 /* The timer is automatically deleted after being triggered. The stop operation should fail. */
204 /* Start the periodic software timer. */
208 /* Long-time delay, triggered periodically by the timer. */