Here is the situation:
Compiler: Imagecraft V6.31A
I needed to increase the delay in which the WDT times out. The maximum timeout on a Mega128 is 2.1 seconds. So without having to scatter WDR()s all over my code I am using a global variable "count" that gets incremented every second inside a timer interrupt. When this "count" reaches a predefined count it calls a function that turns on the WDT and resets my application. I reset the global variable "count = 0" inside my main().
The global variable is defined in my timer.c file as "unsigned char count" and is linked to my main.c file using "extern unsigned char count".
Should I have declared my "unsigned char count" as "volatile unsigned char count"..??
I'm a little confused as to when to use the keyword volatile.