
382 APPENDIX F. PROGRAMMING PERILS AND PITFALLS
Listing F.2: Checking for real-time schedule failure using the interrupt flags register.
Uint32 Overrun =0;
2
interrupt void MyISR ()
4 {
// your ISR code here
6 if( IFR &0x00001000 ) { // check if INT12 is pending
Overrun++; // if so, increment the count
8 }
}
F.7 Variable Initialization
In the C programming language, declaring a variable does not automatically cause that
variable to be initialized to a known value. In general, variables must always be set to a
value before they are evaluated in a C program. This does not mean that they need to
be initialized in the declaration, as long as they are written