Skip to content

Commit

Permalink
fixes for IR and VL ifdefs (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan authored Jan 1, 2024
1 parent be6f1f6 commit 92cb60f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
18 changes: 18 additions & 0 deletions VortexEngine/src/VortexEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "Wireless/IRSender.h"
#include "Wireless/VLReceiver.h"
#include "Wireless/VLSender.h"
#include "Wireless/IRConfig.h"
#include "Wireless/VLConfig.h"
#include "Storage/Storage.h"
#include "Buttons/Buttons.h"
#include "Time/TimeControl.h"
Expand Down Expand Up @@ -40,22 +42,30 @@ bool VortexEngine::init()
DEBUG_LOG("Storage failed to initialize");
return false;
}
#if IR_ENABLE_RECEIVER == 1
if (!IRReceiver::init()) {
DEBUG_LOG("IRReceiver failed to initialize");
return false;
}
#endif
#if IR_ENABLE_SENDER == 1
if (!IRSender::init()) {
DEBUG_LOG("IRSender failed to initialize");
return false;
}
#endif
#if VL_ENABLE_RECEIVER == 1
if (!VLReceiver::init()) {
DEBUG_LOG("VLReceiver failed to initialize");
return false;
}
#endif
#if VL_ENABLE_SENDER == 1
if (!VLSender::init()) {
DEBUG_LOG("VLSender failed to initialize");
return false;
}
#endif
if (!Leds::init()) {
DEBUG_LOG("Leds failed to initialize");
return false;
Expand Down Expand Up @@ -98,10 +108,18 @@ void VortexEngine::cleanup()
Menus::cleanup();
Buttons::cleanup();
Leds::cleanup();
#if VL_ENABLE_SENDER == 1
VLSender::cleanup();
#endif
#if VL_ENABLE_RECEIVER == 1
VLReceiver::cleanup();
#endif
#if IR_ENABLE_SENDER == 1
IRSender::cleanup();
#endif
#if IR_ENABLE_RECEIVER == 1
IRReceiver::cleanup();
#endif
Storage::cleanup();
Time::cleanup();
SerialComs::cleanup();
Expand Down
7 changes: 3 additions & 4 deletions VortexEngine/src/Wireless/IRReceiver.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#include "IRReceiver.h"
#include "IRConfig.h"

#if IR_ENABLE_RECEIVER == 1

#include "../Serial/ByteStream.h"
#include "../Serial/BitStream.h"
#include "../Time/TimeControl.h"
#include "../Modes/Mode.h"
#include "../Log/Log.h"

#include "IRConfig.h"

#if IR_ENABLE_RECEIVER == 1

BitStream IRReceiver::m_irData;
IRReceiver::RecvState IRReceiver::m_recvState = WAITING_HEADER_MARK;
uint32_t IRReceiver::m_prevTime = 0;
Expand Down
7 changes: 3 additions & 4 deletions VortexEngine/src/Wireless/IRSender.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#include "IRSender.h"
#include "IRConfig.h"

#if IR_ENABLE_SENDER == 1

#include "../Time/TimeControl.h"
#include "../Modes/Mode.h"
#include "../Log/Log.h"

#include "IRConfig.h"

#ifdef VORTEX_LIB
#include "VortexLib.h"
#endif

#if IR_ENABLE_SENDER == 1

// the serial buffer for the data
ByteStream IRSender::m_serialBuf;
// a bit walker for the serial data
Expand Down
5 changes: 3 additions & 2 deletions VortexEngine/src/Wireless/VLReceiver.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "VLReceiver.h"
#include "IRConfig.h"

#if VL_ENABLE_RECEIVER == 1

#include "../Serial/ByteStream.h"
#include "../Serial/BitStream.h"
Expand All @@ -7,8 +10,6 @@
#include "../Leds/Leds.h"
#include "../Log/Log.h"

#if VL_ENABLE_RECEIVER == 1

BitStream VLReceiver::m_vlData;
VLReceiver::RecvState VLReceiver::m_recvState = WAITING_HEADER_MARK;
uint32_t VLReceiver::m_prevTime = 0;
Expand Down
5 changes: 3 additions & 2 deletions VortexEngine/src/Wireless/VLSender.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "VLSender.h"
#include "IRConfig.h"

#if VL_ENABLE_SENDER == 1

#include "../Time/TimeControl.h"
#include "../Modes/Mode.h"
Expand All @@ -9,8 +12,6 @@
#include "VortexLib.h"
#endif

#if VL_ENABLE_SENDER == 1

// the serial buffer for the data
ByteStream VLSender::m_serialBuf;
// a bit walker for the serial data
Expand Down

0 comments on commit 92cb60f

Please sign in to comment.