Skip to content

Commit

Permalink
feat: Add bc_exec_status
Browse files Browse the repository at this point in the history
  • Loading branch information
flap1 committed May 30, 2024
1 parent ca2ef0f commit 6b42b30
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Applications/timeline_command_dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

static TimelineCommandDispatcher timeline_command_dispatcher_;
const TimelineCommandDispatcher* const timeline_command_dispatcher = &timeline_command_dispatcher_;
static BCExecStatus bc_exec_status_;
const BCExecStatus* const bc_exec_status = &bc_exec_status_;
static CommonCmdPacket TLCD_null_packet_;

static void TLCD_gs_init_(void);
Expand Down Expand Up @@ -247,6 +249,7 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet)
{
TLCD_ID id = (TLCD_ID)CCP_get_param_from_packet(packet, 0, uint8_t);
bct_id_t block_no = CCP_get_param_from_packet(packet, 1, bct_id_t);
cycle_t exec_time = TMGR_get_master_total_cycle();
PL_ACK ack;

if (CCP_get_param_len(packet) != (1 + SIZE_OF_BCT_ID_T))
Expand All @@ -268,7 +271,7 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet)
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
}

ack = PL_deploy_block_cmd(&(PH_tl_cmd_list[id]), block_no, TMGR_get_master_total_cycle());
ack = PL_deploy_block_cmd(&(PH_tl_cmd_list[id]), block_no, exec_time);

if (ack == PL_BC_LIST_CLEARED)
{
Expand All @@ -286,6 +289,9 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet)
(uint32_t)( ((0x000000ff & id) << 24) | (0x00ffffff & block_no) ));
if (ack == PL_BC_TIME_ADJUSTED)
{
bc_exec_status_.last_exec_block_type = id;
bc_exec_status_.last_exec_block = block_no;
bc_exec_status_.last_exec_time = exec_time;
return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)ack);
}
else
Expand All @@ -294,6 +300,9 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet)
}
}

bc_exec_status_.last_exec_block_type = id;
bc_exec_status_.last_exec_block = block_no;
bc_exec_status_.last_exec_time = exec_time;
return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)ack);
}

Expand Down
9 changes: 8 additions & 1 deletion Applications/timeline_command_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ typedef struct
} tlm_info_;
} TimelineCommandDispatcher;

extern const TimelineCommandDispatcher* const timeline_command_dispatcher;

typedef struct {
TLCD_ID last_exec_block_type;
bct_id_t last_exec_block;
cycle_t last_exec_time;
} BCExecStatus;

extern const TimelineCommandDispatcher* const timeline_command_dispatcher;
extern const BCExecStatus* const bc_exec_status;
/**
* @brief TL0 (GS から登録されるバス用の Timeline) の実行 App を作成する
* @param void
Expand Down

0 comments on commit 6b42b30

Please sign in to comment.