Skip to content
Snippets Groups Projects
Commit 5b982f50 authored by Davide Mor's avatar Davide Mor
Browse files

[RIGv2] Added arming light

parent d519e62e
Branches
Tags
No related merge requests found
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <RIGv2/Sensors/Sensors.h> #include <RIGv2/Sensors/Sensors.h>
#include <common/Events.h> #include <common/Events.h>
#include <events/EventBroker.h> #include <events/EventBroker.h>
#include <interfaces-impl/hwmapping.h>
// TODO(davide.mor): Remove TimestampTimer // TODO(davide.mor): Remove TimestampTimer
#include <drivers/timer/TimestampTimer.h> #include <drivers/timer/TimestampTimer.h>
...@@ -33,6 +34,14 @@ using namespace miosix; ...@@ -33,6 +34,14 @@ using namespace miosix;
using namespace Common; using namespace Common;
using namespace RIGv2; using namespace RIGv2;
void armLightOn() {
relays::armLight::low();
}
void armLightOff() {
relays::armLight::high();
}
GroundModeManager::GroundModeManager() : FSM(&GroundModeManager::state_idle) GroundModeManager::GroundModeManager() : FSM(&GroundModeManager::state_idle)
{ {
EventBroker::getInstance().subscribe(this, TOPIC_MOTOR); EventBroker::getInstance().subscribe(this, TOPIC_MOTOR);
...@@ -100,6 +109,7 @@ void GroundModeManager::state_disarmed(const Boardcore::Event &event) ...@@ -100,6 +109,7 @@ void GroundModeManager::state_disarmed(const Boardcore::Event &event)
{ {
case EV_ENTRY: case EV_ENTRY:
{ {
armLightOff();
logStatus(GroundModeManagerState::STATE_DISARMED); logStatus(GroundModeManagerState::STATE_DISARMED);
break; break;
} }
...@@ -126,6 +136,7 @@ void GroundModeManager::state_armed(const Boardcore::Event &event) ...@@ -126,6 +136,7 @@ void GroundModeManager::state_armed(const Boardcore::Event &event)
{ {
case EV_ENTRY: case EV_ENTRY:
{ {
armLightOn();
logStatus(GroundModeManagerState::STATE_ARMED); logStatus(GroundModeManagerState::STATE_ARMED);
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment