ClosedLoop as singleton
This commit is contained in:
@ -29,12 +29,14 @@
|
||||
|
||||
#include "closedloop.h"
|
||||
|
||||
void init_closedloop() {
|
||||
ClosedLoop closedloop;
|
||||
|
||||
void ClosedLoop::init() {
|
||||
OUT_WRITE(CLOSED_LOOP_ENABLE_PIN, LOW);
|
||||
SET_INPUT_PULLUP(CLOSED_LOOP_MOVE_COMPLETE_PIN);
|
||||
}
|
||||
|
||||
void set_closedloop(const byte val) {
|
||||
void ClosedLoop::set(const byte val) {
|
||||
OUT_WRITE(CLOSED_LOOP_ENABLE_PIN, val);
|
||||
}
|
||||
|
||||
|
@ -21,5 +21,12 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
void init_closedloop();
|
||||
void set_closedloop(const byte val);
|
||||
class ClosedLoop {
|
||||
public:
|
||||
static void init();
|
||||
static void set(const byte val);
|
||||
};
|
||||
|
||||
extern ClosedLoop closedloop;
|
||||
|
||||
#define CLOSED_LOOP_WAITING() (READ(CLOSED_LOOP_ENABLE_PIN) && !READ(CLOSED_LOOP_MOVE_COMPLETE_PIN))
|
||||
|
Reference in New Issue
Block a user