APM: convert to new I2C library

This commit is contained in:
Andrew Tridgell 2011-12-28 20:32:55 +11:00
parent 2960abf41f
commit c6b8a08918
2 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,7 @@ version 2.1 of the License, or (at your option) any later version.
#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> // Wayne Truchsess 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