Link Error : Undefined : mcf5xxx_byterev

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Link Error : Undefined : mcf5xxx_byterev

1,491件の閲覧回数
opv
Contributor I

Help please!

 

typedef unsigned long int hcc_u32;


extern hcc_u32 mcf5xxx_byterev(hcc_u32 val);

#define WR_LE32(a, v) ((*(hcc_u32*)(a))=mcf5xxx_byterev(v))
#define WR_LE16(a, v) ((*(hcc_u16*)(a))=(hcc_u16)(mcf5xxx_byterev(v) >> 16))
#define RD_LE32(a)    (mcf5xxx_byterev(*(hcc_u32*)(a)))
#define RD_LE16(a)    ((hcc_u16)(mcf5xxx_byterev((hcc_u32)*(hcc_u16*)(a))>>16))

 

void main(void) {

  WR_LE32(&BDT_CTL_RX(1,0),1);

}

 

mcf5xxx_byterev is undefined!

Thank you

ラベル(1)
0 件の賞賛
返信
1 返信

993件の閲覧回数
mjbcswitzerland
Specialist V

Hi

 

You may find that this routine is in an assembly file somewhere since the Coldfire has a specal assembler instruction that can be used to reverse bytes very efficiently:

 

CodeWarrior assembler is:

_byte_rev:
    byterev.l d0
    rts

 

GCC assembler may be:

byte_rev:
    move.l  4(%SP),%D0
    byterev.l %D0
    rts   

 

 

 

If not, it can also be replaced by a macro similar to the following:

 

#define fnLE_add(x) ((x >> 24) | ((x >> 8) & 0x0000ff00) | ((x << 8) & 0x00ff0000) | ((x << 24) & 0xff000000))

 

Regards

 

Mark

 

www.uTasker.com

 

0 件の賞賛
返信