diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-06-29 12:37:10 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2012-06-29 12:40:05 -0400 |
commit | 0df7e0dc26baf8afafc1aab595b416eb70bf2dd4 (patch) | |
tree | e31620ca29e8a1f3469c951a39378e13792df365 /libraries/Wire | |
parent | ab43e6240c8e5ecbc805e19d056bca8b9ee3b6ca (diff) | |
download | librambutan-0df7e0dc26baf8afafc1aab595b416eb70bf2dd4.tar.gz librambutan-0df7e0dc26baf8afafc1aab595b416eb70bf2dd4.zip |
libraries/Wire: Cosmetics, include style touchups.
Switch to the new include style. Move includes in headers inside the
include guards, for the GCC multiple include parser optimization. Make
80-column clean. Add newlines at end of files.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libraries/Wire')
-rw-r--r-- | libraries/Wire/HardWire.cpp | 2 | ||||
-rw-r--r-- | libraries/Wire/HardWire.h | 13 | ||||
-rw-r--r-- | libraries/Wire/Wire.h | 17 | ||||
-rw-r--r-- | libraries/Wire/WireBase.cpp | 4 | ||||
-rw-r--r-- | libraries/Wire/WireBase.h | 15 |
5 files changed, 25 insertions, 26 deletions
diff --git a/libraries/Wire/HardWire.cpp b/libraries/Wire/HardWire.cpp index 9176a87..9182ae2 100644 --- a/libraries/Wire/HardWire.cpp +++ b/libraries/Wire/HardWire.cpp @@ -63,4 +63,4 @@ HardWire::HardWire(uint8 dev_sel, uint8 flags) { HardWire::~HardWire() { i2c_disable(sel_hard); sel_hard = 0; -}
\ No newline at end of file +} diff --git a/libraries/Wire/HardWire.h b/libraries/Wire/HardWire.h index 91e141d..d3f4ed8 100644 --- a/libraries/Wire/HardWire.h +++ b/libraries/Wire/HardWire.h @@ -36,13 +36,12 @@ * users easy interaction with the I2C Hardware in a familiar method. */ -#include "wirish.h" -#include "WireBase.h" - #ifndef _HARDWIRE_H_ #define _HARDWIRE_H_ -#include "i2c.h" +#include "WireBase.h" +#include <wirish/wirish.h> +#include <libmaple/i2c.h> class HardWire : public WireBase { private: @@ -50,8 +49,8 @@ private: uint8 dev_flags; protected: /* - * Processes the incoming I2C message defined by WireBase to the hardware. If - * an error occured, restart the I2C device. + * Processes the incoming I2C message defined by WireBase to the + * hardware. If an error occured, restart the I2C device. */ uint8 process(); public: @@ -67,4 +66,4 @@ public: ~HardWire(); }; -#endif // _HARDWIRE_H_
\ No newline at end of file +#endif // _HARDWIRE_H_ diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h index 7827e45..812132b 100644 --- a/libraries/Wire/Wire.h +++ b/libraries/Wire/Wire.h @@ -37,12 +37,12 @@ * modifications by gke and ala42. */ -#include "wirish.h" -#include "WireBase.h" - #ifndef _WIRE_H_ #define _WIRE_H_ +#include "WireBase.h" +#include <wirish/wirish.h> + /* * On the Maple, let the default pins be in the same location as the Arduino * pins @@ -113,14 +113,15 @@ class TwoWire : public WireBase { uint8 process(); public: /* - * Accept pin numbers for SCL and SDA lines. Set the delay needed to create the - * timing for I2C's Standard Mode and Fast Mode. + * 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); /* - * Sets pins SDA and SCL to OUPTUT_OPEN_DRAIN, joining I2C bus as master. This - * function overwrites the default behaviour of .begin(uint8) in WireBase + * Sets pins SDA and SCL to OUPTUT_OPEN_DRAIN, joining I2C bus as + * master. This function overwrites the default behaviour of + * .begin(uint8) in WireBase */ void begin(uint8 = 0x00); @@ -132,4 +133,4 @@ class TwoWire : public WireBase { extern TwoWire Wire(); -#endif // _WIRE_H_
\ No newline at end of file +#endif // _WIRE_H_ diff --git a/libraries/Wire/WireBase.cpp b/libraries/Wire/WireBase.cpp index 00ca644..e9b316d 100644 --- a/libraries/Wire/WireBase.cpp +++ b/libraries/Wire/WireBase.cpp @@ -39,7 +39,7 @@ */ #include "WireBase.h" -#include "wirish.h" +#include <wirish/wirish.h> void WireBase::begin(uint8 self_addr) { tx_buf_idx = 0; @@ -137,4 +137,4 @@ uint8 WireBase::receive() { return temp; } return rx_buf[rx_buf_idx++]; -}
\ No newline at end of file +} diff --git a/libraries/Wire/WireBase.h b/libraries/Wire/WireBase.h index 555cbaf..e154476 100644 --- a/libraries/Wire/WireBase.h +++ b/libraries/Wire/WireBase.h @@ -38,12 +38,11 @@ * whether it is I2C hardware or emulating software. */ -#include "wirish.h" - #ifndef _WIREBASE_H_ #define _WIREBASE_H_ -#include "i2c.h" +#include <wirish/wirish.h> +#include <libmaple/i2c.h> #define WIRE_BUFSIZ 32 @@ -88,14 +87,14 @@ public: void beginTransmission(int); /* - * Call the process function to process the message if the TX buffer has not - * overflowed. + * Call the process function to process the message if the TX + * buffer has not overflowed. */ uint8 endTransmission(void); /* - * Request bytes from a slave device and process the request, storing into the - * receiving buffer. + * Request bytes from a slave device and process the request, + * storing into the receiving buffer. */ uint8 requestFrom(uint8, int); @@ -141,4 +140,4 @@ public: uint8 receive(); }; -#endif // _WIREBASE_H_
\ No newline at end of file +#endif // _WIREBASE_H_ |