我在函数中遇到错误当我将此函数调用到另一个函数时可能是第二个参数int u16地址我传递错误
int SpimodFlashWrite(XSpi *SpiPtr, u16 Address, u16 ByteCount)
{
u16 Index;
/*
* Setup the write command with the specified address, and data to be
* written to the flash.
*/
WriteBuffer[MOD_COMMAND_OFFSET] = MOD_COMMAND_WRITE;
WriteBuffer[MOD_ADDRESS_BYTE1_OFFSET] = (u8) (Address >> 16);
WriteBuffer[MOD_ADDRESS_BYTE2_OFFSET] = (u8) (Address >> 8);
WriteBuffer[MOD_ADDRESS_BYTE3_OFFSET] = (u8) (Address);
/*
* Prepare the write buffer. Fill in the data that is to be written into
* the Flash.
*/
for(Index = 4; Index < (ByteCount + MOD_READ_WRITE_EXTRA_BYTES);Index++)
{
WriteBuffer[Index] = (u8)(MOD_TEST_BYTE + Index);
}
/*
* Send the write command, address, and data to the Flash.
* No receive buffer is specified since there is nothing to receive.
*/
TransferInProgress = TRUE;
XSpi_Transfer(SpiPtr, WriteBuffer, NULL,
ByteCount + MOD_READ_WRITE_EXTRA_BYTES)
;
/*
* Wait till the Transfer is complete and check if there are any errors
* in the transaction.
*/
while (TransferInProgress);
if(ErrorCount != 0) {
ErrorCount = 0;
return XST_FAILURE;
}
return XST_SUCCESS;
}
如果我正在使用此功能
`int express_configure( void )
{
int Status;
unsigned char b[3];
b[0] = 0xD4;
b[1]=29;b[2]=0x80;
Status = SpimodFlashWrite(&Spi, b, 3);
`
错误:&#39; SpimodFlashWrite&#39;
的冲突类型由于