Skip to content

Commit

Permalink
chore: various code move to match architecture diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
arcadien committed Nov 1, 2023
1 parent a9f1089 commit 9b2fbfc
Show file tree
Hide file tree
Showing 17 changed files with 217 additions and 212 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apt-get update \
python3-setuptools \
srecord \
udev \
socat \
xz-utils \
&& apt-get autoremove -y \
&& apt-get clean -y \
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions lib/Gui/BTEGui.hpp → lib/Domain/BTEGui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#include <ITargetGui.hpp>
#include <stdint.h>

#if defined(AVR)
#include <Arduino.h>
#else
#if not defined(AVR)
#include <ostream>
#endif

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/Gui/TestGui.hpp → lib/Native/TestGui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
#pragma once
#include <ITargetGui.hpp>
#include <cstdint>
#include <stdint.h>

class TestGui : public ITargetGui {

Expand All @@ -28,7 +28,7 @@ class TestGui : public ITargetGui {
void hitTarget(ITargetGui::TARGET target) override { targetState |= (1 << target); }

bool isTargetHit(ITargetGui::TARGET target) override {
return (targetState & (1 << target) == (1 << target));
return ( (targetState & (1 << target)) == (1 << target));
}

void setCurrentPlayer(uint8_t playerId) override {}
Expand Down
20 changes: 13 additions & 7 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lib_compat_mode=off
; these libraries are for AVR and simulation
; targets only, so a reset of this property
; is needed in the `native` configuration
lib_deps =
lib_deps =

#upload_protocol=custom
#upload_flags =
Expand Down Expand Up @@ -41,7 +41,7 @@ upload_command = avrdude -vv -pm328p -c avrisp -P/dev/ttyS0 $UPLOAD_FLAGS -U fla
test_ignore = cross/*
build_flags = -DNATIVE
debug_test = noarch/test_gun
build_src_filter = ${env.src_filter} -<target.cpp> -<gun.cpp>
build_src_filter = ${env.src_filter} -<TargetApp.cpp> -<GunApp.cpp>

[env:native_debug]
lib_deps = ${env.lib_deps}
Expand All @@ -51,21 +51,22 @@ upload_command = avrdude -vv -pm328p -c avrisp -P/dev/ttyS0 $UPLOAD_FLAGS -U fla
debug_build_flags = -Og -ggdb3 -g3 -DNATIVE -UAVR
test_ignore = cross/*
debug_test = noarch/test_gun
build_src_filter = ${env.src_filter} -<target.cpp> -<gun.cpp>
build_src_filter = ${env.src_filter} -<TargetApp.cpp> -<GunApp.cpp>

[env:cross]
lib_deps = ${env.lib_deps}
test_framework = unity
platform = atmelavr
framework = arduino
board = ATmega328P
build_type = release
test_ignore = native/*
build_flags = -O0
build_src_filter = ${env.src_filter} -<consoleApp.cpp>
build_src_filter = ${env.src_filter} -<ConsoleTargets.cpp>

[env:target]
lib_deps =
${env.lib_deps}
${env.lib_deps}
SerialCommands
framework = arduino
platform = atmelavr
Expand All @@ -74,12 +75,17 @@ upload_command = avrdude -vv -pm328p -c avrisp -P/dev/ttyS0 $UPLOAD_FLAGS -U fla
board_build.f_cpu = 16000000L
build_type = release
build_flags = -DAVR
build_src_filter = ${env.src_filter} -<gun.cpp> -<consoleApp.cpp>
test_ignore =
native/*
build_src_filter = ${env.src_filter} -<GunApp.cpp> -<ConsoleTargets.cpp>

[env:gun]
lib_deps =
platform = atmelavr
board = attiny84
build_type = release
build_flags = -DAVR
build_src_filter = ${env.src_filter} -<target.cpp> -<consoleApp.cpp>
test_ignore =
native/*
noarch/*
build_src_filter = ${env.src_filter} -<TargetApp.cpp> -<ConsoleTargets.cpp>
File renamed without changes.
46 changes: 23 additions & 23 deletions src/gun.cpp → src/GunApp.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/*
*
* Copyright (c) 2023 Aurelien Labrosse
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

int main(void)
{
while (1)
{
}
}
/*
*
* Copyright (c) 2023 Aurelien Labrosse
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

int main(void)
{
while (1)
{
}
}
Loading

0 comments on commit 9b2fbfc

Please sign in to comment.