TaskCommon.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include <Os/Task.hpp>
  2. #include <Fw/Types/Assert.hpp>
  3. #include <FpConfig.hpp>
  4. namespace Os {
  5. const NATIVE_UINT_TYPE Task::TASK_DEFAULT = std::numeric_limits<PlatformUIntType>::max();
  6. TaskRegistry* Task::s_taskRegistry = nullptr;
  7. NATIVE_INT_TYPE Task::s_numTasks = 0;
  8. NATIVE_INT_TYPE Task::getNumTasks() {
  9. return Task::s_numTasks;
  10. }
  11. I32 Task::getIdentifier() {
  12. return m_identifier;
  13. }
  14. bool Task::isStarted() {
  15. return this->m_started;
  16. }
  17. void Task::setStarted(bool started) {
  18. this->m_started = started;
  19. }
  20. bool Task::wasSuspended() {
  21. return this->m_suspendedOnPurpose;
  22. }
  23. POINTER_CAST Task::getRawHandle() {
  24. return this->m_handle;
  25. }
  26. void Task::registerTaskRegistry(TaskRegistry* registry) {
  27. FW_ASSERT(registry);
  28. Task::s_taskRegistry = registry;
  29. }
  30. TaskRegistry::TaskRegistry() {
  31. }
  32. Task::TaskStatus Task::start(const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void* arg, NATIVE_INT_TYPE cpuAffinity) {
  33. return this->start(name, routine, arg, priority, stackSize, cpuAffinity, identifier);
  34. }
  35. TaskRegistry::~TaskRegistry() {
  36. }
  37. }