Skip to content

Commit

Permalink
Check I2C::Bus instance exists before updating it
Browse files Browse the repository at this point in the history
  • Loading branch information
vickash committed Sep 27, 2024
1 parent 7ff144d commit 0e4acb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/denko/board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def update(line)
match = pin.match /\AI2C(\d*)/
if match
dev_index = match[1].to_i
hw_i2c_devs[dev_index].update(message)
dev = hw_i2c_devs[dev_index]
dev.update(message) if dev
return
end

Expand Down

0 comments on commit 0e4acb1

Please sign in to comment.