Skip to content

Commit

Permalink
KRKNWK-13807: Implement lowpower timer
Browse files Browse the repository at this point in the history
  • Loading branch information
MarGasiorek committed Aug 18, 2022
1 parent c4dfaf9 commit 61368d4
Show file tree
Hide file tree
Showing 8 changed files with 395 additions and 216 deletions.
12 changes: 7 additions & 5 deletions lib/include/sid_pal_timer_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#define SID_PAL_TIMER_TYPES_H

#include <zephyr.h>
#include <sys/dlist.h>
#include <sid_time_types.h>

typedef struct sid_pal_timer_impl_t sid_pal_timer_t;

Expand All @@ -25,20 +27,20 @@ typedef struct sid_pal_timer_impl_t sid_pal_timer_t;
* @note The callback is allowed to execute absolute minimum amount of work and return as soon as possible
* @note Implementer of the callback should consider the callback is executed from ISR context
*/
typedef void(*sid_pal_timer_cb_t)(void * arg, sid_pal_timer_t * originator);
typedef void (*sid_pal_timer_cb_t)(void *arg, sid_pal_timer_t *originator);

/**
* @brief Timer storage type
*
* @note This is the implementor defined storage type for timers.
*/
struct sid_pal_timer_impl_t {
struct sid_timespec alarm;
struct sid_timespec period;
sys_dnode_t node;
sid_pal_timer_cb_t callback;
void *callback_arg;
atomic_t is_armed;
bool is_periodic;
bool is_initialized;
size_t timer_id;
const struct sid_timespec *tolerance;
};

#endif
Loading

0 comments on commit 61368d4

Please sign in to comment.