Skip to content

Commit

Permalink
examples/subobc: apply IF list rename migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sksat committed Oct 26, 2023
1 parent ace3fdc commit 871256c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 42 deletions.
1 change: 1 addition & 0 deletions examples/subobc/src/src_user/Settings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.13)
project(C2A_USER_SETTINGS)

set(C2A_SRCS
component_driver_super/hal_handler_registry.c
Modes/mode_definitions.c
Modes/TaskLists/tl_initial.c
Modes/TaskLists/Elements/tl_elem_debug_display.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include "./driver_super_params.h"

#define CDS_STREAM_REC_BUFFER_SIZE_DEFAULT (CDS_IF_RX_BUFFER_SIZE * 2) /*!< CDS_StreamRecBuffer のバッファサイズのデフォルト値
UART などの非同期通信はメモリに余力があれば CDS_IF_RX_BUFFER_SIZE * 2 を推奨
#define CDS_STREAM_REC_BUFFER_SIZE_DEFAULT (CDS_HAL_RX_BUFFER_SIZE * 2) /*!< CDS_StreamRecBuffer のバッファサイズのデフォルト値
UART などの非同期通信はメモリに余力があれば CDS_HAL_RX_BUFFER_SIZE * 2 を推奨
詳細は dirver_super.c @note を参照 */

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma section REPRO
#include "hal_handler_registry.h"

#include <stddef.h>

int (*HAL_init_handlers[])(void* my_if) = { UART_init};

int (*HAL_rx_handlers[])(void* my_if, void* data_v, int buffer_size) = { UART_rx};

int (*HAL_tx_handlers[])(void* my_if, void* data_v, int data_size) = { UART_tx};

int (*HAL_reopen_handlers[])(void* my_if, int reason) = { UART_reopen};

#pragma section
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef HAL_HANDLER_REGISTRY_H_
#define HAL_HANDLER_REGISTRY_H_


#include <src_core/hal/ccsds.h>
#include <src_core/hal/uart.h>

typedef enum
{
UART,
HAL_HANDLER_ID_MAX
} HAL_HANDLER_ID;

typedef enum
{
IF_REOPEN_TLM_DISRUPTION = 100
} HAL_HANDLER_REOPEN_REASON;

extern int (*HAL_init_handlers[] )(void* my_if);
extern int (*HAL_rx_handlers[] )(void* my_if, void* data_v, int buffer_size);
extern int (*HAL_tx_handlers[] )(void* my_if, void* data_v, int data_size);
extern int (*HAL_reopen_handlers[])(void* my_if, int reason);

#endif
2 changes: 1 addition & 1 deletion examples/subobc/src/src_user/component_driver/etc/mobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static CDS_ERR_CODE MOBC_load_driver_super_init_settings_(ComponentDriverSuper*
{
CDS_StreamConfig* p_stream_config;

p_super->interface = UART;
p_super->hal_handler_id = UART;

// stream は 0 のみ
p_stream_config = &(p_super->stream_config[MOBC_STREAM_TLM_CMD]);
Expand Down
2 changes: 1 addition & 1 deletion examples/subobc/src/src_user/hal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.13)
project(C2A_USER_HAL)

set(C2A_COMMON_SRCS
if_list.c

)

# 通常,S2EではC++ビルドされるが,C2A core開発のため,C2A単体をC89でライブラリビルドする場合は,mockupをビルド対象にする
Expand Down
14 changes: 0 additions & 14 deletions examples/subobc/src/src_user/hal/if_list.c

This file was deleted.

24 changes: 0 additions & 24 deletions examples/subobc/src/src_user/hal/if_list.h

This file was deleted.

0 comments on commit 871256c

Please sign in to comment.