From 33dade0dc5eaa770f21d141061d11c1b7793f17a Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 17 Oct 2023 14:55:36 +0900 Subject: [PATCH 1/3] fix add missing include c2a-core main header --- .../real/communication/wings_command_sender_to_c2a.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/real/communication/wings_command_sender_to_c2a.cpp b/src/components/real/communication/wings_command_sender_to_c2a.cpp index b77f72fc3..32b9a1a6e 100644 --- a/src/components/real/communication/wings_command_sender_to_c2a.cpp +++ b/src/components/real/communication/wings_command_sender_to_c2a.cpp @@ -12,6 +12,7 @@ #include #ifdef USE_C2A +#include "src_core/c2a_core_main.h" #if C2A_CORE_VER_MAJOR == 4 // c2a-core v4 #include "src_core/tlm_cmd/common_cmd_packet_util.h" From 53454476fd313be924a60b51c1556e9d6b1071e5 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 17 Oct 2023 15:00:31 +0900 Subject: [PATCH 2/3] add C2A_CORE_VER_MAJOR defined check --- src/components/real/cdh/on_board_computer_with_c2a.cpp | 5 +++-- .../real/communication/wings_command_sender_to_c2a.cpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/real/cdh/on_board_computer_with_c2a.cpp b/src/components/real/cdh/on_board_computer_with_c2a.cpp index fc577cd9a..d290b8c60 100644 --- a/src/components/real/cdh/on_board_computer_with_c2a.cpp +++ b/src/components/real/cdh/on_board_computer_with_c2a.cpp @@ -9,7 +9,9 @@ #ifdef USE_C2A #include "src_core/c2a_core_main.h" -#if C2A_CORE_VER_MAJOR == 4 +#if !defined(C2A_CORE_VER_MAJOR) +#error "C2A_CORE_VER_MAJOR is not defined" +#elif C2A_CORE_VER_MAJOR == 4 // c2a-core v4 #include "src_core/system/task_manager/task_dispatcher.h" #include "src_core/system/time_manager/time_manager.h" @@ -22,7 +24,6 @@ #else #error "c2a-core version is not supported" #endif // c2a-core version header - #endif // USE_C2A std::map ObcWithC2a::com_ports_c2a_; diff --git a/src/components/real/communication/wings_command_sender_to_c2a.cpp b/src/components/real/communication/wings_command_sender_to_c2a.cpp index 32b9a1a6e..cdab59c57 100644 --- a/src/components/real/communication/wings_command_sender_to_c2a.cpp +++ b/src/components/real/communication/wings_command_sender_to_c2a.cpp @@ -13,7 +13,9 @@ #ifdef USE_C2A #include "src_core/c2a_core_main.h" -#if C2A_CORE_VER_MAJOR == 4 +#if !defined(C2A_CORE_VER_MAJOR) +#error "C2A_CORE_VER_MAJOR is not defined" +#elif C2A_CORE_VER_MAJOR == 4 // c2a-core v4 #include "src_core/tlm_cmd/common_cmd_packet_util.h" #elif C2A_CORE_VER_MAJOR <= 3 From f639d33222838840fe97f487aec471ec4bf2826c Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 17 Oct 2023 15:35:30 +0900 Subject: [PATCH 3/3] emit warning message if C2A_CORE_VER_MAJOR is not defined to support c2a-core <= v3.4.0 --- src/components/real/cdh/on_board_computer_with_c2a.cpp | 2 +- .../real/communication/wings_command_sender_to_c2a.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/real/cdh/on_board_computer_with_c2a.cpp b/src/components/real/cdh/on_board_computer_with_c2a.cpp index d290b8c60..8deb53bec 100644 --- a/src/components/real/cdh/on_board_computer_with_c2a.cpp +++ b/src/components/real/cdh/on_board_computer_with_c2a.cpp @@ -10,7 +10,7 @@ #include "src_core/c2a_core_main.h" #if !defined(C2A_CORE_VER_MAJOR) -#error "C2A_CORE_VER_MAJOR is not defined" +#warning "C2A_CORE_VER_MAJOR is not defined" # this flag is defined after c2a-core v3.5.0 #elif C2A_CORE_VER_MAJOR == 4 // c2a-core v4 #include "src_core/system/task_manager/task_dispatcher.h" diff --git a/src/components/real/communication/wings_command_sender_to_c2a.cpp b/src/components/real/communication/wings_command_sender_to_c2a.cpp index cdab59c57..2bb94ec0f 100644 --- a/src/components/real/communication/wings_command_sender_to_c2a.cpp +++ b/src/components/real/communication/wings_command_sender_to_c2a.cpp @@ -14,7 +14,7 @@ #ifdef USE_C2A #include "src_core/c2a_core_main.h" #if !defined(C2A_CORE_VER_MAJOR) -#error "C2A_CORE_VER_MAJOR is not defined" +#warning "C2A_CORE_VER_MAJOR is not defined" # this flag is defined after c2a-core v3.5.0 #elif C2A_CORE_VER_MAJOR == 4 // c2a-core v4 #include "src_core/tlm_cmd/common_cmd_packet_util.h"