variable initialisation
Posted: Tue Dec 22, 2009 12:08 pm
Hello All !
i'm always working on a PIC - CPLD project, with SPI communication
I have to initialize an "unsigned long time = 0" variable in a macro, but i have a problem...
There is a while loop in my program, so it's always executed and i need to use this variable 'time',
but when i wrote Unisgned long time = 0 (init) i can work, with it (increment and decrement), but when i come back in this macro the variable is re-initialized.
So i've tried to put the initialisation out of the while loop, at the begining of the program, and at this time, i have a lot of error sayong "unknown variable 'time'"...
i don't know how can i resolve that !
one more time excuse me for my english.
Regards,
Adrien DG
France
i'm always working on a PIC - CPLD project, with SPI communication
I have to initialize an "unsigned long time = 0" variable in a macro, but i have a problem...
There is a while loop in my program, so it's always executed and i need to use this variable 'time',
but when i wrote Unisgned long time = 0 (init) i can work, with it (increment and decrement), but when i come back in this macro the variable is re-initialized.
So i've tried to put the initialisation out of the while loop, at the begining of the program, and at this time, i have a lot of error sayong "unknown variable 'time'"...
i don't know how can i resolve that !
one more time excuse me for my english.
Regards,
Adrien DG
France

