"both separate parameter declaration and parameter list declaration are used"
It refers to both off my global variables. These global vars are used when an interrupt is called. The compiler also gives a syntax error in the code off the interrupt. With the little knowledge that I have, I can't seem to find any errors. I even compared it with the examples off this site.
I've tried everything in my knowledge so far. I doublechecked the header files for double declarations. I don't get any compiler errors, just in this particular C file. I've altered my code without result. I'm clueless, I would really appreciate the golden tip ;)
Thx in advance for some advice... here's the code. I stripped it a bit not to overwhelm you ;)
Expand|Select|Wrap|Line Numbers
- #include "mb90560.h"
- #include "prototypes.h"
- /********__GLOBAL_VARIABLES__***********************/
- int int_count;
- unsigned int Result_ADC;
- /********@_THE_"MAIN"_COURSE_@********************/
- struct struct2{ /* bitfield structure */
- int knipper : 1; /* 1st LED off 8 as indicator. */
- int ADC_VU : 7; /* 7 bits for ADC value */
- };
- void main(void)
- {
- int_count = 0; /* interrupt counter at 0
- struct2 *p_struct2;
- p_struct2 = ( struct2*) &PDR0;
- while(1){
- ADC_VU = Result_ADC(); /* constant loop to load new value ADC into the bitfield struct */
- }
- }
- /********__INTERRUPT FUNCTIES__********************/
- __interrupt void irq_adcint(void)
- {
- Result_ADC = GetADCResult();
- }
- __interrupt void ReloadTimer0 (void)
- {
- if (int_count++ == 25){
- PDR0_P07 = ~PDR0_P07; /* Indicator LED on/off */
- int_count = 0;
- }
- TMCSR0_UF = 0; /* reset interrupt flag timer */
- }
line 7: both separate parameter declaration and parameter list declaration are used
line 8: both separate parameter declaration and parameter list declaration are used
line 12: `struct struct2' declared in parameter declaration
line 19: both separate parameter declaration and parameter list declaration are used
line 19: syntax error near `{'
The last two errors noted at line 19, also occur at line 34 & 40.
The compiler I'm using is for Fujitsu micro's. It's called Softune. I found the compiler manual but I need a little help to translate it to a newby kinda language.
Explanation for errors at line 7,8, 19, 34 & 40...
Though a function is defined with a prototype declaration, non-prototype parameters are also declared.
The separate parameter declaration is not needed.
Explanation for struct error:
A tag is declared in a parameter declaration of a non-prototype function definition at the same time. The
scope where the tag is visible is the block scope from the tag declaration to the end of the function, then
a parameter type mismatch may occur in a function call.
Continues the compilation making the declaration valid.