aceSetIrqConditions(Cardnum, bEnable, ACE_IMR1_EOM, funcExternalISR);
void funcExternalISR(S16BIT DevNum, U32BIT Status)
{
U32BIT dwMsgCount=0,dwMsgLostHBuf=0;
S16BIT raw[ACE_MSGSIZE_B]
S16BIT s16Result = 0;
U32BIT u32MsgCount = 0;
U32BIT u32MsgLost = 0;
if (ACE_IMR1_EOM & Status)
{
if ((dwMsgCount = aceBCGetHBufMsgCount(Cardnum))==0)
{ /* HBUFのデータが用意される前に、コールバック関数が実行される事がある*/
while (( dwMsgCount = aceBCGetHBufMsgCount(Cardnum))==0)
{
struct timespec w0 = {0,200000};//200マイクロ
nanosleep(&w0, NULL);
timeout --;
if(timeout==0)
{//2ms
fprintf(stderr,"Fatal Error : Can not get data Status=0x%X\n",Status);
return;
}
} ;
/*
Rawフォーマットは、バイナリデータへのU16BITポインタを返す。この方法を使用すると、ホストバッファから複数のメッセージを一度に読み取ることができる。
各メッセージは42ワードの固定長で、ワードの最大サイズを必要としないメッセージにはゼロフィルワードが使用される。
たとえば、2つのメッセージが送信された場合、バイナリデータは84ワードの深さになり、2番目のメッセージはオフセット42から始まる。
*/
do
{
memset(raw,0,sizeof(short)*ACE_MSGSIZE_BC);
s16Result = aceBCGetHBufMsgsRaw(Cardnum, raw, ACE_MSGSIZE_B, &u32MsgCount, &u32MsgLost);
if (s16Result)
{
fprintf(stderr," BC Message Lost Error : aceBCGetHBufMsgsRaw() ");
PrintOutError(s16Result);
return;
}
else
{
if ((u32MsgLost!=0)||(u32MsgCount!=1))
{
fprintf(stderr," BC Message Lost Error : aceBCGetHBufMsgsRaw() MsgLost = %d u32MsgCount=%d aceBCGetHBufMsgCount()=%d",u32MsgLost,u32MsgCount,aceBCGetHBufMsgCount(Cardnum));
return;
}
}
} while((dwMsgCount = aceBCGetHBufMsgCount(Cardnum))!=0);/* 1回のコールバックで複数回のデータが転送される場合がある。*/
}
}
# ddccm
===========================================================
Data Device Corporation Card Manager v3.7.0
===========================================================
1 1553 Data Bus
2 ARINC 429
3 Synchro
4 Power
Enter desired product family (-1 to quit): 1
------------------------------------------------------------------------------------
Item Dev Device Name Model Ch Location Status Curr. Rec.
Num FW Rev. FW Rev.
------------------------------------------------------------------------------------
(!) 1 - BU-67206BK2 2 1 05:00:00 Ready 9.0 9.8
(!) 2 - BU-67206BK2 2 2 05:00:00 Ready 9.0 9.8
(!) This device does not match the recommended firmware revision
Enter command ('h' for help): f
----------------------------------------------------------------
Device Name Model FW ID Current Recommended
FW Rev. FW Rev.
----------------------------------------------------------------
(!) 1 BU-67206BK2 2 76905 9.0 9.8
----------------------------------------------------------------
(!) This device does not match the recommended firmware revision
Enter the number of the Device # to flash (0 to exit): 1
Enter the filename to program: /usr/local/CCUR/drivers/ddc1553-69092/ddc1553-69092/flash/firmware/bu67206bkx_rev_9_8.bin
Device: BU-67206BK2
File Name: /usr/local/CCUR/drivers/ddc1553-69092/ddc1553-69092/flash/firmware/bu67206bkx_rev_9_8.bin
File Size: 6297121 bytes
Are you sure you want to flash the selected device?
Enter 'y' or 'n': y
Erasing Flash Sector: 1 / 49
Erasing Flash Sector: 2 / 49
Erasing Flash Sector: 3 / 49
Erasing Flash Sector: 4 / 49
Erasing Flash Sector: 5 / 49
Erasing Flash Sector: 6 / 49
Erasing Flash Sector: 7 / 49
Erasing Flash Sector: 8 / 49
Erasing Flash Sector: 9 / 49
Erasing Flash Sector: 10 / 49
:
Programming 97% 0x005D8000
Programming 97% 0x005E0000
Programming 98% 0x005E8000
Programming 98% 0x005F0000
Programming 99% 0x005F8000
Programming 99% 0x00600000
Programming 100% 0x00601621
Device Flashing Complete!
You MUST power down your system and restart for changes to take effect.
Press to continue...
Enter command ('h' for help): q