Finished Firmware for Vacum

This commit is contained in:
AlexanderHD27
2025-01-02 03:55:45 +01:00
parent ad61e7e9b7
commit 0bb125fad9
39 changed files with 1701 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
#pragma once
#define LED1_PIN 16
#define LED2_PIN 25
#define RELAY_PIN 15
#define GORPC_INT_PIN 3
#define GORPC_SDA_PIN 4
#define GORPC_SCL_PIN 5
#define BUTTON_PIN 17
#define INTERRUPTION_DURATION ((int)(2.5 * 1000))
#define INTERRUPTION_DELAY 5 * 1000

View File

@@ -0,0 +1,28 @@
#pragma once
#include "pinConfig.hpp"
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
void vInterruptionTaskFn(void *pvParameters);
void vButtonTaskFn(void *pvParameters);
class VacumControl {
private:
bool state = false;
xSemaphoreHandle vacumMutex;
xSemaphoreHandle interruptionSemaphore;
xTaskHandle interruptionTask;
xTaskHandle buttonTask;
public:
VacumControl();
void initVacumPins();
void setState(bool on);
void interruptionTaskFn();
void buttonTaskFn();
};