When working with a microcontroller such as a PIC32MZ is it acceptable to use static variables inside the interrupt? This would be for a time counter. If the interrupt triggers every one msecond and a flag is needed every second.
Also is it necessary to make this variable volatile or its existence inside the interrupt makes it volatile?