Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TicArduino compile for Particle devices #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void TicSerial::getSegment(TicCommand cmd, uint8_t offset,
serialW7(offset & 0x7F);
serialW7(length | (offset >> 1 & 0x40));

uint8_t byteCount = _stream->readBytes((uint8_t *)buffer, length);
uint8_t byteCount = _stream->readBytes((char*)buffer, length);
if (byteCount != length)
{
_lastError = 50;
Expand Down
26 changes: 17 additions & 9 deletions Tic.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ enum class TicReset
PowerUp = 0,
Brownout = 1,
ResetLine = 2,
Watchdog = 4,
TicWatchdog = 4,
Software = 8,
StackOverflow = 16,
StackUnderflow = 32,
Expand Down Expand Up @@ -228,11 +228,19 @@ enum class TicAgcFrequencyLimit
/// This enum defines the Tic's control pins.
enum class TicPin
{
SCL = 0,
SDA = 1,
TX = 2,
RX = 3,
RC = 4,
SCLPin = 0,
SDAPin = 1,
TXPin = 2,
RXPin = 3,
RCPin = 4,

#ifndef SCL
SCL = SCLPin,
SDA = SDAPin,
TX = TXPin,
RX = RXPin,
RC = RCPin,
#endif
};

/// This enum defines the Tic's pin states.
Expand Down Expand Up @@ -1043,7 +1051,7 @@ class TicBase
///
/// Example usage:
/// ```
/// uint16_t reading = getAnalogReading(TicPin::SDA);
/// uint16_t reading = getAnalogReading(TicPin::SDAPin);
/// if (reading != TicInputNull && reading < 32768)
/// {
/// // The reading is less than about 2.4 V.
Expand All @@ -1061,7 +1069,7 @@ class TicBase
///
/// Example usage:
/// ```
/// if (tic.getDigitalReading(TicPin::RC))
/// if (tic.getDigitalReading(TicPin::RCPin))
/// {
/// // Something is driving the RC pin high.
/// }
Expand All @@ -1080,7 +1088,7 @@ class TicBase
/// Example usage:
///
/// ```
/// if (tic.getPinState(TicPin::SCL) == TicPinState::OutputHigh)
/// if (tic.getPinState(TicPin::SCLPin) == TicPinState::OutputHigh)
/// {
/// // SCL is driving high.
/// }
Expand Down
Loading