ACM: use new I2C library

This commit is contained in:
Andrew Tridgell 2011-12-28 20:34:59 +11:00
parent cd3729d993
commit 03a16c6e45
2 changed files with 3 additions and 2 deletions

View File

@ -54,7 +54,7 @@ http://code.google.com/p/ardupilot-mega/downloads/list
#include <Arduino_Mega_ISR_Registry.h>
#include <APM_RC.h> // ArduPilot Mega RC Library
#include <AP_GPS.h> // ArduPilot GPS library
#include <Wire.h> // Arduino I2C lib
#include <I2C.h> // Arduino I2C lib
#include <SPI.h> // Arduino SPI lib
#include <DataFlash.h> // ArduPilot Mega Flash Memory Library
#include <AP_ADC.h> // ArduPilot Mega Analog to Digital Converter Library

View File

@ -107,7 +107,8 @@ static void init_ardupilot()
// Initialize Wire and SPI libraries
//
#ifndef DESKTOP_BUILD
Wire.begin();
I2c.begin();
I2c.timeOut(20);
#endif
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV16); // 1MHZ SPI rate