Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
s-t-a-n committed Apr 16, 2024
1 parent e15af2c commit b6a1d41
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 34 deletions.
16 changes: 14 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,23 @@ extends = base
platform = atmelsam
framework = arduino
board = due
lib_deps = symlink:///home/stan/projects/krakakai/Spine
lib_deps =
symlink:///home/stan/projects/krakakai/Spine

[env:megaatmega2560]
extends = base
platform = atmelavr
board = megaatmega2560
framework = arduino
lib_deps = symlink:///home/stan/projects/krakakai/Spine
lib_deps =
symlink:///home/stan/projects/krakakai/Spine


[env:native]
platform = native
test_ignore = test_embedded
lib_deps =
ArxTypeTraits
fabiobatsilva/ArduinoFake@^0.4.0
symlink:///home/stan/projects/krakakai/Spine

7 changes: 0 additions & 7 deletions src/Actuator.hpp

This file was deleted.

7 changes: 3 additions & 4 deletions src/KasKas.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#pragma once

#include "Actuator.hpp"
#include "Clock.hpp"
#include "Sensor.hpp"
#include "implementations/Relay.hpp"
#include "components/Clock.hpp"
#include "components/Relay.hpp"
// #include "spine/core/eventsystem.hpp"

class KasKas {
public:
Expand Down
6 changes: 0 additions & 6 deletions src/Sensor.hpp

This file was deleted.

File renamed without changes.
9 changes: 3 additions & 6 deletions src/implementations/Relay.hpp → src/components/Relay.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#pragma once

#include <Actuator.hpp>

class Relay : public Actuator {
class Relay {
public:
enum state_t { ON = 1, OFF = 0 };

Expand All @@ -13,9 +11,8 @@ class Relay : public Actuator {

bool state() { return m_state; }

template <typename T>
Relay(const int pin, const T state = OFF) : m_pin(pin), m_state(static_cast<state_t>(state)) {
}
template<typename T>
Relay(const int pin, const T&& state = OFF) : m_pin(pin), m_state(static_cast<state_t>(state)) {}

private:
const int m_pin;
Expand Down
25 changes: 16 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
#if defined(ARDUINO)
# include <Arduino.h>
#else
# include <ArduinoFake.h>
#endif

#include "KasKas.hpp"

#include <spine/core/assert.hpp>
#include <spine/core/exception.hpp>
#include <spine/core/standard.hpp>
#include <spine/core/system.hpp>

static auto KASKAS = KasKas(KasKas::Config());
namespace {

void block() {
while(true);
}
using namespace spn::core;

static auto KASKAS = KasKas(KasKas::Config());

void setup() {
if(KASKAS.init() != 0 ) {
block();
if (KASKAS.init() != 0) {
halt("KasKas failed to initialize.");
}
}

void loop() {
if(KASKAS.loop() != 0) {
block();
};
if (KASKAS.loop() != 0) {
halt("KasKas left loop.");
};
}

} // namespace

// int main() {
// setup();
Expand Down
5 changes: 5 additions & 0 deletions src/subsystems/health/health.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "signalling.hpp"

class Health {};
9 changes: 9 additions & 0 deletions src/subsystems/health/signalling.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

// Green,Yellow,Red Signal Tower
class SignalTower {
public:
SignalTower() {}

private:
};

0 comments on commit b6a1d41

Please sign in to comment.