I get this error at the line where __delay_cycles
is called.
#664 expected an integer constant C/C++ Problem
The functions' parameters: __delay_cycles(unsigned long cycles);
This code isn't practical, but demonstrates my problem.
I tried initing a
with or without volatile
- same error.
I tried type casting it in to the function, no luck.
The code:
unsigned long a = 100;
void main() {
Pin16_SetAsOutput();
while(1) {
a++;
Pin16_SetHigh();
__delay_cycles(a);
Pin16_SetLow();
__delay_cycles(a);
}
}