From fc2fca3cd907bbcd36f3ccaab4c6f7eb8bf2c6c2 Mon Sep 17 00:00:00 2001 From: sksat Date: Wed, 11 Oct 2023 17:05:50 +0900 Subject: [PATCH 1/7] merge Driver directory --- CMakeLists.txt | 8 ++++---- .../common_tlm_cmd_packet_for_driver_super.c | 0 .../common_tlm_cmd_packet_for_driver_super.h | 4 ++-- Drivers/{Protocol => }/data_link_layer_definition.h | 0 Drivers/{Super => }/driver_super.c | 4 ++-- Drivers/{Super => }/driver_super.h | 4 ++-- Drivers/{Protocol => }/eb90_frame_for_driver_super.c | 4 ++-- Drivers/{Protocol => }/eb90_frame_for_driver_super.h | 2 +- Drivers/{Protocol => }/eb90_packet_for_driver_super.c | 2 +- Drivers/{Protocol => }/eb90_packet_for_driver_super.h | 2 +- hal/i2c_common.h | 2 +- tlm-cmd-code-generator/my_mod/tlm_buffer.py | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) rename Drivers/{Protocol => }/common_tlm_cmd_packet_for_driver_super.c (100%) rename Drivers/{Protocol => }/common_tlm_cmd_packet_for_driver_super.h (98%) rename Drivers/{Protocol => }/data_link_layer_definition.h (100%) rename Drivers/{Super => }/driver_super.c (99%) rename Drivers/{Super => }/driver_super.h (99%) rename Drivers/{Protocol => }/eb90_frame_for_driver_super.c (96%) rename Drivers/{Protocol => }/eb90_frame_for_driver_super.h (99%) rename Drivers/{Protocol => }/eb90_packet_for_driver_super.c (98%) rename Drivers/{Protocol => }/eb90_packet_for_driver_super.h (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c24bd541..85af8a9ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,10 +26,10 @@ set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(C2A_SRCS c2a_core_main.c - Drivers/Protocol/common_tlm_cmd_packet_for_driver_super.c - Drivers/Protocol/eb90_frame_for_driver_super.c - Drivers/Protocol/eb90_packet_for_driver_super.c - Drivers/Super/driver_super.c + Drivers/common_tlm_cmd_packet_for_driver_super.c + Drivers/eb90_frame_for_driver_super.c + Drivers/eb90_packet_for_driver_super.c + Drivers/driver_super.c hal/i2c_common.c system/application_manager/app_info.c system/application_manager/app_manager.c diff --git a/Drivers/Protocol/common_tlm_cmd_packet_for_driver_super.c b/Drivers/common_tlm_cmd_packet_for_driver_super.c similarity index 100% rename from Drivers/Protocol/common_tlm_cmd_packet_for_driver_super.c rename to Drivers/common_tlm_cmd_packet_for_driver_super.c diff --git a/Drivers/Protocol/common_tlm_cmd_packet_for_driver_super.h b/Drivers/common_tlm_cmd_packet_for_driver_super.h similarity index 98% rename from Drivers/Protocol/common_tlm_cmd_packet_for_driver_super.h rename to Drivers/common_tlm_cmd_packet_for_driver_super.h index 9eac5e01b..b2b092859 100644 --- a/Drivers/Protocol/common_tlm_cmd_packet_for_driver_super.h +++ b/Drivers/common_tlm_cmd_packet_for_driver_super.h @@ -9,8 +9,8 @@ #define COMMON_TLM_CMD_PACKET_FOR_DRIVER_SUPER_H_ #include -#include "../Super/driver_super.h" -#include "../../tlm_cmd/common_tlm_cmd_packet.h" +#include "driver_super.h" +#include "../tlm_cmd/common_tlm_cmd_packet.h" /** * @brief CommonTlmCmdPacket を受信データからコピーして取得する diff --git a/Drivers/Protocol/data_link_layer_definition.h b/Drivers/data_link_layer_definition.h similarity index 100% rename from Drivers/Protocol/data_link_layer_definition.h rename to Drivers/data_link_layer_definition.h diff --git a/Drivers/Super/driver_super.c b/Drivers/driver_super.c similarity index 99% rename from Drivers/Super/driver_super.c rename to Drivers/driver_super.c index d15be422f..158900901 100644 --- a/Drivers/Super/driver_super.c +++ b/Drivers/driver_super.c @@ -10,10 +10,10 @@ */ #include "driver_super.h" -#include "../../library/print.h" +#include "../library/print.h" #include // for memset などの mem 系 #include // for NULL -#include "../../tlm_cmd/common_cmd_packet_util.h" +#include "../tlm_cmd/common_cmd_packet_util.h" // #define DS_DEBUG // 適切なときにコメントアウトする // #define DS_DEBUG_SHOW_REC_DATA // 適切なときにコメントアウトする diff --git a/Drivers/Super/driver_super.h b/Drivers/driver_super.h similarity index 99% rename from Drivers/Super/driver_super.h rename to Drivers/driver_super.h index 87b6d6c72..d7f0f2a90 100644 --- a/Drivers/Super/driver_super.h +++ b/Drivers/driver_super.h @@ -25,8 +25,8 @@ #include #include -#include "../../library/endian.h" // パスが不定な自動生成コード類で使えるように -#include "../../system/time_manager/time_manager.h" +#include "../library/endian.h" // パスが不定な自動生成コード類で使えるように +#include "../system/time_manager/time_manager.h" #define DS_STREAM_MAX (3) /*!< DS_StreamConfig の最大数 uint8_t を想定 */ diff --git a/Drivers/Protocol/eb90_frame_for_driver_super.c b/Drivers/eb90_frame_for_driver_super.c similarity index 96% rename from Drivers/Protocol/eb90_frame_for_driver_super.c rename to Drivers/eb90_frame_for_driver_super.c index 2ff88a4e6..1678c878d 100644 --- a/Drivers/Protocol/eb90_frame_for_driver_super.c +++ b/Drivers/eb90_frame_for_driver_super.c @@ -4,8 +4,8 @@ * @brief コンポ間通信などで標準的に使う データリンク層 の EB90 Frame */ #include "eb90_frame_for_driver_super.h" -#include "../../library/endian.h" -#include "../../library/crc.h" +#include "../library/endian.h" +#include "../library/crc.h" const uint8_t EB90_FRAME_kStx[EB90_FRAME_STX_SIZE] = {EB90_FRAME_STX_1ST_BYTE, EB90_FRAME_STX_2ND_BYTE}; const uint8_t EB90_FRAME_kEtx[EB90_FRAME_ETX_SIZE] = {EB90_FRAME_ETX_1ST_BYTE, EB90_FRAME_ETX_2ND_BYTE}; diff --git a/Drivers/Protocol/eb90_frame_for_driver_super.h b/Drivers/eb90_frame_for_driver_super.h similarity index 99% rename from Drivers/Protocol/eb90_frame_for_driver_super.h rename to Drivers/eb90_frame_for_driver_super.h index 765c6d1e7..ca603dcad 100644 --- a/Drivers/Protocol/eb90_frame_for_driver_super.h +++ b/Drivers/eb90_frame_for_driver_super.h @@ -35,7 +35,7 @@ #define EB90_FRAME_FOR_DRIVER_SUPER_H_ #include -#include "../Super/driver_super.h" +#include "driver_super.h" #define EB90_FRAME_STX_SIZE (2) //!< EB90 Frame の STX のサイズ #define EB90_FRAME_ETX_SIZE (2) //!< EB90 Frame の ETX のサイズ diff --git a/Drivers/Protocol/eb90_packet_for_driver_super.c b/Drivers/eb90_packet_for_driver_super.c similarity index 98% rename from Drivers/Protocol/eb90_packet_for_driver_super.c rename to Drivers/eb90_packet_for_driver_super.c index 1c1b87abe..9b1249ba3 100644 --- a/Drivers/Protocol/eb90_packet_for_driver_super.c +++ b/Drivers/eb90_packet_for_driver_super.c @@ -8,7 +8,7 @@ */ #include "eb90_packet_for_driver_super.h" #include "eb90_frame_for_driver_super.h" -#include "../../library/endian.h" +#include "../library/endian.h" // FIXME: DS_StreamConfig.data_link_layer_ をちゃんと見る! diff --git a/Drivers/Protocol/eb90_packet_for_driver_super.h b/Drivers/eb90_packet_for_driver_super.h similarity index 98% rename from Drivers/Protocol/eb90_packet_for_driver_super.h rename to Drivers/eb90_packet_for_driver_super.h index e932d7662..68e00859b 100644 --- a/Drivers/Protocol/eb90_packet_for_driver_super.h +++ b/Drivers/eb90_packet_for_driver_super.h @@ -27,7 +27,7 @@ #define EB90_PACKET_FOR_DRIVER_SUPER_H_ #include -#include "../Super/driver_super.h" +#include "driver_super.h" #define EB90_PACKET_HEADER_SIZE (4) //!< EB90 Packet のヘッダサイズ diff --git a/hal/i2c_common.h b/hal/i2c_common.h index 6ecb4cc8c..884939675 100644 --- a/hal/i2c_common.h +++ b/hal/i2c_common.h @@ -7,7 +7,7 @@ #ifndef I2C_COMMON_H_ #define I2C_COMMON_H_ -#include "../Drivers/Super/driver_super.h" +#include "../Drivers/driver_super.h" #include "i2c.h" /** diff --git a/tlm-cmd-code-generator/my_mod/tlm_buffer.py b/tlm-cmd-code-generator/my_mod/tlm_buffer.py index c151770bf..d963d7bf4 100644 --- a/tlm-cmd-code-generator/my_mod/tlm_buffer.py +++ b/tlm-cmd-code-generator/my_mod/tlm_buffer.py @@ -368,7 +368,7 @@ def OutputTlmBufferC_(file_path, name, body, settings): * @brief テレメトリバッファー(テレメ中継) * @note このコードは自動生成されています! */ -#include +#include #include "./{_obc_name_lower}_telemetry_definitions.h" #include "./{_obc_name_lower}_telemetry_buffer.h" #include "./{_obc_name_lower}.h" @@ -410,7 +410,7 @@ def OutputTlmBufferH_(file_path, name, body, settings): #define {_obc_name_upper}_TELEMETRY_BUFFER_H_ #include "./{_obc_name_lower}_telemetry_definitions.h" -#include +#include #include #include From 9cddbf59f02e795363c333bc71a48aaf9e23e1a5 Mon Sep 17 00:00:00 2001 From: sksat Date: Wed, 11 Oct 2023 18:29:55 +0900 Subject: [PATCH 2/7] rename Drivers dir to snake case --- CMakeLists.txt | 8 ++++---- .../common_tlm_cmd_packet_for_driver_super.c | 0 .../common_tlm_cmd_packet_for_driver_super.h | 0 {Drivers => drivers}/data_link_layer_definition.h | 0 {Drivers => drivers}/driver_super.c | 0 {Drivers => drivers}/driver_super.h | 0 {Drivers => drivers}/eb90_frame_for_driver_super.c | 0 {Drivers => drivers}/eb90_frame_for_driver_super.h | 0 {Drivers => drivers}/eb90_packet_for_driver_super.c | 0 {Drivers => drivers}/eb90_packet_for_driver_super.h | 0 enum-loader/c2aenum/enum_loader.py | 2 +- hal/i2c_common.h | 2 +- script/add_section/settings.pl | 2 +- script/ci/check_encoding.json | 2 +- tlm-cmd-code-generator/my_mod/cmd_def.py | 2 +- tlm-cmd-code-generator/my_mod/tlm_buffer.py | 6 +++--- tlm-cmd-code-generator/my_mod/tlm_def.py | 2 +- 17 files changed, 13 insertions(+), 13 deletions(-) rename {Drivers => drivers}/common_tlm_cmd_packet_for_driver_super.c (100%) rename {Drivers => drivers}/common_tlm_cmd_packet_for_driver_super.h (100%) rename {Drivers => drivers}/data_link_layer_definition.h (100%) rename {Drivers => drivers}/driver_super.c (100%) rename {Drivers => drivers}/driver_super.h (100%) rename {Drivers => drivers}/eb90_frame_for_driver_super.c (100%) rename {Drivers => drivers}/eb90_frame_for_driver_super.h (100%) rename {Drivers => drivers}/eb90_packet_for_driver_super.c (100%) rename {Drivers => drivers}/eb90_packet_for_driver_super.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85af8a9ff..636dd7caa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,10 +26,10 @@ set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(C2A_SRCS c2a_core_main.c - Drivers/common_tlm_cmd_packet_for_driver_super.c - Drivers/eb90_frame_for_driver_super.c - Drivers/eb90_packet_for_driver_super.c - Drivers/driver_super.c + drivers/common_tlm_cmd_packet_for_driver_super.c + drivers/eb90_frame_for_driver_super.c + drivers/eb90_packet_for_driver_super.c + drivers/driver_super.c hal/i2c_common.c system/application_manager/app_info.c system/application_manager/app_manager.c diff --git a/Drivers/common_tlm_cmd_packet_for_driver_super.c b/drivers/common_tlm_cmd_packet_for_driver_super.c similarity index 100% rename from Drivers/common_tlm_cmd_packet_for_driver_super.c rename to drivers/common_tlm_cmd_packet_for_driver_super.c diff --git a/Drivers/common_tlm_cmd_packet_for_driver_super.h b/drivers/common_tlm_cmd_packet_for_driver_super.h similarity index 100% rename from Drivers/common_tlm_cmd_packet_for_driver_super.h rename to drivers/common_tlm_cmd_packet_for_driver_super.h diff --git a/Drivers/data_link_layer_definition.h b/drivers/data_link_layer_definition.h similarity index 100% rename from Drivers/data_link_layer_definition.h rename to drivers/data_link_layer_definition.h diff --git a/Drivers/driver_super.c b/drivers/driver_super.c similarity index 100% rename from Drivers/driver_super.c rename to drivers/driver_super.c diff --git a/Drivers/driver_super.h b/drivers/driver_super.h similarity index 100% rename from Drivers/driver_super.h rename to drivers/driver_super.h diff --git a/Drivers/eb90_frame_for_driver_super.c b/drivers/eb90_frame_for_driver_super.c similarity index 100% rename from Drivers/eb90_frame_for_driver_super.c rename to drivers/eb90_frame_for_driver_super.c diff --git a/Drivers/eb90_frame_for_driver_super.h b/drivers/eb90_frame_for_driver_super.h similarity index 100% rename from Drivers/eb90_frame_for_driver_super.h rename to drivers/eb90_frame_for_driver_super.h diff --git a/Drivers/eb90_packet_for_driver_super.c b/drivers/eb90_packet_for_driver_super.c similarity index 100% rename from Drivers/eb90_packet_for_driver_super.c rename to drivers/eb90_packet_for_driver_super.c diff --git a/Drivers/eb90_packet_for_driver_super.h b/drivers/eb90_packet_for_driver_super.h similarity index 100% rename from Drivers/eb90_packet_for_driver_super.h rename to drivers/eb90_packet_for_driver_super.h diff --git a/enum-loader/c2aenum/enum_loader.py b/enum-loader/c2aenum/enum_loader.py index 7c08913db..8b6dfb6f7 100644 --- a/enum-loader/c2aenum/enum_loader.py +++ b/enum-loader/c2aenum/enum_loader.py @@ -12,7 +12,7 @@ def __init__(self, c2a_src_path, encoding): self.search_dirs = [ "/src_user/", "/src_core/applications/", - "/src_core/Drivers/", + "/src_core/drivers/", "/src_core/hal/", "/src_core/library/", "/src_core/system/", diff --git a/hal/i2c_common.h b/hal/i2c_common.h index 884939675..e91290afe 100644 --- a/hal/i2c_common.h +++ b/hal/i2c_common.h @@ -7,7 +7,7 @@ #ifndef I2C_COMMON_H_ #define I2C_COMMON_H_ -#include "../Drivers/driver_super.h" +#include "../drivers/driver_super.h" #include "i2c.h" /** diff --git a/script/add_section/settings.pl b/script/add_section/settings.pl index 0e3342f33..ae3980d38 100644 --- a/script/add_section/settings.pl +++ b/script/add_section/settings.pl @@ -17,7 +17,7 @@ sub GetSetting { $SETTING{'LOG_FILE'} = './log.log'; $SETTING{'SEARCH_PATH'} = [ 'applications', - 'Drivers', + 'drivers', 'hal', 'library', 'System', diff --git a/script/ci/check_encoding.json b/script/ci/check_encoding.json index fa90c2a64..7a4e5635d 100644 --- a/script/ci/check_encoding.json +++ b/script/ci/check_encoding.json @@ -32,7 +32,7 @@ }, "target_dirs" : [ "applications/", - "Drivers/", + "drivers/", "hal/", "library/", "System/", diff --git a/tlm-cmd-code-generator/my_mod/cmd_def.py b/tlm-cmd-code-generator/my_mod/cmd_def.py index 1b2f24b93..4d742d79e 100644 --- a/tlm-cmd-code-generator/my_mod/cmd_def.py +++ b/tlm-cmd-code-generator/my_mod/cmd_def.py @@ -165,7 +165,7 @@ def GenerateOtherObcCmdDef(settings, other_obc_dbs): # print(body_h) output_file_path = ( settings["path_to_src"] - + r"src_user/Drivers/" + + r"src_user/drivers/" + settings["other_obc_data"][i]["driver_path"] + name_lower + "_command_definitions.h" diff --git a/tlm-cmd-code-generator/my_mod/tlm_buffer.py b/tlm-cmd-code-generator/my_mod/tlm_buffer.py index d963d7bf4..cf7eb0cb9 100644 --- a/tlm-cmd-code-generator/my_mod/tlm_buffer.py +++ b/tlm-cmd-code-generator/my_mod/tlm_buffer.py @@ -338,7 +338,7 @@ def GenerateTlmBuffer(settings, other_obc_dbs): output_file_path = ( settings["path_to_src"] - + r"src_user/Drivers/" + + r"src_user/drivers/" + settings["other_obc_data"][i]["driver_path"] ) OutputTlmBufferC_( @@ -368,7 +368,7 @@ def OutputTlmBufferC_(file_path, name, body, settings): * @brief テレメトリバッファー(テレメ中継) * @note このコードは自動生成されています! */ -#include +#include #include "./{_obc_name_lower}_telemetry_definitions.h" #include "./{_obc_name_lower}_telemetry_buffer.h" #include "./{_obc_name_lower}.h" @@ -410,7 +410,7 @@ def OutputTlmBufferH_(file_path, name, body, settings): #define {_obc_name_upper}_TELEMETRY_BUFFER_H_ #include "./{_obc_name_lower}_telemetry_definitions.h" -#include +#include #include #include diff --git a/tlm-cmd-code-generator/my_mod/tlm_def.py b/tlm-cmd-code-generator/my_mod/tlm_def.py index 4fa64719d..c4a876d4d 100644 --- a/tlm-cmd-code-generator/my_mod/tlm_def.py +++ b/tlm-cmd-code-generator/my_mod/tlm_def.py @@ -138,7 +138,7 @@ def GenerateOtherObcTlmDef(settings, other_obc_dbs): ) output_file_path = ( settings["path_to_src"] - + r"src_user/Drivers/" + + r"src_user/drivers/" + settings["other_obc_data"][i]["driver_path"] + obc_name.lower() + "_telemetry_definitions.h" From 931cb3fcbb2e995fa2649448bcd5bcaeb443b380 Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 12 Oct 2023 16:29:34 +0900 Subject: [PATCH 3/7] make driver dir name singular --- CMakeLists.txt | 8 ++++---- .../common_tlm_cmd_packet_for_driver_super.c | 0 .../common_tlm_cmd_packet_for_driver_super.h | 0 {drivers => driver}/data_link_layer_definition.h | 0 {drivers => driver}/driver_super.c | 0 {drivers => driver}/driver_super.h | 0 {drivers => driver}/eb90_frame_for_driver_super.c | 0 {drivers => driver}/eb90_frame_for_driver_super.h | 0 {drivers => driver}/eb90_packet_for_driver_super.c | 0 {drivers => driver}/eb90_packet_for_driver_super.h | 0 enum-loader/c2aenum/enum_loader.py | 2 +- hal/i2c_common.h | 2 +- script/add_section/settings.pl | 2 +- script/ci/check_encoding.json | 2 +- tlm-cmd-code-generator/my_mod/cmd_def.py | 2 +- tlm-cmd-code-generator/my_mod/tlm_buffer.py | 6 +++--- tlm-cmd-code-generator/my_mod/tlm_def.py | 2 +- 17 files changed, 13 insertions(+), 13 deletions(-) rename {drivers => driver}/common_tlm_cmd_packet_for_driver_super.c (100%) rename {drivers => driver}/common_tlm_cmd_packet_for_driver_super.h (100%) rename {drivers => driver}/data_link_layer_definition.h (100%) rename {drivers => driver}/driver_super.c (100%) rename {drivers => driver}/driver_super.h (100%) rename {drivers => driver}/eb90_frame_for_driver_super.c (100%) rename {drivers => driver}/eb90_frame_for_driver_super.h (100%) rename {drivers => driver}/eb90_packet_for_driver_super.c (100%) rename {drivers => driver}/eb90_packet_for_driver_super.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 636dd7caa..3102987f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,10 +26,10 @@ set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(C2A_SRCS c2a_core_main.c - drivers/common_tlm_cmd_packet_for_driver_super.c - drivers/eb90_frame_for_driver_super.c - drivers/eb90_packet_for_driver_super.c - drivers/driver_super.c + driver/common_tlm_cmd_packet_for_driver_super.c + driver/eb90_frame_for_driver_super.c + driver/eb90_packet_for_driver_super.c + driver/driver_super.c hal/i2c_common.c system/application_manager/app_info.c system/application_manager/app_manager.c diff --git a/drivers/common_tlm_cmd_packet_for_driver_super.c b/driver/common_tlm_cmd_packet_for_driver_super.c similarity index 100% rename from drivers/common_tlm_cmd_packet_for_driver_super.c rename to driver/common_tlm_cmd_packet_for_driver_super.c diff --git a/drivers/common_tlm_cmd_packet_for_driver_super.h b/driver/common_tlm_cmd_packet_for_driver_super.h similarity index 100% rename from drivers/common_tlm_cmd_packet_for_driver_super.h rename to driver/common_tlm_cmd_packet_for_driver_super.h diff --git a/drivers/data_link_layer_definition.h b/driver/data_link_layer_definition.h similarity index 100% rename from drivers/data_link_layer_definition.h rename to driver/data_link_layer_definition.h diff --git a/drivers/driver_super.c b/driver/driver_super.c similarity index 100% rename from drivers/driver_super.c rename to driver/driver_super.c diff --git a/drivers/driver_super.h b/driver/driver_super.h similarity index 100% rename from drivers/driver_super.h rename to driver/driver_super.h diff --git a/drivers/eb90_frame_for_driver_super.c b/driver/eb90_frame_for_driver_super.c similarity index 100% rename from drivers/eb90_frame_for_driver_super.c rename to driver/eb90_frame_for_driver_super.c diff --git a/drivers/eb90_frame_for_driver_super.h b/driver/eb90_frame_for_driver_super.h similarity index 100% rename from drivers/eb90_frame_for_driver_super.h rename to driver/eb90_frame_for_driver_super.h diff --git a/drivers/eb90_packet_for_driver_super.c b/driver/eb90_packet_for_driver_super.c similarity index 100% rename from drivers/eb90_packet_for_driver_super.c rename to driver/eb90_packet_for_driver_super.c diff --git a/drivers/eb90_packet_for_driver_super.h b/driver/eb90_packet_for_driver_super.h similarity index 100% rename from drivers/eb90_packet_for_driver_super.h rename to driver/eb90_packet_for_driver_super.h diff --git a/enum-loader/c2aenum/enum_loader.py b/enum-loader/c2aenum/enum_loader.py index 8b6dfb6f7..e9dcb7f4f 100644 --- a/enum-loader/c2aenum/enum_loader.py +++ b/enum-loader/c2aenum/enum_loader.py @@ -12,7 +12,7 @@ def __init__(self, c2a_src_path, encoding): self.search_dirs = [ "/src_user/", "/src_core/applications/", - "/src_core/drivers/", + "/src_core/driver/", "/src_core/hal/", "/src_core/library/", "/src_core/system/", diff --git a/hal/i2c_common.h b/hal/i2c_common.h index e91290afe..88660ace9 100644 --- a/hal/i2c_common.h +++ b/hal/i2c_common.h @@ -7,7 +7,7 @@ #ifndef I2C_COMMON_H_ #define I2C_COMMON_H_ -#include "../drivers/driver_super.h" +#include "../driver/driver_super.h" #include "i2c.h" /** diff --git a/script/add_section/settings.pl b/script/add_section/settings.pl index ae3980d38..492c46415 100644 --- a/script/add_section/settings.pl +++ b/script/add_section/settings.pl @@ -17,7 +17,7 @@ sub GetSetting { $SETTING{'LOG_FILE'} = './log.log'; $SETTING{'SEARCH_PATH'} = [ 'applications', - 'drivers', + 'driver', 'hal', 'library', 'System', diff --git a/script/ci/check_encoding.json b/script/ci/check_encoding.json index 7a4e5635d..7011c552f 100644 --- a/script/ci/check_encoding.json +++ b/script/ci/check_encoding.json @@ -32,7 +32,7 @@ }, "target_dirs" : [ "applications/", - "drivers/", + "driver/", "hal/", "library/", "System/", diff --git a/tlm-cmd-code-generator/my_mod/cmd_def.py b/tlm-cmd-code-generator/my_mod/cmd_def.py index 4d742d79e..bcc820c84 100644 --- a/tlm-cmd-code-generator/my_mod/cmd_def.py +++ b/tlm-cmd-code-generator/my_mod/cmd_def.py @@ -165,7 +165,7 @@ def GenerateOtherObcCmdDef(settings, other_obc_dbs): # print(body_h) output_file_path = ( settings["path_to_src"] - + r"src_user/drivers/" + + r"src_user/driver/" + settings["other_obc_data"][i]["driver_path"] + name_lower + "_command_definitions.h" diff --git a/tlm-cmd-code-generator/my_mod/tlm_buffer.py b/tlm-cmd-code-generator/my_mod/tlm_buffer.py index cf7eb0cb9..6151d125a 100644 --- a/tlm-cmd-code-generator/my_mod/tlm_buffer.py +++ b/tlm-cmd-code-generator/my_mod/tlm_buffer.py @@ -338,7 +338,7 @@ def GenerateTlmBuffer(settings, other_obc_dbs): output_file_path = ( settings["path_to_src"] - + r"src_user/drivers/" + + r"src_user/driver/" + settings["other_obc_data"][i]["driver_path"] ) OutputTlmBufferC_( @@ -368,7 +368,7 @@ def OutputTlmBufferC_(file_path, name, body, settings): * @brief テレメトリバッファー(テレメ中継) * @note このコードは自動生成されています! */ -#include +#include #include "./{_obc_name_lower}_telemetry_definitions.h" #include "./{_obc_name_lower}_telemetry_buffer.h" #include "./{_obc_name_lower}.h" @@ -410,7 +410,7 @@ def OutputTlmBufferH_(file_path, name, body, settings): #define {_obc_name_upper}_TELEMETRY_BUFFER_H_ #include "./{_obc_name_lower}_telemetry_definitions.h" -#include +#include #include #include diff --git a/tlm-cmd-code-generator/my_mod/tlm_def.py b/tlm-cmd-code-generator/my_mod/tlm_def.py index c4a876d4d..b27a6d8fd 100644 --- a/tlm-cmd-code-generator/my_mod/tlm_def.py +++ b/tlm-cmd-code-generator/my_mod/tlm_def.py @@ -138,7 +138,7 @@ def GenerateOtherObcTlmDef(settings, other_obc_dbs): ) output_file_path = ( settings["path_to_src"] - + r"src_user/drivers/" + + r"src_user/driver/" + settings["other_obc_data"][i]["driver_path"] + obc_name.lower() + "_telemetry_definitions.h" From c96a877f093987b8abe2b7f867ae40c5cf0c666c Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 12 Oct 2023 17:50:36 +0900 Subject: [PATCH 4/7] add Driver rename migration script --- script/migration/v4-rename-driver.sh | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 script/migration/v4-rename-driver.sh diff --git a/script/migration/v4-rename-driver.sh b/script/migration/v4-rename-driver.sh new file mode 100755 index 000000000..922501437 --- /dev/null +++ b/script/migration/v4-rename-driver.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Script -> script + +## c2a-core ref +echo "rename c2a-core ref: Drivers -> driver" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Drivers/Super#src_core/driver#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Drivers\\\Super#src_core\\\driver#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Drivers/Protocol#src_core/driver#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Drivers\\\Protocol#src_core\\\driver#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Drivers#src_core/driver#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Drivers#src_core\\\driver#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/Drivers#\${C2A_CORE_DIR}/driver#g" + +# C2A user code +echo "rename C2A user code: Drivers -> driver" +mv src/src_user/Drivers src/src_user/driver + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_USER_DIR}/Drivers#\${C2A_USER_DIR}/driver#g" + +drv_org=("Aocs" "Cdh" "Com" "Etc" "Mission" "Power" "Prop" "Thermal") +drv_new=("aocs" "cdh" "com" "etc" "mission" "power" "prop" "thermal") + +echo "rename dir: driver/Drivers -> driver/driver" +for ((i=0; i<${#drv_org[@]}; i++)); do + echo " driver/${drv_org[i]} -> driver/${drv_new[i]}" + mv src/src_user/driver/${drv_org[i]} src/src_user/driver/${drv_new[i]} +done + +echo "rename ref: Drivers -> driver" +for ((i=0; i<${#drv_org[@]}; i++)); do + echo " Driver/${drv_org[i]} -> driver/${drv_new[i]}" + + find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Drivers/${drv_org[i]}#driver/${drv_new[i]}#g" + find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Drivers\\\${drv_org}#driver\\\${drv_new}#g" +done + +# CMake +for ((i=0; i<${#drv_org[@]}; i++)); do + echo "rename ref: ${drv_org[i]} -> ${drv_new[i]}" + + find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#${drv_org[i]}/#${drv_new[i]}/#g" +done + +# Script +find src/src_user/script -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Drivers#driver#g" From 4e29b377df0da0c2ff68f7df27b9918194dbbf38 Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 12 Oct 2023 18:46:17 +0900 Subject: [PATCH 5/7] update tlm-cmd-code-generator setting path --- tlm-cmd-code-generator/settings_mobc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tlm-cmd-code-generator/settings_mobc.json b/tlm-cmd-code-generator/settings_mobc.json index 77d219cbe..ed65fe85e 100644 --- a/tlm-cmd-code-generator/settings_mobc.json +++ b/tlm-cmd-code-generator/settings_mobc.json @@ -17,7 +17,7 @@ "input_file_encoding" : "utf-8", "path_to_db" : "../examples/subobc/src/src_user/Settings/tlm_cmd/data_base/", "max_tlm_num" : 256, - "driver_path" : "Aocs/", + "driver_path" : "aocs/", "driver_type" : "AOBC_Driver", "driver_name" : "aobc_driver", "code_when_tlm_not_found" : "aobc_driver->info.comm.rx_err_code = AOBC_RX_ERR_CODE_TLM_NOT_FOUND;" From a0a84fb7738110ea90c9a7da8be66dded6bba9f1 Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 12 Oct 2023 23:30:46 +0900 Subject: [PATCH 6/7] update docs link for Drivers -> driver rename --- docs/driver/overview.md | 14 +++++++------- docs/tips/parameter_settings.md | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/driver/overview.md b/docs/driver/overview.md index c0b34fd10..3b87b605b 100644 --- a/docs/driver/overview.md +++ b/docs/driver/overview.md @@ -3,17 +3,17 @@ ## Driver ### 概要 Driver とは,各コンポーネントとの通信において, HW 依存部分を吸収するためのレイヤーである. -[DriverSuper](https://github.com/arkedge/c2a-core/blob/develop/Drivers/Super/) と呼ばれる共通の IF を各ドライバが継承することで,統一的で安全な実装が可能になる. +[DriverSuper](https://github.com/arkedge/c2a-core/blob/develop/driver/driver_super.h) と呼ばれる共通の IF を各ドライバが継承することで,統一的で安全な実装が可能になる. また,これを Application へと抽象化したものが, Application Layer にある DI (Driver Instance) である. -実装方法は,基本的には [driver_super.h](https://github.com/arkedge/c2a-core/blob/develop/Drivers/Super/driver_super.h) をみればわかるようにしてあるが,現時点で +実装方法は,基本的には [driver_super.h](https://github.com/arkedge/c2a-core/blob/develop/driver/driver_super.h) をみればわかるようにしてあるが,現時点で -- UART test: https://github.com/arkedge/c2a-core/blob/develop/examples/mobc/src/src_user/Drivers/Etc/uart_test.c -- GS: https://github.com/arkedge/c2a-core/blob/develop/examples/mobc/src/src_user/Drivers/Com/gs.c +- UART test: https://github.com/arkedge/c2a-core/blob/develop/examples/mobc/src/src_user/driver/etc/uart_test.c +- GS: https://github.com/arkedge/c2a-core/blob/develop/examples/mobc/src/src_user/driver/com/gs.c - C2A 間通信: - - https://github.com/arkedge/c2a-core/blob/develop/examples/mobc/src/src_user/Drivers/Aocs/aobc.c - - https://github.com/arkedge/c2a-core/blob/develop/examples/subobc/src/src_user/Drivers/Etc/mobc.c + - https://github.com/arkedge/c2a-core/blob/develop/examples/mobc/src/src_user/driver/aocs/aobc.c + - https://github.com/arkedge/c2a-core/blob/develop/examples/subobc/src/src_user/driver/etc/mobc.c が実装されているので,それを参考のこと. `load_init_setting` については下を参照. @@ -43,7 +43,7 @@ typedef struct ## DriverSuper ### テレメとしておろしてもいいのではないかなと思う DriverSuper のメンバ -[driver_super.h](https://github.com/arkedge/c2a-core/blob/develop/Drivers/Super/driver_super.h) のメンバから抜粋する. +[driver_super.h](https://github.com/arkedge/c2a-core/blob/develop/driver/driver_super.h) のメンバから抜粋する. `DriverSuper` の最上位には特に重要な情報はないので, `DriverSuper` の使っているstreamの `stream_config` のメンバを下ろす. 具体的には以下.( FIXME: 2021/12/04 現在,だいぶ情報が古い) diff --git a/docs/tips/parameter_settings.md b/docs/tips/parameter_settings.md index 82527c490..d1b5bc828 100644 --- a/docs/tips/parameter_settings.md +++ b/docs/tips/parameter_settings.md @@ -145,11 +145,11 @@ DriverSuperを継承したDriver数: 4 ``` #### 定義 -- core: [`/src_core/Drivers/Super/DriverSuper.h`](https://github.com/arkedge/c2a-core/blob/develop/Drivers/Super/DriverSuper.h) +- core: [`/src_core/driver/driver_super.h`](https://github.com/arkedge/c2a-core/blob/develop/driver/driver_super.h) - user: `/src_user/Settings/DriverSuper/driver_super_params.h` #### 詳細説明 -[`/src_core/Drivers/Super/DriverSuper.h`](https://github.com/arkedge/c2a-core/blob/develop/Drivers/Super/DriverSuper.h) を参照. +[`/src_core/driver/Super/DriverSuper.h`](https://github.com/arkedge/c2a-core/blob/develop/driver/driver_super.h) を参照. ## メモリ使用量にあまり影響しない設定 From 79ca001781835af0d734162352eeff03395195aa Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 12 Oct 2023 23:31:22 +0900 Subject: [PATCH 7/7] Update README.md --- tlm-cmd-code-generator/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tlm-cmd-code-generator/README.md b/tlm-cmd-code-generator/README.md index c779baec9..7c5bfea01 100644 --- a/tlm-cmd-code-generator/README.md +++ b/tlm-cmd-code-generator/README.md @@ -59,7 +59,7 @@ $ python GenerateC2ACode.py "path_to_db" : "../../c2a_sample_aobc/database/", # MOBC で保持するテレメの TLM ID の最大値(=テレメ種類数) "max_tlm_num" : 256, - "driver_path" : "Aocs/", + "driver_path" : "aocs/", "driver_type" : "AOBC_Driver", "driver_name" : "aobc", "code_when_tlm_not_found" : "aobc_driver->info.comm.rx_err_code = AOBC_RX_ERR_CODE_TLM_NOT_FOUND;" @@ -77,7 +77,7 @@ $ python GenerateC2ACode.py "path_to_db" : ""../../c2a_sample_tobc/database/", # MOBC で保持するテレメの TLM ID の最大値(=テレメ種類数) "max_tlm_num" : 256, - "driver_path" : "Thermal/", + "driver_path" : "thermal/", "driver_type" : "TOBC_Driver", "driver_name" : "tobc", "code_when_tlm_not_found" : "tobc_driver->info.comm.rx_err_code = TOBC_RX_ERR_CODE_TLM_NOT_FOUND;"