Calculator.h 1006 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _CALCULATOR_H
  2. #define _CALCULATOR_H
  3. #include "Arduino.h"
  4. #define _TASK_SLEEP_ON_IDLE_RUN // Enable 1 ms SLEEP_IDLE powerdowns between tasks if no callback methods were invoked during the pass
  5. #define _TASK_STATUS_REQUEST // Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only
  6. #define _TASK_WDT_IDS // Compile with support for wdt control points and task ids
  7. #define _TASK_PRIORITY // Support for layered scheduling priority
  8. #define _TASK_TIMEOUT // Support for overall task timeout
  9. #define _TASK_OO_CALLBACKS // Support for dynamic callback method binding
  10. #include <TaskSchedulerDeclarations.h>
  11. class Calculator : public Task {
  12. public:
  13. Calculator( Scheduler* aS, Scheduler* aSensors);
  14. void reportDistance(long aD);
  15. bool Callback();
  16. bool OnEnable();
  17. void OnDisable();
  18. private:
  19. Scheduler* iS;
  20. long distance;
  21. int iNS;
  22. };
  23. #endif // _CALCULATOR_H