We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I always get an error 129 (missing ';' before 'void') when I compile in this part: func void iicstart (void) { sda = 1; scl = 1; del4us () sda = 0; del4us () scl = 0; del4us () } what is wrong?
Is this supposed to be 'C'? If so, what is func?
Should there be a ; after del4us ()??? Jon
"func" is the problem. "Missing ; before <token>" is one of those compiler error messages that you wish actually says what it means. Normally, I see this error when there is an undefined type for a return value of a function. ForgotToInclude f() - Missing ; before f.
"'Missing ; before <token>' is one of those compiler error messages that you wish actually says what it means." What it means is that the compiler expects nothing before <token>; therefore, if it finds something before <token>, it assumes that there should've been a ';' after the "something" !!
"Should there be a ; after del4us ()???" Surely, there should be a ';' after each del4us() ?!
Maybe del4us() is a macro that inserts its own semicolons? #define del4us() _nop_;_nop_;_nop_;_nop_; (Not a style I would recommend. I write macros that look like functions assuming I'll put a semicolon after them at the point of use.)
On second look, it appears you have debugger functions confused with C functions. When writing your C program, you must use ANSI C rules. And, func is not a part of that rule set. If your function is intended to be used in your program, you should modify it as follows:
void iicstart (void) { sda = 1; scl = 1; del4us (); sda = 0; del4us (); scl = 0; del4us (); }
func void iicstart (void) { sda = 1; scl = 1; del4us (); sda = 0; del4us (); scl = 0; del4us (); }