1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-17 08:47:39 +00:00

manipulator device driver

This commit is contained in:
kepler155c@gmail.com
2018-12-01 19:09:24 -05:00
parent 1fb5379b11
commit 34c653ca1b
2 changed files with 69 additions and 13 deletions

View File

@@ -55,19 +55,21 @@ function Peripheral.addDevice(deviceList, side)
end
-- this can randomly fail
pcall(function()
deviceList[name] = Peripheral.wrap(side)
end)
if not deviceList[name] then
pcall(function()
deviceList[name] = Peripheral.wrap(side)
end)
if deviceList[name] then
Util.merge(deviceList[name], {
name = name,
type = ptype,
side = side,
})
return deviceList[name]
if deviceList[name] then
Util.merge(deviceList[name], {
name = name,
type = ptype,
side = side,
})
end
end
return deviceList[name]
end
function Peripheral.getBySide(side)