mn_foreign_task.hpp
Go to the documentation of this file.
1 
19 #ifndef MINLIB_ESP32_FOREIGIN_THREAD_
20 #define MINLIB_ESP32_FOREIGIN_THREAD_
21 
22 #include "mn_config.hpp"
23 #include "mn_task.hpp"
24 
25 #if MN_THREAD_CONFIG_FOREIGIN_TASK_SUPPORT == MN_THREAD_CONFIG_YES
26 
27 namespace mn {
28  namespace ext {
32  #define FT_IDLE_TASK foreign_task::get_idle_task()
36  #define FT_IDLE_TASK_ON(CPUID) foreign_task::get_idle_task(CPUID)
37 
47  class foreign_task : public basic_task {
48  private:
52  foreign_task();
56  foreign_task(void* t);
57  public:
61  int start(int uiCore = -1) { return 0; }
67  static foreign_task* get_idle_task();
75  static foreign_task* get_idle_task(UBaseType_t cpuid);
76 
86  static foreign_task* create_from(void* foreign_handle, int* ret_error = nullptr);
87  protected:
92  int on_task() { return ERR_TASK_OK; }
93  private:
101  int create_usings_types();
102  };
103 
105  }
106 }
107 #endif
108 
109 #endif
Wrapper class around FreeRTOS's implementation of a task.
Definition: mn_task.hpp:88
Definition: mn_foreign_task.hpp:47
static foreign_task * create_from(void *foreign_handle, int *ret_error=nullptr)
Definition: mn_foreign_task.cpp:92
int on_task()
Definition: mn_foreign_task.hpp:92
static foreign_task * get_idle_task()
Definition: mn_foreign_task.cpp:68
int create_usings_types()
Definition: mn_foreign_task.cpp:45
foreign_task()
Definition: mn_foreign_task.cpp:28
int start(int uiCore=-1)
Definition: mn_foreign_task.hpp:61
#define ERR_TASK_OK
Definition: mn_error.hpp:87
Definition: mn_allocator_typetraits.hpp:25