AG903ライブラリリファレンス
内容インデックスホーム
前へ上へ次へ
AG903_OSPMgrSetPriority 関数

優先度設定

Syntax
C++
int32_t AG903_OSPMgrSetPriority(AG903_OSPMgrHandle * handle, uint8_t priority);
引数 
説明 
AG903_OSPMgrHandle * handle 
[in] OSPハンドル 
uint8_t priority 
[in] 優先度(0~3) 

エラーコード

返値の詳細 
説明 
正常終了 
-AG903_EINVAL 
パラメータ異常 

チャンネル別に優先度を設定します. 

複数チャンネルで同時にバスアクセスが発生した場合, 優先度に従ってコマンド実行します. 

優先度が同じ場合, ラウンドロビンで処理されます.

1: int32_t AG903_OSPMgrSetPriority(AG903_OSPMgrHandle *handle, uint8_t priority) 2: { 3: int32_t rc = AG903_ENONE; 4: uint8_t ch; 5: 6: if(NULL == handle) { 7: rc = -AG903_EINVAL; 8: } 9: 10: rc = OSPMgrCheckHandle(handle, &ch); 11: 12: if (rc == AG903_ENONE) { 13: if (priority >= AG903_OSP_PRI_NUM) { 14: 15: rc = -AG903_EINVAL; 16: } 17: } 18: 19: if (rc == AG903_ENONE) { 20: AG903_OSPPrmPRIOR(ch, priority); 21: } 22: 23: return rc; 24: }
Copyright (c) 2017-2025 Axell Corporation. All rights reserved.