Subversion Repositories NaviCtrl

Rev

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

Rev 189 Rev 195
Line 241... Line 241...
241
{
241
{
242
        static u8 Rx_Idx = 0, Tx_Idx = 0, crc = 0;
242
        static u8 Rx_Idx = 0, Tx_Idx = 0, crc = 0;
243
        static u8 I2C_PrimRxBuffer[10]; // must be larger than any of the secondary rx buffers
243
        static u8 I2C_PrimRxBuffer[10]; // must be larger than any of the secondary rx buffers
244
        u16 status;
244
        u16 status;
Line -... Line 245...
-
 
245
 
-
 
246
        //IENABLE;  // do not enable IRQ nesting for I2C!!!!
245
 
247
 
246
        // detemine I2C State
248
        // detemine I2C State
Line 247... Line 249...
247
        status = I2C_GetLastEvent(I2C1);
249
        status = I2C_GetLastEvent(I2C1);
248
 
250
 
Line 424... Line 426...
424
 
426
 
425
                        default:
427
                        default:
426
                                break;
428
                                break;
427
                }
429
                }
-
 
430
        }
-
 
431
 
428
        }
432
        //IDISABLE;      // do not enable IRQ nesting for I2C!!!!
429
}
433
}
430
//----------------------------------------------------------------
434
//----------------------------------------------------------------
431
void I2C1_SendCommand(u8 command)
435
void I2C1_SendCommand(u8 command)
432
{
436
{
Line 554... Line 558...
554
                }
558
                }
555
                else // request current heading
559
                else // request current heading
556
                {
560
                {
557
                        I2C1_SendCommand(I2C_CMD_READ_HEADING);
561
                        I2C1_SendCommand(I2C_CMD_READ_HEADING);
558
                }
562
                }
559
                TimerCompassUpdate = SetDelay(40);    // every 40 ms are 25 Hz
563
                TimerCompassUpdate = SetDelay(20);    // every 20 ms are 50 Hz
560
        }
564
        }
561
}
565
}