REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
mode_manual.cpp
Go to the documentation of this file.
1// Copyright (c) 2024 anabrid GmbH
2// Contact: https://www.anabrid.com/licensing/
3//
4// SPDX-License-Identifier: MIT OR GPL-2.0-or-later
5
6#include <handlers/mode_manual.h>
7#include <mode/mode.h>
8#include <mode/teensy/mode.h>
9#include <protocol/handler.h>
10#include <run/run_manager.h>
11#include <utils/logging.h>
12
13#include <mode/mode.h>
14
15namespace msg::handlers {
16
17int ManualControlHandler::can_manual_control() {
18 if (!run::RunManager::get().queue.empty())
19 return 1; // TODO, should return the meaning of this error
21 return 3;
22 // maybe further checks neccessary.
23 return 0;
24}
25
26void ManualControlHandler::toMinion() {
27 LOG_ALWAYS("Enabling slave mode, setting IC/OP pins to input (floating).");
28 pinMode(mode::PIN_MODE_IC, INPUT);
29 pinMode(mode::PIN_MODE_OP, INPUT);
30}
31
32} // namespace msg::handlers
static bool is_idle()
Definition mode.cpp:466
static bool is_done()
Definition mode.cpp:476
static bool is_enabled()
Definition mode.h:93
constexpr uint8_t PIN_MODE_OP
Definition mode.h:17
constexpr uint8_t PIN_MODE_IC
Definition mode.h:16