Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common Packet のデフォルト実装を core から提供する(Space Packet のみ) #329

Merged
merged 13 commits into from
Apr 8, 2024
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ option(C2A_BUILD_FOR_SILS "Build C2A for SILS target" ON)
option(C2A_USE_ALL_CORE_APPS "Use C2A-core all Applications" ON)
option(C2A_USE_ALL_CORE_TEST_APPS "Use C2A-core all Test Applications" ON)
option(C2A_USE_ALL_CORE_LIB "Use C2A-core all library" ON)
option(C2A_USE_SPACE_PACKET_AS_COMMON_PACKET "Use C2A-core Space Packet as Common Packet implementation" ON)

## C2A build target board option (標準実装などがこのオプションによってスイッチされる.デフォルトでは sub OBC を想定)
option(C2A_MOBC_FEATURES "Enable some features for MOBC" OFF)
Expand Down Expand Up @@ -108,6 +109,16 @@ if(C2A_USE_ALL_CORE_LIB)
target_sources(${PROJECT_NAME} PUBLIC $<TARGET_OBJECTS:C2A_CORE_LIB>)
endif()

if(C2A_MOBC_FEATURES)
message("Enable some features for MOBC")
target_compile_definitions(${PROJECT_NAME} PUBLIC C2A_MOBC_FEATURES)
endif()

if(C2A_USE_SPACE_PACKET_AS_COMMON_PACKET)
add_subdirectory(tlm_cmd/common_packet/space_packet)
target_sources(${PROJECT_NAME} PUBLIC $<TARGET_OBJECTS:C2A_CORE_SPACE_PACKET_AS_COMMON_PACKET>)
endif()

if(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL)
add_subdirectory(tlm_cmd/ccsds/aos_space_data_link_protocol)
target_sources(${PROJECT_NAME} PUBLIC $<TARGET_OBJECTS:C2A_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL>)
Expand Down
2 changes: 2 additions & 0 deletions examples/mobc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ option(C2A_BUILD_WITH_SILS_MOCKUP "Build C2A with SILS mockup for check undefine

option(C2A_BUILD_FOR_SILS "Build C2A for SILS target" ON)

set(C2A_MOBC_FEATURES ON)

# core に同梱されている CCSDS の実装を使う
set(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL ON)
set(C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL ON)
Expand Down
1 change: 1 addition & 0 deletions examples/mobc/src/src_user/settings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(C2A_SRCS
system/event_handler_rules/event_handler_rules.c
system/event_handler_rules/event_handler_rule_test.c
tlm_cmd/common_cmd_packet_define.c
tlm_cmd/common_tlm_packet_define.c
tlm_cmd/ccsds/aos_transfer_frame_define.c
tlm_cmd/ccsds/apid_define.c
tlm_cmd/ccsds/tc_transfer_frame_define.c
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma section REPRO
/**
* @file
* @brief CTP 型の user 定義
*/
#include <src_core/tlm_cmd/common_packet/common_tlm_packet.h>
#include <src_core/tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.h>

void CTP_set_global_time(CommonTlmPacket* packet)
{
// 何を設定するかはユーザー定義
// TMGR_get_curret_unixtime() で現在の unixtime を入れたり, gps 時刻 を入れたり, など
TSP_set_global_time(packet, 0.0);
}

#pragma section
3 changes: 0 additions & 3 deletions examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ set(C2A_SRCS
block_command_definitions.c
block_command_user_settings.c
command_definitions.c
common_cmd_packet.c
common_tlm_cmd_packet.c
common_tlm_packet.c
telemetry_definitions.c
user_packet_handler.c
normal_block_command_definition/nbc_start_hk_tlm.c
Expand Down
80 changes: 0 additions & 80 deletions examples/mobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c

This file was deleted.

90 changes: 0 additions & 90 deletions examples/mobc/src/src_user/tlm_cmd/common_tlm_packet.c

This file was deleted.

1 change: 1 addition & 0 deletions examples/subobc/src/src_user/settings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(C2A_SRCS
system/event_logger_settings.c
system/event_handler_rules/event_handler_rules.c
tlm_cmd/common_cmd_packet_define.c
tlm_cmd/common_tlm_packet_define.c
tlm_cmd/ccsds/apid_define.c
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma section REPRO
/**
* @file
* @brief CTP 型の user 定義
*/
#include <src_core/tlm_cmd/common_packet/common_tlm_packet.h>
#include <src_core/tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.h>

void CTP_set_global_time(CommonTlmPacket* packet)
{
// 何を設定するかはユーザー定義
// TMGR_get_curret_unixtime() で現在の unixtime を入れたり, gps 時刻 を入れたり, など
TSP_set_global_time(packet, 0.0);
}

#pragma section
3 changes: 0 additions & 3 deletions examples/subobc/src/src_user/tlm_cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ set(C2A_SRCS
block_command_definitions.c
block_command_user_settings.c
command_definitions.c
common_cmd_packet.c
common_tlm_cmd_packet.c
common_tlm_packet.c
telemetry_definitions.c
user_packet_handler.c
normal_block_command_definition/nbc_start_hk_tlm.c
Expand Down
105 changes: 0 additions & 105 deletions examples/subobc/src/src_user/tlm_cmd/common_cmd_packet.c

This file was deleted.

1 change: 1 addition & 0 deletions examples/subobc/sync_with_mobc_example.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ call :sync_file ".\src\src_user\hal\sils_mockup\wdt_sils.c" "..\mobc\src\src_use
call :sync_file ".\src\src_user\settings\git_revision_config.h" "..\mobc\src\src_user\settings\git_revision_config.h"
call :sync_file ".\src\src_user\settings\component_driver_super\driver_buffer_define.h" "..\mobc\src\src_user\settings\component_driver_super\driver_buffer_define.h"
call :sync_file ".\src\src_user\settings\tlm_cmd\common_cmd_packet_define.c" "..\mobc\src\src_user\settings\tlm_cmd\common_cmd_packet_define.c"
call :sync_file ".\src\src_user\settings\tlm_cmd\common_tlm_packet_define.c" "..\mobc\src\src_user\settings\tlm_cmd\common_tlm_packet_define.c"
call :sync_file ".\src\src_user\settings\tlm_cmd\common_tlm_cmd_packet_define.h" "..\mobc\src\src_user\settings\tlm_cmd\common_tlm_cmd_packet_define.h"
call :sync_file ".\src\src_user\settings\tlm_cmd\ccsds\apid_define.c" "..\mobc\src\src_user\settings\tlm_cmd\ccsds\apid_define.c"
call :sync_file ".\src\src_user\settings\tlm_cmd\ccsds\apid_define.h" "..\mobc\src\src_user\settings\tlm_cmd\ccsds\apid_define.h"
Expand Down
Loading
Loading