From b6b6bdcf8256c635caeaa53c227e2444ed36c5b4 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 12 Aug 2014 08:27:34 -0700 Subject: Getting the box ready for Daniel. This is a first pass at cleaning up the code and getting the libraries to build with Arduino 1.0. I've started reworking the code for the new adventure. Dialog notes are in notes.txt. I've also added a Makefile to build from the command line. --- libraries/NewSoftSerial/NewSoftSerial.cpp | 9 +++++---- libraries/NewSoftSerial/NewSoftSerial.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'libraries/NewSoftSerial') diff --git a/libraries/NewSoftSerial/NewSoftSerial.cpp b/libraries/NewSoftSerial/NewSoftSerial.cpp index 463ab01..54cb41e 100644 --- a/libraries/NewSoftSerial/NewSoftSerial.cpp +++ b/libraries/NewSoftSerial/NewSoftSerial.cpp @@ -36,8 +36,7 @@ http://arduiniana.org. // #include #include -#include "WConstants.h" -#include "pins_arduino.h" +#include "Arduino.h" #include "NewSoftSerial.h" // Abstractions for maximum portability between processors @@ -458,10 +457,10 @@ uint8_t NewSoftSerial::available(void) return (_receive_buffer_tail + _NewSS_MAX_RX_BUFF - _receive_buffer_head) % _NewSS_MAX_RX_BUFF; } -void NewSoftSerial::write(uint8_t b) +size_t NewSoftSerial::write(uint8_t b) { if (_tx_delay == 0) - return; + return 0; activate(); @@ -504,6 +503,8 @@ void NewSoftSerial::write(uint8_t b) SREG = oldSREG; // turn interrupts back on tunedDelay(_tx_delay); + + return 1; } #if !defined(cbi) diff --git a/libraries/NewSoftSerial/NewSoftSerial.h b/libraries/NewSoftSerial/NewSoftSerial.h index 1e39201..dd80c40 100644 --- a/libraries/NewSoftSerial/NewSoftSerial.h +++ b/libraries/NewSoftSerial/NewSoftSerial.h @@ -68,7 +68,7 @@ private: // private methods void recv(); bool activate(); - virtual void write(uint8_t byte); + virtual size_t write(uint8_t byte); uint8_t rx_pin_read(); void tx_pin_write(uint8_t pin_state); void setTX(uint8_t transmitPin); -- cgit v1.2.3