空值不容忽视,因为它应该是错误的

时间:2019-07-16 11:08:20

标签: c avr

int main(void)
{
    spi_init();

    unsigned char datas; //received data stored here
    uint8_t x = 0;


    while(1)
    {
        datas = 0x00;
        datas = spi_operation(++x);   //HERE I get the error
        }

这在主函数中,这是声明的函数:

     unsigned char  spi_operation (unsigned char data)
      {
        SPDR = data;

         while(!(SPSR & (1<<SPIF)));

         return (SPDR);

       }

错误在我评论的行上显示void value not ignored as it ought be

0 个答案:

没有答案