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

Apply rename migration: component driver prefix #155

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions examples/mobc/src/src_user/component_driver/aocs/aobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
#include "./aobc_telemetry_buffer.h"
#include <src_core/tlm_cmd/common_tlm_cmd_packet.h>
#include <src_core/tlm_cmd/common_cmd_packet.h>
#include <src_core/component_driver/eb90_frame_for_driver_super.h>
#include <src_core/component_driver/common_tlm_cmd_packet_for_driver_super.h>
#include <src_core/component_driver/cdrv_eb90_frame.h>
#include <src_core/component_driver/cdrv_common_tlm_cmd_packet.h>
#include <string.h>

#define AOBC_STREAM_TLM_CMD (0) //!< テレコマで使うストリーム

static uint8_t AOBC_tx_frame_[EB90_FRAME_HEADER_SIZE +
static uint8_t AOBC_tx_frame_[CDRV_EB90_FRAME_HEADER_SIZE +
CTCP_MAX_LEN +
EB90_FRAME_FOOTER_SIZE];
CDRV_EB90_FRAME_FOOTER_SIZE];

static CDS_ERR_CODE AOBC_load_driver_super_init_settings_(ComponentDriverSuper* p_super);
static CDS_ERR_CODE AOBC_analyze_rec_data_(CDS_StreamConfig* p_stream_config,
Expand Down Expand Up @@ -54,7 +54,7 @@ static CDS_ERR_CODE AOBC_load_driver_super_init_settings_(ComponentDriverSuper*
// stream は 0 のみ
p_stream_config = &(p_super->stream_config[AOBC_STREAM_TLM_CMD]);

CTCP_init_cdssc(p_stream_config, AOBC_tx_frame_, sizeof(AOBC_tx_frame_), AOBC_analyze_rec_data_);
CDRV_CTCP_init_stream_config(p_stream_config, AOBC_tx_frame_, sizeof(AOBC_tx_frame_), AOBC_analyze_rec_data_);

// 定期 TLM の監視機能の有効化しない → ので設定上書きなし

Expand Down Expand Up @@ -91,7 +91,7 @@ static CDS_ERR_CODE AOBC_analyze_rec_data_(CDS_StreamConfig* p_stream_config,

aobc_driver->info.comm.rx_err_code = AOBC_RX_ERR_CODE_OK;

if (!EB90_FRAME_is_valid_crc_of_cdssc(p_stream_config))
if (!CDRV_EB90_FRAME_is_valid_crc(p_stream_config))
{
aobc_driver->info.comm.rx_err_code = AOBC_RX_ERR_CODE_CRC_ERR;
return CDS_ERR_CODE_ERR;
Expand Down Expand Up @@ -134,7 +134,7 @@ CDS_CMD_ERR_CODE AOBC_send_cmd(AOBC_Driver* aobc_driver, const CommonCmdPacket*
p_stream_config = &(aobc_driver->driver.super.stream_config[AOBC_STREAM_TLM_CMD]);

// tx_frameの設定
CCP_set_tx_frame_to_cdssc(p_stream_config, packet);
CDRV_CCP_set_tx_frame(p_stream_config, packet);

cmd_code = (AOBC_CMD_CODE)CCP_get_id(packet);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @brief テレメトリバッファー(テレメ中継)
* @note このコードは自動生成されています!
*/
#include <src_core/component_driver/common_tlm_cmd_packet_for_driver_super.h>
#include <src_core/component_driver/cdrv_common_tlm_cmd_packet.h>
#include "./aobc_telemetry_definitions.h"
#include "./aobc_telemetry_buffer.h"
#include "./aobc.h"
Expand All @@ -30,7 +30,7 @@ CDS_ERR_CODE AOBC_buffer_tlm_packet(CDS_StreamConfig* p_stream_config, AOBC_Driv
AOBC_TLM_CODE tlm_id;
CDS_ERR_CODE ret;

ret = CTP_get_ctp_from_cdssc(p_stream_config, &AOBC_ctp_);
ret = CDRV_CTP_get_ctp(p_stream_config, &AOBC_ctp_);
if (ret != CDS_ERR_CODE_OK) return ret;

tlm_id = (AOBC_TLM_CODE)CTP_get_id(&AOBC_ctp_);
Expand Down
16 changes: 8 additions & 8 deletions examples/subobc/src/src_user/component_driver/etc/mobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

#include "./mobc.h"
#include <src_core/tlm_cmd/common_tlm_cmd_packet.h>
#include <src_core/component_driver/eb90_frame_for_driver_super.h>
#include <src_core/component_driver/common_tlm_cmd_packet_for_driver_super.h>
#include <src_core/component_driver/cdrv_eb90_frame.h>
#include <src_core/component_driver/cdrv_common_tlm_cmd_packet.h>
#include <string.h>

#define MOBC_STREAM_TLM_CMD (0) //!< テレコマで使うストリーム

static uint8_t MOBC_tx_frame_[EB90_FRAME_HEADER_SIZE +
static uint8_t MOBC_tx_frame_[CDRV_EB90_FRAME_HEADER_SIZE +
CTCP_MAX_LEN +
EB90_FRAME_FOOTER_SIZE];
CDRV_EB90_FRAME_FOOTER_SIZE];

static CDS_ERR_CODE MOBC_load_driver_super_init_settings_(ComponentDriverSuper* p_super);
static CDS_ERR_CODE MOBC_analyze_rec_data_(CDS_StreamConfig* p_stream_config,
Expand Down Expand Up @@ -53,7 +53,7 @@ static CDS_ERR_CODE MOBC_load_driver_super_init_settings_(ComponentDriverSuper*
// stream は 0 のみ
p_stream_config = &(p_super->stream_config[MOBC_STREAM_TLM_CMD]);

CTCP_init_cdssc(p_stream_config, MOBC_tx_frame_, sizeof(MOBC_tx_frame_), MOBC_analyze_rec_data_);
CDRV_CTCP_init_stream_config(p_stream_config, MOBC_tx_frame_, sizeof(MOBC_tx_frame_), MOBC_analyze_rec_data_);

// 定期 TLM の監視機能の有効化しない → ので設定上書きなし

Expand Down Expand Up @@ -89,7 +89,7 @@ static CDS_ERR_CODE MOBC_analyze_rec_data_(CDS_StreamConfig* p_stream_config, vo
CommonCmdPacket packet; // FIXME: これは static にする?
// static のほうがコンパイル時にアドレスが確定して安全. Out of stack space を回避できる
// 一方でメモリ使用量は増える.
CDS_ERR_CODE ret = CCP_get_ccp_from_cdssc(p_stream_config, &packet);
CDS_ERR_CODE ret = CDRV_CCP_get_ccp(p_stream_config, &packet);
if (ret != CDS_ERR_CODE_OK)
{
mobc_driver->info.comm.rx_err_code = MOBC_RX_ERR_CODE_INVALID_PACKET;
Expand All @@ -98,7 +98,7 @@ static CDS_ERR_CODE MOBC_analyze_rec_data_(CDS_StreamConfig* p_stream_config, vo

mobc_driver->info.comm.rx_err_code = MOBC_RX_ERR_CODE_OK;

if (!EB90_FRAME_is_valid_crc_of_cdssc(p_stream_config))
if (!CDRV_EB90_FRAME_is_valid_crc(p_stream_config))
{
mobc_driver->info.comm.rx_err_code = MOBC_RX_ERR_CODE_CRC_ERR;
return CDS_ERR_CODE_ERR;
Expand Down Expand Up @@ -132,7 +132,7 @@ CDS_CMD_ERR_CODE MOBC_send(MOBC_Driver* mobc_driver, const CommonTlmPacket* pack
p_stream_config = &(mobc_driver->driver.super.stream_config[MOBC_STREAM_TLM_CMD]);

// tx_frameの設定
CTP_set_tx_frame_to_cdssc(p_stream_config, packet);
CDRV_CTP_set_tx_frame(p_stream_config, packet);

ret = CDS_send_general_cmd(&(mobc_driver->driver.super), MOBC_STREAM_TLM_CMD);

Expand Down