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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06ce110c398cd6a9a9ffc89454d7de2127bd7627
4
- data.tar.gz: 5be8458098c21f5b89255b876d10a3c349cde7bf
3
+ metadata.gz: d4d7554eef5b6c62b3693295a8978a01f20cadfe
4
+ data.tar.gz: a936a1693a5e82846b026b3073750860e31102ad
5
5
  SHA512:
6
- metadata.gz: 33ebc3d04479030e9bef35605e625bad436c8785ded69c77103ff2b627c542e00a20c46759393b40e85fe8322c4924eb85ff7a0094e69397665539c65f2aa0b2
7
- data.tar.gz: 7aae26c6e3fa5fb346e0552c776c849248c0cdb014ed148700ff3fcf2407c2328bba12b6c5f877f88ca7f73d465974309cf24e9878a0061ba27c8a110be93f63
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 status.ready? && gcode.is_a?(FB::Gcode) # Flip flop order for performance?
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"
@@ -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.")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: farmbot-serial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Evers