Код
struct _SdSpiProtocol
{
void *spiHwInterface;
euint8 (*spiHwInit)(void* spiHwInterface);
euint8 (*spiSendByte)(void* spiHwInterface,euint8 data);
};
SdSpiProtocol sd_protocol;
euint8 atmega_spi_init(atmegaSpiInterface *iface)
{
Return (0);
}
sd_protocol.spiHwInit = (void *)atmega_spi_init;
sd_protocol.spiSendByte = (void *)atmega_spi_send;
{
void *spiHwInterface;
euint8 (*spiHwInit)(void* spiHwInterface);
euint8 (*spiSendByte)(void* spiHwInterface,euint8 data);
};
SdSpiProtocol sd_protocol;
euint8 atmega_spi_init(atmegaSpiInterface *iface)
{
Return (0);
}
sd_protocol.spiHwInit = (void *)atmega_spi_init;
sd_protocol.spiSendByte = (void *)atmega_spi_send;
ИАР выдаёт ошибки на 2 последние строки:
Error[Pe513]: a value of type "void *" cannot be assigned to an entity of type "euint8 (*)(void *)" F:\EFSL\MSP430\Main\avrtest.c 69
Если убрать (void *), то ошибка другая:
Error[Pe513]: a value of type "euint8 (*)(atmegaSpiInterface *)" cannot be assigned to an entity of type "euint8 (*)(void *)" F:\EFSL\MSP430\Main\avrtest.c 71
Что посоветуеte предпринять?
А может, готовый проект у кого-нибудь есть?