Subversion Repositories NaviCtrl

Rev

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

Rev 136 Rev 146
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"
60
#include "config.h"
61
#include "config.h"
Line 61... Line 62...
61
 
62
 
62
u32 CountMilliseconds;
63
u32 CountMilliseconds;
Line 67... Line 68...
67
{
68
{
68
        if(TIM_GetFlagStatus(TIM1, TIM_FLAG_OC1) == SET)
69
        if(TIM_GetFlagStatus(TIM1, TIM_FLAG_OC1) == SET)
69
        {
70
        {
70
                TIM1->OC1R += 200;    // Timerfreq is 200kHz, generate an interrupt every 1ms
71
                TIM1->OC1R += 200;    // Timerfreq is 200kHz, generate an interrupt every 1ms
71
                CountMilliseconds++;
72
                CountMilliseconds++;
-
 
73
               
72
                //if (GPIO_ReadBit(GPIO6, GPIO_Pin_3)) GPIO_WriteBit(GPIO6, GPIO_Pin_3, Bit_RESET);  else GPIO_WriteBit(GPIO6, GPIO_Pin_3, Bit_SET);
74
                I2C1_UpdateCompass(); // update compass communication
-
 
75
 
73
                TIM_ClearFlag(TIM1, TIM_FLAG_OC1); // clear irq pending bit
76
                TIM_ClearFlag(TIM1, TIM_FLAG_OC1); // clear irq pending bit
74
        }
77
        }
75
        // write any value to VIC0 Vector address register
78
        // write any value to VIC0 Vector address register
76
        VIC0->VAR = 0xFF;
79
        VIC0->VAR = 0xFF;
77
}
80
}