Subversion Repositories NaviCtrl

Rev

Rev 190 | Rev 196 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 190 Rev 195
Line 189... Line 189...
189
// the handler will be cyclic called by the timer 1 ISR
189
// the handler will be cyclic called by the timer 1 ISR
190
// used is for critical timing parts that normaly would handled 
190
// used is for critical timing parts that normaly would handled 
191
// within the main loop that could block longer at logging activities
191
// within the main loop that could block longer at logging activities
192
void EXTIT3_IRQHandler(void)
192
void EXTIT3_IRQHandler(void)
193
{
193
{
194
        VIC_ITCmd(EXTIT3_ITLine,DISABLE); // disable irq
194
        IENABLE;
Line -... Line 195...
-
 
195
 
-
 
196
        VIC_ITCmd(EXTIT3_ITLine,DISABLE); // disable irq
195
 
197
        VIC_SWITCmd(EXTIT3_ITLine,DISABLE); // clear pending bit
196
        I2C1_UpdateCompass();   // update compass communication 
198
        I2C1_UpdateCompass();   // update compass communication 
197
        Analog_Update();                // get new ADC values
-
 
198
 
-
 
199
        VIC_SWITCmd(EXTIT3_ITLine,DISABLE); // clear pending bit
199
        Analog_Update();                // get new ADC values
-
 
200
        VIC_ITCmd(EXTIT3_ITLine, ENABLE); // enable irq
-
 
201
 
200
        VIC_ITCmd(EXTIT3_ITLine, ENABLE); // enable irq
202
        IDISABLE;
Line 201... Line 203...
201
}
203
}
202
 
204
 
203
//----------------------------------------------------------------------------------------------------
205
//----------------------------------------------------------------------------------------------------
Line 267... Line 269...
267
        // initialize fat16 partition on sd card (needs Timer 1)
269
        // initialize fat16 partition on sd card (needs Timer 1)
Line 268... Line 270...
268
   
270
   
269
        // ---------- Prepare the isr driven 
271
        // ---------- Prepare the isr driven 
270
        // set to absolute lowest priority
272
        // set to absolute lowest priority
271
    VIC_Config(EXTIT3_ITLine, VIC_IRQ, PRIORITY_SW);
273
    VIC_Config(EXTIT3_ITLine, VIC_IRQ, PRIORITY_SW);
272
        // enanble interrupts
274
        // enable interrupts
Line 273... Line 275...
273
    VIC_ITCmd(EXTIT3_ITLine, ENABLE);
275
    VIC_ITCmd(EXTIT3_ITLine, ENABLE);
274
 
276
 
275
        for (;;) // the endless main loop
277
        for (;;) // the endless main loop
Line 296... Line 298...
296
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
298
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
297
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
299
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
298
                }
300
                }
299
                // ---------------- Logging  ---------------------------------------
301
                // ---------------- Logging  ---------------------------------------
300
                Logging_Update();  // could be block some time for at max. 2 seconds, therefore move time critical part of the mainloop into the ISR of timer 1
302
                Logging_Update();  // could be block some time for at max. 2 seconds, therefore move time critical part of the mainloop into the ISR of timer 1
301
                // ---------------- ADC readings -----------------------------------
-
 
302
        }
303
        }
303
}
304
}