mn_tickhook_entry.hpp
Go to the documentation of this file.
1 
19 #ifndef MINLIB_ESP32_TICK_HOOK_ENTRY_
20 #define MINLIB_ESP32_TICK_HOOK_ENTRY_
21 
22 #include "mn_config.hpp"
23 
24 #include <freertos/FreeRTOS.h>
25 
26 #include "mn_error.hpp"
27 #include "mn_task.hpp"
28 
29 
30 namespace mn {
31  class base_tickhook;
32 
43  friend class base_tickhook;
44  public:
53  base_tickhook_entry(unsigned int iTicksToCall, bool bOneShoted = false,
54  void* pUserData = 0);
55 
63  bool set_ticks(unsigned int uiTicks);
68  bool set_oneshot(bool bIsOneShot);
72  void start();
73  void stop();
74 
75  bool is_oneshoted();
76  bool is_ready();
77 
78  unsigned int get_ticks();
79  protected:
80  virtual void onTick(const unsigned int ticks) = 0;
81  protected:
82  void* m_pUserData;
83  unsigned int m_iTicksToCall;
85  bool m_bReady;
87  };
88 }
89 
90 #endif
Definition: mn_tickhook_entry.hpp:42
bool m_bOneShoted
Definition: mn_tickhook_entry.hpp:84
void stop()
bool set_oneshot(bool bIsOneShot)
bool m_bReady
Definition: mn_tickhook_entry.hpp:85
base_tickhook_entry(unsigned int iTicksToCall, bool bOneShoted=false, void *pUserData=0)
bool set_ticks(unsigned int uiTicks)
mutex_t m_mutexEntry
Definition: mn_tickhook_entry.hpp:86
void * m_pUserData
Definition: mn_tickhook_entry.hpp:82
bool is_oneshoted()
void start()
unsigned int get_ticks()
base_tickhook_entry(const base_tickhook_entry &)=delete
friend class base_tickhook
Definition: mn_tickhook_entry.hpp:43
unsigned int m_iTicksToCall
Definition: mn_tickhook_entry.hpp:83
virtual void onTick(const unsigned int ticks)=0
bool is_ready()
Definition: mn_mutex.hpp:37
A list of all error codes in this lib. This file is part of the Mini Thread Library (https://github....
Definition: mn_allocator_typetraits.hpp:25