aboutsummaryrefslogtreecommitdiffstats
path: root/libraries
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-08-31 16:12:14 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-08-31 16:12:14 -0400
commit7ccd7afce2a158eb852b5f7c61cd51e8febe56a9 (patch)
tree79ec4cecad1f07eb99eaa6fcf6977e92a5e3196b /libraries
parentee22c3dc6d945262303d43e733eaac91bfcf0d9d (diff)
downloadlibrambutan-7ccd7afce2a158eb852b5f7c61cd51e8febe56a9.tar.gz
librambutan-7ccd7afce2a158eb852b5f7c61cd51e8febe56a9.zip
Fixups for Wire library builds.
Add libraries directory to global include path, so Wire sub-headers can be included in a directory-independent way. Tweak Wire global declaration and definition so it builds. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/Wire/HardWire.cpp2
-rw-r--r--libraries/Wire/HardWire.h2
-rw-r--r--libraries/Wire/Wire.cpp4
-rw-r--r--libraries/Wire/Wire.h6
-rw-r--r--libraries/Wire/WireBase.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/libraries/Wire/HardWire.cpp b/libraries/Wire/HardWire.cpp
index 9182ae2..c2412f1 100644
--- a/libraries/Wire/HardWire.cpp
+++ b/libraries/Wire/HardWire.cpp
@@ -36,7 +36,7 @@
* users easy interaction with the I2C Hardware in a familiar method.
*/
-#include "HardWire.h"
+#include <Wire/HardWire.h>
uint8 HardWire::process() {
int8 res = i2c_master_xfer(sel_hard, &itc_msg, 1, 0);
diff --git a/libraries/Wire/HardWire.h b/libraries/Wire/HardWire.h
index d3f4ed8..d6eb54a 100644
--- a/libraries/Wire/HardWire.h
+++ b/libraries/Wire/HardWire.h
@@ -39,7 +39,7 @@
#ifndef _HARDWIRE_H_
#define _HARDWIRE_H_
-#include "WireBase.h"
+#include <Wire/WireBase.h>
#include <wirish/wirish.h>
#include <libmaple/i2c.h>
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index 9173234..d646132 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -37,7 +37,7 @@
* modifications by gke and ala42.
*/
-#include "Wire.h"
+#include <Wire/Wire.h>
#define I2C_WRITE 0
#define I2C_READ 1
@@ -179,4 +179,4 @@ TwoWire::~TwoWire() {
}
// Declare the instance that the users of the library can use
-TwoWire Wire(); \ No newline at end of file
+TwoWire Wire(SCL, SDA, SOFT_STANDARD);
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
index 812132b..d455b11 100644
--- a/libraries/Wire/Wire.h
+++ b/libraries/Wire/Wire.h
@@ -40,7 +40,7 @@
#ifndef _WIRE_H_
#define _WIRE_H_
-#include "WireBase.h"
+#include <Wire/WireBase.h>
#include <wirish/wirish.h>
/*
@@ -116,7 +116,7 @@ class TwoWire : public WireBase {
* Accept pin numbers for SCL and SDA lines. Set the delay needed
* to create the timing for I2C's Standard Mode and Fast Mode.
*/
- TwoWire(uint8 = SCL, uint8 = SDA, uint8 = SOFT_STANDARD);
+ TwoWire(uint8 scl=SCL, uint8 sda=SDA, uint8 delay=SOFT_STANDARD);
/*
* Sets pins SDA and SCL to OUPTUT_OPEN_DRAIN, joining I2C bus as
@@ -131,6 +131,6 @@ class TwoWire : public WireBase {
~TwoWire();
};
-extern TwoWire Wire();
+extern TwoWire Wire;
#endif // _WIRE_H_
diff --git a/libraries/Wire/WireBase.cpp b/libraries/Wire/WireBase.cpp
index e9b316d..3cb0174 100644
--- a/libraries/Wire/WireBase.cpp
+++ b/libraries/Wire/WireBase.cpp
@@ -38,7 +38,7 @@
* whether it is I2C hardware or emulating software.
*/
-#include "WireBase.h"
+#include <Wire/WireBase.h>
#include <wirish/wirish.h>
void WireBase::begin(uint8 self_addr) {