farmbot-serial 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arduino.rb +2 -2
- data/spec/lib/arduino_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4d7554eef5b6c62b3693295a8978a01f20cadfe
|
4
|
+
data.tar.gz: a936a1693a5e82846b026b3073750860e31102ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ad40cff8705449eb7928fe56c88228c55f7d0b57473814d9ee2d60c6cc5216c682e655eac4ad7aa793a2ff4fa898afcd299c0c974c4d12c171bdbf271936249
|
7
|
+
data.tar.gz: 0caed3ec33fb392b8cc9f95129614c5de869b78c20370070f2eb81176816a2bc889bf2247d992576a8e381ae47db82b1e32583a368011cd22dc6661cf08c29ea
|
data/lib/arduino.rb
CHANGED
@@ -68,8 +68,8 @@ module FB
|
|
68
68
|
def maybe_execute_command
|
69
69
|
sleep 0.05 # Throttle CPU
|
70
70
|
gcode = @outbound_queue.pop
|
71
|
-
return unless gcode
|
72
|
-
if
|
71
|
+
return unless gcode && status.ready?
|
72
|
+
if gcode.is_a?(FB::Gcode)
|
73
73
|
serial_port.puts gcode
|
74
74
|
status[:last] = gcode.name
|
75
75
|
status[:BUSY] = 1 # If not, pi will race arduino and "talk too fast"
|
data/spec/lib/arduino_spec.rb
CHANGED
@@ -96,6 +96,7 @@ describe FB::Arduino do
|
|
96
96
|
|
97
97
|
it 'Flips out if a message is not a GCode object.' do
|
98
98
|
bot.outbound_queue.push "I don't think so!"
|
99
|
+
bot.status[:BUSY] = 0
|
99
100
|
bot.maybe_execute_command
|
100
101
|
expect(logger.message).to eq("Outbound messages must be GCode objects. "\
|
101
102
|
"Use of String:\"I don't think so!\" is not permitted.")
|