mn_tasklet.hpp
Go to the documentation of this file.
1 
19 #ifndef MINLIB_ESP32_TASKLETS_
20 #define MINLIB_ESP32_TASKLETS_
21 
22 #include "mn_config.hpp"
23 
24 
25 #include "mn_autolock.hpp"
26 #include "mn_convar.hpp"
27 #include "mn_error.hpp"
28 #include "mn_micros.hpp"
29 #include "mn_sleep.hpp"
30 
31 namespace mn {
45  class basic_tasklet {
46  public:
47  basic_tasklet();
48 
59  virtual int schedule(uint32_t parameter, unsigned int timeout = MN_THREAD_CONFIG_TIMEOUT_COROUTINE_DEFAULT);
64  virtual int destroy();
65  protected:
74  virtual bool on_tasklet(uint32_t arg) = 0;
75  protected:
80  static void runtasklet(void* parm, uint32_t parameter);
81  protected:
86  };
87 
89 }
90 #endif
Definition: mn_counting_semaphore.hpp:30
Definition: mn_tasklet.hpp:45
basic_tasklet()
Definition: mn_tasklet.cpp:29
static void runtasklet(void *parm, uint32_t parameter)
Definition: mn_tasklet.cpp:70
virtual int destroy()
Definition: mn_tasklet.cpp:63
virtual bool on_tasklet(uint32_t arg)=0
counting_semaphore_t m_ssLock
Definition: mn_tasklet.hpp:85
virtual int schedule(uint32_t parameter, unsigned int timeout=MN_THREAD_CONFIG_TIMEOUT_COROUTINE_DEFAULT)
Definition: mn_tasklet.cpp:35
#define MN_THREAD_CONFIG_TIMEOUT_COROUTINE_DEFAULT
Definition: mn_config.hpp:400
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