30 lines
561 B
C++
30 lines
561 B
C++
#pragma once
|
|
#include "pinConfigNode.hpp"
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
#include "semphr.h"
|
|
|
|
void vInterruptionTaskFn(void *pvParameters);
|
|
void vButtonTaskFn(void *pvParameters);
|
|
|
|
class VacumControl {
|
|
private:
|
|
uint coreMask;
|
|
bool state = false;
|
|
xSemaphoreHandle vacumMutex;
|
|
xSemaphoreHandle interruptionSemaphore;
|
|
|
|
xTaskHandle interruptionTask;
|
|
xTaskHandle buttonTask;
|
|
public:
|
|
VacumControl(uint coreMask);
|
|
|
|
void initVacumPins();
|
|
void setState(bool on);
|
|
|
|
void interruptionTaskFn();
|
|
void buttonTaskFn();
|
|
|
|
};
|
|
|