Subversion Repositories NaviCtrl

Rev

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

Rev 146 Rev 154
Line 55... Line 55...
55
// +  POSSIBILITY OF SUCH DAMAGE.
55
// +  POSSIBILITY OF SUCH DAMAGE.
56
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
56
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
57
#include "91x_lib.h"
57
#include "91x_lib.h"
58
#include "timer1.h"
58
#include "timer1.h"
59
#include "uart1.h"
59
#include "uart1.h"
60
#include "i2c.h"
-
 
61
#include "config.h"
60
#include "config.h"
Line 62... Line 61...
62
 
61
 
63
u32 CountMilliseconds;
62
u32 CountMilliseconds;
Line 64... Line 63...
64
DateTime_t SystemTime;
63
DateTime_t SystemTime;
65
 
64
 
66
//----------------------------------------------------------------------------------------------------
65
//----------------------------------------------------------------------------------------------------
67
void TIM1_IRQHandler(void)
66
void TIM1_IRQHandler(void)
68
{
67
{
-
 
68
        if(TIM_GetFlagStatus(TIM1, TIM_FLAG_OC1) == SET)
69
        if(TIM_GetFlagStatus(TIM1, TIM_FLAG_OC1) == SET)
69
        {
70
        {
70
                TIM_ClearFlag(TIM1, TIM_FLAG_OC1); // clear irq pending bit
Line 71... Line 71...
71
                TIM1->OC1R += 200;    // Timerfreq is 200kHz, generate an interrupt every 1ms
71
                TIM1->OC1R += 200;    // Timerfreq is 200kHz, generate an interrupt every 1ms
72
                CountMilliseconds++;
-
 
73
               
72
                CountMilliseconds++;
-
 
73
               
74
                I2C1_UpdateCompass(); // update compass communication
74
                // generate SW Interrupt to make a regular timing 
75
 
75
                // indeoendent from the mainloop at the lowest IRQ priority
76
                TIM_ClearFlag(TIM1, TIM_FLAG_OC1); // clear irq pending bit
76
                VIC_SWITCmd(EXTIT3_ITLine, ENABLE);    
77
        }
77
        }