control.cpp:
- Add new systemState CUTTING
- change systemState_t from enum to enum class (conflicting with
cutter enum)
- Add CUTTING functionality to CUT switch and auto cut after target
reached if enabled
cutter.cpp:
- Add function cutter_isRunning()
config:
- Add GPIO_LAMP macro to config
36 lines
746 B
C++
36 lines
746 B
C++
extern "C"
|
|
{
|
|
#include <stdio.h>
|
|
#include "esp_log.h"
|
|
}
|
|
|
|
#include "buzzer.hpp"
|
|
#include "display.hpp"
|
|
#include "gpio_evaluateSwitch.hpp"
|
|
|
|
|
|
//--- variables ---
|
|
//enum for state of cutter
|
|
typedef enum cutter_state_t {IDLE, START, CUTTING, CANCELED, TIMEOUT} cutter_state_t;
|
|
//string for logging the state name
|
|
extern const char* cutter_stateStr[5];
|
|
|
|
|
|
|
|
//--- functions ---
|
|
//trigger cut cycle (no effect if already running)
|
|
void cutter_start();
|
|
|
|
//cancel cutting action
|
|
void cutter_stop();
|
|
|
|
//return current state
|
|
cutter_state_t cutter_getState();
|
|
//TODO: bool cutter_isOn() (simply return boolean instead of enum)
|
|
|
|
//check if cutter is currently operating
|
|
bool cutter_isRunning();
|
|
|
|
//handle function - has to be run repeatedly
|
|
void cutter_handle();
|