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 am a hardware system/circuit designer attempting to utilize a c8051f330 MCU to save a bunch of hardware in the design of some special test equipment. In an attepmt to learn how to design and implement C code I am using some small test programs. I have been unsuccesful in understanding and clearing a syntax error encountered in my attempt to program an interrupt service routine which uses the overflow of timer0 to generate interrupt 1. The section of the program listing whic has the error is: 69 void timer0_ISR (void) interrupt 1 70 { 71 1 72 1 LED = ~LED 73 1 } *** ERROR C141 IN LINE 73 OF SPECIAL_FLASH_PROGRAM.C: syntax error near '}' 74 75/*------------End of ALL STUFF---------------------*/ Thanks in advance for your help!! It's greatly appreciated. Dennis
Hey guys, I found my error. When I added the semicolon, as suggested earlier, I placed it incorrectly. When I corrected that I got 0 Warnings and 0 Errors. Thanks for your help, I'll probably be back for more. Dennis-
It is typical with programming languages (not just 'C') that one small mistake (eg, a misplaced semicolon) will cause very many error messages. This is because the compiler just loses sync with the source code - so nothing makes sense to it any more! Therefore, your general approach should be to fix the first reported error first; if subsequent error reports aren't immediately obvious, just rebuild and see if they go away!