Я получаю ошибку в функции, когда я вызываю эту функцию для другой функции, это может быть вторым аргументом в адресе 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);
`
ошибка: конфликтующие типы для 'SpimodFlashWrite'
Спасибо