Subversion Repositories NaviCtrl

Rev

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

Rev 470 Rev 473
Line 58... Line 58...
58
#include "i2c1.h"
58
#include "i2c1.h"
59
#include "uart1.h"
59
#include "uart1.h"
60
#include "timer1.h"
60
#include "timer1.h"
61
#include "config.h"
61
#include "config.h"
62
#include "led.h"
62
#include "led.h"
63
 
-
 
-
 
63
#include "ncmag.h"
Line 64... Line 64...
64
 
64
 
65
volatile u8 I2C1_State = I2C_STATE_OFF;          // only one byte, because of sync by nesting irqs
65
volatile u8 I2C1_State = I2C_STATE_OFF;          // only one byte, because of sync by nesting irqs
Line 66... Line 66...
66
volatile u8 I2C1_Error = I2C_ERROR_NOACK;    // only one byte!
66
volatile u8 I2C1_Error = I2C_ERROR_NOACK;    // only one byte!
Line 212... Line 212...
212
        // empty rx and tx buffer
212
        // empty rx and tx buffer
213
        I2C1_TxBufferSize = 0;
213
        I2C1_TxBufferSize = 0;
214
        I2C1_RxBufferSize = 0;
214
        I2C1_RxBufferSize = 0;
Line 215... Line 215...
215
 
215
 
-
 
216
        I2C1_Timeout = SetDelay(10*I2C1_TIMEOUT);
-
 
217
 
-
 
218
  if(I2C_CompassPort == I2C_INTERN_1)
-
 
219
   {
-
 
220
    MagRawVector.X = 0;
-
 
221
    MagRawVector.Y = 0;
-
 
222
    MagRawVector.Z = 0;
-
 
223
        AccRawVector.X = 0;
-
 
224
        AccRawVector.Y = 0;
-
 
225
        AccRawVector.Z = 0;
-
 
226
        Compass_Heading = -1;
Line 216... Line 227...
216
        I2C1_Timeout = SetDelay(10*I2C1_TIMEOUT);
227
   }
217
 
228
 
Line 218... Line 229...
218
        UART1_PutString("ok");
229
        UART1_PutString("ok");