diff --git a/CMakeLists.txt b/CMakeLists.txt index b02d7e458..ecb9a12c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,12 +79,12 @@ endif() add_library(${PROJECT_NAME} OBJECT ${C2A_SRCS}) if(USE_ALL_C2A_CORE_APPS) - add_subdirectory(Applications) + add_subdirectory(applications) target_sources(${PROJECT_NAME} PUBLIC $) endif() if(USE_ALL_C2A_CORE_TEST_APPS) - add_subdirectory(Applications/TestApp) + add_subdirectory(applications/test_app) target_sources(${PROJECT_NAME} PUBLIC $) endif() diff --git a/System/ApplicationManager/app_manager.c b/System/ApplicationManager/app_manager.c index 34d93cb19..6ee077794 100644 --- a/System/ApplicationManager/app_manager.c +++ b/System/ApplicationManager/app_manager.c @@ -8,7 +8,7 @@ #include #include -#include "../../Applications/nop.h" +#include "../../applications/nop.h" #include "../EventManager/event_logger.h" #include "../TimeManager/time_manager.h" #include "../WatchdogTimer/watchdog_timer.h" diff --git a/System/EventManager/event_handler.c b/System/EventManager/event_handler.c index afde3f4d6..d22f10912 100644 --- a/System/EventManager/event_handler.c +++ b/System/EventManager/event_handler.c @@ -8,7 +8,7 @@ #include #include #include "../../TlmCmd/common_cmd_packet_util.h" -#include "../../Applications/timeline_command_dispatcher_id_define.h" +#include "../../applications/timeline_command_dispatcher_id_define.h" #include "../TimeManager/time_manager.h" #ifdef EL_IS_ENABLE_TLOG diff --git a/System/ModeManager/mode_manager.c b/System/ModeManager/mode_manager.c index 1a7f1111c..08764edd5 100644 --- a/System/ModeManager/mode_manager.c +++ b/System/ModeManager/mode_manager.c @@ -14,7 +14,7 @@ #include "../../TlmCmd/common_cmd_packet_util.h" #include #include "../../TlmCmd/packet_handler.h" -#include "../../Applications/timeline_command_dispatcher_id_define.h" +#include "../../applications/timeline_command_dispatcher_id_define.h" #include "../../Library/endian.h" /** diff --git a/TlmCmd/block_command_loader.c b/TlmCmd/block_command_loader.c index c5d6d0331..3e74e33ea 100644 --- a/TlmCmd/block_command_loader.c +++ b/TlmCmd/block_command_loader.c @@ -9,7 +9,7 @@ #include #include "block_command_loader.h" -#include "../Applications/timeline_command_dispatcher_id_define.h" +#include "../applications/timeline_command_dispatcher_id_define.h" #include "block_command_executor.h" #include // for rotate/combine block #include "common_cmd_packet_util.h" diff --git a/TlmCmd/block_command_loader.h b/TlmCmd/block_command_loader.h index d0a34828d..3d53d939a 100644 --- a/TlmCmd/block_command_loader.h +++ b/TlmCmd/block_command_loader.h @@ -9,9 +9,9 @@ #define BLOCK_COMMAND_LOADER_H_ #include "./block_command_table.h" -#include "../Applications/timeline_command_dispatcher_id_define.h" +#include "../applications/timeline_command_dispatcher_id_define.h" #include "../System/TimeManager/obc_time.h" -#include +#include /** diff --git a/TlmCmd/common_cmd_packet.h b/TlmCmd/common_cmd_packet.h index cadde6930..152197d8e 100644 --- a/TlmCmd/common_cmd_packet.h +++ b/TlmCmd/common_cmd_packet.h @@ -33,7 +33,7 @@ typedef enum #include // TL_MIS を有効にするかどうか -#include +#include /** * @enum CCP_EXEC_STS diff --git a/TlmCmd/common_cmd_packet_util.h b/TlmCmd/common_cmd_packet_util.h index 4775d3b16..d0d89b763 100644 --- a/TlmCmd/common_cmd_packet_util.h +++ b/TlmCmd/common_cmd_packet_util.h @@ -7,9 +7,9 @@ #include "common_cmd_packet.h" #include "packet_handler.h" -#include "../Applications/timeline_command_dispatcher_id_define.h" +#include "../applications/timeline_command_dispatcher_id_define.h" #include "block_command_table.h" // for bct_id -#include +#include /** * @enum CCP_UTIL_ACK diff --git a/TlmCmd/packet_handler.h b/TlmCmd/packet_handler.h index 6ef225cc6..ea99c6128 100644 --- a/TlmCmd/packet_handler.h +++ b/TlmCmd/packet_handler.h @@ -7,7 +7,7 @@ #include "common_tlm_cmd_packet.h" #include "packet_list.h" -#include "../Applications/timeline_command_dispatcher_id_define.h" +#include "../applications/timeline_command_dispatcher_id_define.h" #define TL_TLM_PAGE_SIZE (32) #define TL_TLM_PAGE_MAX (8) diff --git a/Applications/CMakeLists.txt b/applications/CMakeLists.txt similarity index 100% rename from Applications/CMakeLists.txt rename to applications/CMakeLists.txt diff --git a/Applications/divided_cmd_utility.c b/applications/divided_cmd_utility.c similarity index 100% rename from Applications/divided_cmd_utility.c rename to applications/divided_cmd_utility.c diff --git a/Applications/divided_cmd_utility.h b/applications/divided_cmd_utility.h similarity index 99% rename from Applications/divided_cmd_utility.h rename to applications/divided_cmd_utility.h index 253a5c7bd..e314fb405 100644 --- a/Applications/divided_cmd_utility.h +++ b/applications/divided_cmd_utility.h @@ -21,7 +21,7 @@ #define DCU_LOG_MAX (16) //!< 保存するログの最大数 // DCU_LOG_MAX の user オーバーライド -#include +#include // key が uint8_t なので,それ以下を要請する #if DCU_LOG_MAX > 255 diff --git a/Applications/event_utility.c b/applications/event_utility.c similarity index 100% rename from Applications/event_utility.c rename to applications/event_utility.c diff --git a/Applications/event_utility.h b/applications/event_utility.h similarity index 100% rename from Applications/event_utility.h rename to applications/event_utility.h diff --git a/Applications/gs_command_dispatcher.c b/applications/gs_command_dispatcher.c similarity index 100% rename from Applications/gs_command_dispatcher.c rename to applications/gs_command_dispatcher.c diff --git a/Applications/gs_command_dispatcher.h b/applications/gs_command_dispatcher.h similarity index 100% rename from Applications/gs_command_dispatcher.h rename to applications/gs_command_dispatcher.h diff --git a/Applications/memory_dump.c b/applications/memory_dump.c similarity index 100% rename from Applications/memory_dump.c rename to applications/memory_dump.c diff --git a/Applications/memory_dump.h b/applications/memory_dump.h similarity index 100% rename from Applications/memory_dump.h rename to applications/memory_dump.h diff --git a/Applications/nop.c b/applications/nop.c similarity index 100% rename from Applications/nop.c rename to applications/nop.c diff --git a/Applications/nop.h b/applications/nop.h similarity index 100% rename from Applications/nop.h rename to applications/nop.h diff --git a/Applications/realtime_command_dispatcher.c b/applications/realtime_command_dispatcher.c similarity index 100% rename from Applications/realtime_command_dispatcher.c rename to applications/realtime_command_dispatcher.c diff --git a/Applications/realtime_command_dispatcher.h b/applications/realtime_command_dispatcher.h similarity index 100% rename from Applications/realtime_command_dispatcher.h rename to applications/realtime_command_dispatcher.h diff --git a/Applications/telemetry_manager.c b/applications/telemetry_manager.c similarity index 99% rename from Applications/telemetry_manager.c rename to applications/telemetry_manager.c index 3ff65139a..a35683df5 100644 --- a/Applications/telemetry_manager.c +++ b/applications/telemetry_manager.c @@ -34,8 +34,8 @@ #define TLM_MGR_BC_ROLE_AT_BC_9 (TLM_MGR_BC_ROLE_LOW_FREQ_TLM) // TLM_MGR_BC_ROLE_HIGH_FREQ_TLM が固まらないようにここに入れている // user 設定 -#include -#include +#include +#include // 現状, BC#9 は low ではないとだめ (deploy と combine するため) #if !(TLM_MGR_BC_ROLE_AT_BC_9 == TLM_MGR_BC_ROLE_LOW_FREQ_TLM) diff --git a/Applications/telemetry_manager.h b/applications/telemetry_manager.h similarity index 100% rename from Applications/telemetry_manager.h rename to applications/telemetry_manager.h diff --git a/Applications/TestApp/CMakeLists.txt b/applications/test_app/CMakeLists.txt similarity index 100% rename from Applications/TestApp/CMakeLists.txt rename to applications/test_app/CMakeLists.txt diff --git a/Applications/TestApp/test_ccp_util.c b/applications/test_app/test_ccp_util.c similarity index 100% rename from Applications/TestApp/test_ccp_util.c rename to applications/test_app/test_ccp_util.c diff --git a/Applications/TestApp/test_ccp_util.h b/applications/test_app/test_ccp_util.h similarity index 100% rename from Applications/TestApp/test_ccp_util.h rename to applications/test_app/test_ccp_util.h diff --git a/Applications/timeline_command_dispatcher.c b/applications/timeline_command_dispatcher.c similarity index 100% rename from Applications/timeline_command_dispatcher.c rename to applications/timeline_command_dispatcher.c diff --git a/Applications/timeline_command_dispatcher.h b/applications/timeline_command_dispatcher.h similarity index 100% rename from Applications/timeline_command_dispatcher.h rename to applications/timeline_command_dispatcher.h diff --git a/Applications/timeline_command_dispatcher_id_define.h b/applications/timeline_command_dispatcher_id_define.h similarity index 90% rename from Applications/timeline_command_dispatcher_id_define.h rename to applications/timeline_command_dispatcher_id_define.h index 53bbcb9a4..355b74475 100644 --- a/Applications/timeline_command_dispatcher_id_define.h +++ b/applications/timeline_command_dispatcher_id_define.h @@ -6,7 +6,7 @@ #ifndef TIMELINE_COMMAND_DISPATCHER_ID_DEFINE_H_ #define TIMELINE_COMMAND_DISPATCHER_ID_DEFINE_H_ -#include +#include /** * @enum TLCD_ID diff --git a/Applications/utility_command.c b/applications/utility_command.c similarity index 100% rename from Applications/utility_command.c rename to applications/utility_command.c diff --git a/Applications/utility_command.h b/applications/utility_command.h similarity index 100% rename from Applications/utility_command.h rename to applications/utility_command.h diff --git a/Applications/utility_counter.c b/applications/utility_counter.c similarity index 100% rename from Applications/utility_counter.c rename to applications/utility_counter.c diff --git a/Applications/utility_counter.h b/applications/utility_counter.h similarity index 100% rename from Applications/utility_counter.h rename to applications/utility_counter.h diff --git a/c2a_core_main.c b/c2a_core_main.c index 1f76a9d12..42b0a1b33 100644 --- a/c2a_core_main.c +++ b/c2a_core_main.c @@ -14,7 +14,7 @@ #include "./TlmCmd/command_analyze.h" #include "./TlmCmd/telemetry_frame.h" -#include +#include // git revisionをコードに埋め込む const char GIT_REV_CORE[41] = GIT_REVISION_C2A_CORE; diff --git a/docs/general/coding_rule.md b/docs/general/coding_rule.md index 929b26cad..176021dc9 100644 --- a/docs/general/coding_rule.md +++ b/docs/general/coding_rule.md @@ -213,14 +213,14 @@ typedef uint32_t flash_block_t; ## 個別箇所についての命名など [M] -### Applications/UserDefined +### applications/user_defined - ファイル名と AppInfo 構造体名を一致させる(スタイルを除く) - AppInfo 構造体名とそのインスタンス名を一致させる(スタイルを除く) - 接頭辞は, `APP_HOGE` で `HOGE` 部分はケースバイケース. 例: -Applications/UserDefined/data_recorder.c +applications/user_defined/data_recorder.c ```cpp static DataRecorder data_recorder_; const DataRecorder* const data_recorder = &data_recorder_; @@ -232,7 +232,7 @@ AppInfo APP_DR_create_app(void) } ``` -Applications/UserDefined/data_recorder.h +applications/user_defined/data_recorder.h ```cpp #ifndef DATA_RECORDER_H_ #define DATA_RECORDER_H_ @@ -253,7 +253,7 @@ int Cmd_APP_DR_SET_PARAMS(const CommonCmdPacket* packet); ``` -### Applications/DriverInstances +### applications/driver_instances - ファイル名は `di_${IFやデバイス名}` - Driver 構造体名とそのインスタンス名を一致させる(スタイルを除く) - 特定のドライバ構造体のインスタンスが複数ある場合は,配列にまとめる. @@ -292,7 +292,7 @@ RM3100_Driver rm3100_driver[RM3100_IDX_MAX]; ``` -### Applications/Middleware +### applications/middleware - ファイル名は `mw_${IFやデバイス名}` - 接頭辞は `MW_${IFやデバイス名}` @@ -312,7 +312,7 @@ const MwFlash* const mw_flash = &mw_flash_; ``` -### Applications その他 +### applications その他 `AR_APP_ID` enumの接頭辞は, - `AR_NOP`: NOP - `AR_APP_HOGE`: UserDefined @@ -322,8 +322,8 @@ const MwFlash* const mw_flash = &mw_flash_; とし,基本的には `HOGE` は ファイル名にする. つまり, -- Applications/UserDefined/data_recorder.h → `AR_APP_DATA_RECORDER` -- Applications/DriverInstances/di_pcdu.h → `AR_DI_PCDU` +- applications/user_defined/data_recorder.h → `AR_APP_DATA_RECORDER` +- applications/driver_instances/di_pcdu.h → `AR_DI_PCDU` となる. diff --git a/script/add_section/settings.pl b/script/add_section/settings.pl index 5684fabb2..333dfa68a 100644 --- a/script/add_section/settings.pl +++ b/script/add_section/settings.pl @@ -16,7 +16,7 @@ sub GetSetting { $SETTING{'FILE_ENCODING'} = 'utf8'; $SETTING{'LOG_FILE'} = './log.log'; $SETTING{'SEARCH_PATH'} = [ - 'Applications', + 'applications', 'Drivers', 'hal', 'Library', diff --git a/script/ci/check_encoding.json b/script/ci/check_encoding.json index 831faad77..8b4dd6a43 100644 --- a/script/ci/check_encoding.json +++ b/script/ci/check_encoding.json @@ -31,7 +31,7 @@ ] }, "target_dirs" : [ - "Applications/", + "applications/", "Drivers/", "hal/", "Library/", diff --git a/script/migration/v4-rename-applications.sh b/script/migration/v4-rename-applications.sh new file mode 100755 index 000000000..be57b23d5 --- /dev/null +++ b/script/migration/v4-rename-applications.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Script -> script + +## c2a-core ref +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Applications/TestApp#src_core/applications/test_app#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Applications\\\TestApp#src_core\\\applications\\\test_app#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Applications#src_core/applications#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Applications#src_core\\\applications#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/Applications#\${C2A_CORE_DIR}/applications#g" + +# C2A user code +mv src/src_user/Applications src/src_user/applications + +mv src/src_user/applications/DriverInstances src/src_user/applications/driver_instances +mv src/src_user/applications/Middleware src/src_user/applications/middleware +mv src/src_user/applications/UserDefined src/src_user/applications/user_defined + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications/DriverInstances#applications/driver_instances#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications\\\DriverInstances#applications\\\driver_instances#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications/Middleware#applications/middleware#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications\\\Middleware#applications\\\middleware#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications/UserDefined#applications/user_defined#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications\\\UserDefined#applications\\\user_defined#g" + +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#/Applications#/applications#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\\\Applications#\\\applications#g" + +# CMake +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#DriverInstances/#driver_instances/#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Middleware/#middleware/#g" +find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#UserDefined/#user_defined/#g" + +# Settings +mv src/src_user/Settings/Applications src/src_user/Settings/applications + +# Test +mv src/src_user/Test/test/src_core/Applications src/src_user/Test/test/src_core/applications + +mv src/src_user/Test/test/src_user/Applications src/src_user/Test/test/src_user/applications +mv src/src_user/Test/test/src_user/Applications/DriverInstances src/src_user/Test/test/src_user/applications/driver_instances +mv src/src_user/Test/test/src_user/Applications/Middleware src/src_user/Test/test/src_user/applications/middleware +mv src/src_user/Test/test/src_user/Applications/UserDefined src/src_user/Test/test/src_user/applications/user_defined + +# Script +find src/src_user/script -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications#applications#g"