You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gets the remaining time of the timer with the specified id.
224
224
225
225
## Best Practices / Tips
226
-
- Update configuration values and types in the `flexitimer.h` header to match specific needs. Adjust `FLEXITIMER_MAX_TIMERS` to support more timers along with the `timer_id_t` if required, and modify the type of `timer_time_t` for saving memory in environments with limited resources:
227
-
```c
228
-
/**
229
-
@brief Number of timers
230
-
*/
231
-
#define FLEXITIMER_MAX_TIMERS (20) // Example for increasing the number of timers
232
-
233
-
/**
234
-
@brief Id unit type
235
-
*/
236
-
typedef uint16_t timer_id_t; // Example for larger ID range
237
-
238
-
/**
239
-
@brief Time unit type
240
-
*/
241
-
typedef uint16_t timer_time_t; // Example for smaller time unit to save memory
226
+
- Configure `FLEXITIMER_MAX_TIMERS` via CMake: The maximum number of timers can be set during the CMake configuration step. This allows you to adjust the library's capacity without modifying source files.
227
+
```bash
228
+
cmake -DFLEXITIMER_MAX_TIMERS=50 ..
242
229
```
230
+
You can also adjust `timer_id_t` and `timer_time_t`in`flexitimer.h` to match specific needs and save memory in resource-constrained environments.
243
231
- Ensure callback functions are non-blocking and consist of minimal, efficient code to prevent delays in the scheduler execution.
244
232
- Use an enum to list timer IDs in a single place for easier management and readability.
245
233
- Utilize getter functions to control the flow and monitor timer states effectively.
0 commit comments