jonny_ji7 ac4ca5450a Fix variable scopes (static), Simplify encoder
- add static type to all local variables in every source file
  so the scope of each variable is limited to that file.
  This prevents conflicting variable names with other source file
  (e.g. 'state' variable in vfd.cpp)

- simplify encoder concept
  wrap all used functions from rotary_encoder.h library in
  custom encoder.hpp file
   -> only one file has to be included where encoder is used
   -> global variable 'encoder' is not necessary anymore
   -> reduces duplicate code for length calculation
- update all files where encoder functions where used accordingly
2023-03-01 01:00:16 +01:00

35 lines
806 B
C++

#pragma once
extern "C"
{
#include <stdio.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_idf_version.h>
#include "freertos/queue.h"
#include "esp_system.h"
#include "esp_log.h"
#include "driver/adc.h"
#include "max7219.h"
}
#include <cmath>
#include "config.hpp"
#include "gpio_evaluateSwitch.hpp"
#include "gpio_adc.hpp"
#include "buzzer.hpp"
#include "vfd.hpp"
#include "display.hpp"
#include "cutter.hpp"
//enum describing the state of the system
enum class systemState_t {COUNTING, WINDING_START, WINDING, TARGET_REACHED, AUTO_CUT_WAITING, CUTTING, MANUAL};
//array with enum as strings for logging states
extern const char* systemStateStr[7];
//task that controls the entire machine (has to be created as task in main function)
void task_control(void *pvParameter);