/******************************************************************************* * * * モジュール名称 :メモリデータ取得 * * モジュールラベル :checkout_getMemData * * タスク区分 :アプリケーションタスク * * 機能 : * * コーリングシーケンス:void checkout_getMemData( unsigned int ui_addr, * * int *ip_apiResult) * * 引数 :unsigned int ui_addr 取得先アドレス * * int *ip_apiResult API実行結果 * * 戻り値 :void * * 使用上の注意 :なし * * エラー処理 :なし * * * * (APP16向けサンプルコードです) * * * *******************************************************************************/ #include "chkout.h" /* チェックアウトアプリ定義 */ #include "dpu_api_proto.h" int checkout_getMemData(unsigned int ui_addr, int *ip_apiResult) { int i_return = d_CO_GEN_ERROR; /* 本関数返り値 */ M_T_DPU_INFO t_dpuInfo; unsigned char uc_localNodeID; unsigned char uc_otherNodeID; dpu_getDPUInfo( &t_dpuInfo ); /* DPU動作情報取得 */ if( t_dpuInfo.uc_dpuID == 1 ) { uc_localNodeID = d_CO_NODE_DPU1; uc_otherNodeID = d_CO_NODE_DPU2; }else{ uc_localNodeID = d_CO_NODE_DPU2; uc_otherNodeID = d_CO_NODE_DPU1; } if( Gt_co_chkOutPlan.uc_nodeID == uc_localNodeID ) { /* 自DPU */ /* EEPROMデータ取得 */ *ip_apiResult = checkout_getRom( ui_addr, Gt_co_chkOutPlan.ui_readSize, Gui_co_readData ); if( *ip_apiResult == 0 ) { /* エラーなし */ i_return = d_CO_NO_ERROR; }else{ /* エラーあり */ i_return = d_CO_ROM_READ_ERROR; } }else if( Gt_co_chkOutPlan.uc_nodeID == uc_otherNodeID ){ /* 他DPU */ if( t_dpuInfo.uc_rdnMode == 1 ) { /* 冗長ON */ /* 冗長SDRAMデータ書込 */ *ip_apiResult = checkout_putRdn( Gui_co_writeData, ui_addr, Gt_co_chkOutPlan.ui_readSize ); if( *ip_apiResult == 0 ) { /* エラーなし */ /* 冗長SDRAMデータ取得 */ *ip_apiResult = checkout_getRdn( ui_addr, Gt_co_chkOutPlan.ui_readSize, Gui_co_readData ); if( *ip_apiResult == 0 ) { /* エラーなし */ i_return = d_CO_NO_ERROR; }else{ /* エラーあり */ i_return = d_CO_RDN_READ_ERROR; } }else{ /* エラーあり */ i_return = d_CO_RDN_WRITE_ERROR; } }else{ /* 冗長OFF */ /* エラー扱いとする */ *ip_apiResult = 0; i_return = d_CO_RDN_OFF; } }else{ /* その他 */ *ip_apiResult = 0; i_return = d_CO_NODEID_ILLIGAL; } return i_return; }