Skip to content

Commit

Permalink
Merge pull request #583 from ut-issl/feature/split-obc-time-config-he…
Browse files Browse the repository at this point in the history
…ader

Split obc time config header
  • Loading branch information
sksat authored May 18, 2023
2 parents aee2044 + 80b3bfc commit 9ed09dd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions System/TaskManager/task_dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "../../TlmCmd/common_cmd_packet_util.h"
#include "../ModeManager/mode_manager.h"
#include "../TimeManager/time_manager.h"
#include "../TimeManager/obc_time_config.h"
#include "../EventManager/event_logger.h"
#include <src_user/TlmCmd/block_command_definitions.h>
#include <src_user/TlmCmd/command_definitions.h>
Expand Down
1 change: 1 addition & 0 deletions System/TimeManager/obc_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @brief OBCの時刻情報の定義と演算
*/
#include "obc_time.h"
#include "obc_time_config.h"
#include "../../Library/print.h"

ObcTime OBCT_create(cycle_t total_cycle,
Expand Down
8 changes: 0 additions & 8 deletions System/TimeManager/obc_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

#include <stdint.h>

// step, cycleについてはTimeManagerを参照のこと
#define OBCT_STEP_IN_MSEC (1) //!< 1 step で何 ms か
#define OBCT_STEPS_PER_CYCLE (100) //!< 何 step で 1 cycle か
#define OBCT_CYCLES_PER_SEC (1000 / OBCT_STEP_IN_MSEC / OBCT_STEPS_PER_CYCLE) //!< 1 s で何 cycle か
#define OBCT_MAX_CYCLE (0xfffffff0u) //!< 最大 cycle 数.つまり TI がいくつでオーバーフローするか

#include <src_user/Settings/System/obc_time_params.h>

typedef uint32_t cycle_t;
typedef uint32_t step_t;

Expand Down
14 changes: 14 additions & 0 deletions System/TimeManager/obc_time_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef OBC_TIME_CONFIG_H_
#define OBC_TIME_CONFIG_H_

// step, cycleについてはTimeManagerを参照のこと
// デフォルト設定
#define OBCT_STEP_IN_MSEC (1) //!< 1 step で何 ms か
#define OBCT_STEPS_PER_CYCLE (100) //!< 何 step で 1 cycle か
#define OBCT_CYCLES_PER_SEC (1000 / OBCT_STEP_IN_MSEC / OBCT_STEPS_PER_CYCLE) //!< 1 s で何 cycle か
#define OBCT_MAX_CYCLE (0xfffffff0u) //!< 最大 cycle 数.つまり TI がいくつでオーバーフローするか

// user 設定
#include <src_user/Settings/System/obc_time_params.h>

#endif // OBC_TIME_CONFIG_H_
1 change: 1 addition & 0 deletions System/TimeManager/time_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @brief OBC時刻のカウントアップと,各種衛星時刻関連処理
*/
#include "time_manager.h"
#include "obc_time_config.h"
#include <string.h>
#include "../../Library/c2a_round.h"
#include "../TaskManager/task_dispatcher.h"
Expand Down

0 comments on commit 9ed09dd

Please sign in to comment.