Skip to content

Commit

Permalink
0.11.3 patch release
Browse files Browse the repository at this point in the history
  • Loading branch information
vickash committed Aug 19, 2013
1 parent 298ae0a commit 65b9c43
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog # Changelog


## 0.11.3
* Backport bug fixes from 0.12:
* Listeners weren't working properly on the Arduino MEGA.
* More reliable handshake.

## 0.11.2 ## 0.11.2


* Make servos work better by using the existing Arduino Servo library. * Make servos work better by using the existing Arduino Servo library.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dino 0.11.2 # Dino 0.11.3
[![Build Status](https://secure.travis-ci.org/austinbv/dino.png)](http://travis-ci.org/austinbv/dino) [![Build Status](https://secure.travis-ci.org/austinbv/dino.png)](http://travis-ci.org/austinbv/dino)


## Get Started In No Time ## Get Started In No Time
Expand Down
23 changes: 8 additions & 15 deletions lib/dino/tx_rx/base.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,19 +34,12 @@ def write(message)
end end


def handshake def handshake
flush_read 10.times do
100.times do write("!9000000.")
begin line = gets(1)
write("!9000000.") if line && line.match(/ACK:/)
Timeout::timeout(0.1) do flush_read
line = gets.to_s return line.chop.split(/:/)[1].to_i
if line.match /ACK:/
flush_read
return line.chop.split(/:/)[1].to_i
end
end
rescue
nil
end end
end end
raise BoardNotFound raise BoardNotFound
Expand All @@ -56,8 +49,8 @@ def flush_read
gets until gets == nil gets until gets == nil
end end


def gets def gets(timeout=0.005)
IO.select([io], nil, nil, 0.005) && io.gets IO.select([io], nil, nil, timeout) && io.gets
end end
end end
end end
Expand Down
12 changes: 6 additions & 6 deletions src/lib/Dino.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void Dino::updateListeners() {
} }
} }
void Dino::updateDigitalListeners() { void Dino::updateDigitalListeners() {
for (int i = 0; i < 22; i++) { for (int i = 0; i < PIN_COUNT; i++) {
if (digitalListeners[i]) { if (digitalListeners[i]) {
pin = i; pin = i;
dRead(); dRead();
Expand All @@ -94,7 +94,7 @@ void Dino::updateDigitalListeners() {
} }
} }
void Dino::updateAnalogListeners() { void Dino::updateAnalogListeners() {
for (int i = 0; i < 22; i++) { for (int i = 0; i < PIN_COUNT; i++) {
if (analogListeners[i]) { if (analogListeners[i]) {
pin = i; pin = i;
aRead(); aRead();
Expand Down Expand Up @@ -225,13 +225,13 @@ void Dino::reset() {
heartRate = 4000; // Default heartRate is ~4ms. heartRate = 4000; // Default heartRate is ~4ms.
loopCount = 0; loopCount = 0;
analogDivider = 4; // Update analog listeners every ~16ms. analogDivider = 4; // Update analog listeners every ~16ms.
for (int i = 0; i < 22; i++) digitalListeners[i] = false; for (int i = 0; i < PIN_COUNT; i++) digitalListeners[i] = false;
for (int i = 0; i < 22; i++) digitalListenerValues[i] = 2; for (int i = 0; i < PIN_COUNT; i++) digitalListenerValues[i] = 2;
for (int i = 0; i < 22; i++) analogListeners[i] = false; for (int i = 0; i < PIN_COUNT; i++) analogListeners[i] = false;
lastUpdate = micros(); lastUpdate = micros();
index = 0; index = 0;
#ifdef debug #ifdef debug
Serial.println("Reset the board to defaults. pin "); Serial.println("Reset the board to defaults.");
#endif #endif
sprintf(response, "ACK:%02d", A0); sprintf(response, "ACK:%02d", A0);
} }
Expand Down

0 comments on commit 65b9c43

Please sign in to comment.