C - syntax error C141. Can't figure out why 1 function does't work.

Thread Starter

GoExtreme

Joined Mar 4, 2018
52
Hello,

I'm making a BitBang function for something similar to 1 wire. What ever I do I always get a syntax error on this function. This is part of bigger project and everything else works.
I made a separate project with just this function and still getting syntax error. I don't understand :(
I'm getting error C141 syntax error near 'data', ')', ')'

Code:
#include <SI_EFM8UB1_Register_Enums.h>                // SFR declarations

SI_SBIT (Pin, SFR_P1, 3);

void Data(uint8_t data);

void SiLabs_Startup (void)
{
  // Disable the watchdog here
}

int main (void)
{
  while (1) 
 {
      Data(0x05);
  }
}

void Data(uint8_t data)
{
    uint8_t i;

    for (i = 0; i < 8; i++)
    {
        if (data & 0x80)
        {
            Pin = 1;
        }
        else { Pin = 0;}

    }

}
 
Top