aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-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
-rw-r--r--wirish/HardwareSPI.cpp5
-rw-r--r--wirish/include/wirish/HardwareSPI.h5
-rw-r--r--wirish/include/wirish/wirish.h2
-rw-r--r--wirish/usb_serial.cpp6
10 files changed, 23 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 6a76000..1f19f37 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ BUILD_PATH = build
LIBMAPLE_PATH := $(SRCROOT)/libmaple
WIRISH_PATH := $(SRCROOT)/wirish
SUPPORT_PATH := $(SRCROOT)/support
+LIBRARIES_PATH := $(SRCROOT)/libraries
# Support files for linker
LDDIR := $(SUPPORT_PATH)/ld
# Support files for this Makefile
@@ -52,6 +53,7 @@ include $(MAKEDIR)/build-templates.mk
# It slows compilation noticeably; remove after 1 release.
TARGET_FLAGS += -I$(LIBMAPLE_PATH)/include/libmaple \
-I$(WIRISH_PATH)/include/wirish
+TARGET_FLAGS += -I$(LIBRARIES_PATH) # for internal lib. includes, e.g. <Wire/WireBase.h>
GLOBAL_CFLAGS := -Os -g3 -gdwarf-2 -nostdlib \
-ffunction-sections -fdata-sections \
-Wl,--gc-sections $(TARGET_FLAGS)
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) {
diff --git a/wirish/HardwareSPI.cpp b/wirish/HardwareSPI.cpp
index 120cd67..94985eb 100644
--- a/wirish/HardwareSPI.cpp
+++ b/wirish/HardwareSPI.cpp
@@ -38,6 +38,11 @@
#include <wirish/wirish.h>
#include <wirish/boards.h>
+#if CYCLES_PER_MICROSECOND != 72
+/* TODO [0.2.0?] something smarter than this */
+#warning "Unexpected clock speed; SPI frequency calculation will be incorrect"
+#endif
+
struct spi_pins {
uint8 nss;
uint8 sck;
diff --git a/wirish/include/wirish/HardwareSPI.h b/wirish/include/wirish/HardwareSPI.h
index a1a4a73..4b61b58 100644
--- a/wirish/include/wirish/HardwareSPI.h
+++ b/wirish/include/wirish/HardwareSPI.h
@@ -57,11 +57,6 @@ typedef enum SPIFrequency {
#define MAX_SPI_FREQS 8
-#if CYCLES_PER_MICROSECOND != 72
-/* TODO [0.2.0?] something smarter than this */
-#warning "Unexpected clock speed; SPI frequency calculation will be incorrect"
-#endif
-
/**
* @brief Wirish SPI interface.
*
diff --git a/wirish/include/wirish/wirish.h b/wirish/include/wirish/wirish.h
index 4ebd66f..610aa3f 100644
--- a/wirish/include/wirish/wirish.h
+++ b/wirish/include/wirish/wirish.h
@@ -54,6 +54,8 @@
#include <libmaple/libmaple.h>
+#include <stdint.h>
+
/* Wiring macros and bit defines */
#define true 0x1
diff --git a/wirish/usb_serial.cpp b/wirish/usb_serial.cpp
index af0d710..380f197 100644
--- a/wirish/usb_serial.cpp
+++ b/wirish/usb_serial.cpp
@@ -43,8 +43,10 @@
* Hooks used for bootloader reset signalling
*/
+#if BOARD_HAVE_SERIALUSB
static void rxHook(unsigned, void*);
static void ifaceSetupHook(unsigned, void*);
+#endif
/*
* USBSerial interface
@@ -147,6 +149,8 @@ USBSerial SerialUSB;
* Bootloader hook implementations
*/
+#if BOARD_HAVE_SERIALUSB
+
enum reset_state_t {
DTR_UNSET,
DTR_HIGH,
@@ -241,3 +245,5 @@ static void rxHook(unsigned hook, void *ignored) {
}
}
}
+
+#endif // BOARD_HAVE_SERIALUSB