update gate interface for new protected port functionality
This commit is contained in:
parent
1dce343c87
commit
1b7915de4c
20
sim/gate.lua
20
sim/gate.lua
@ -16,10 +16,30 @@ function Gate:addport(port)
|
|||||||
port.gate = self
|
port.gate = self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Gate:getportstate(index)
|
||||||
|
return self.ports[index].state
|
||||||
|
end
|
||||||
|
|
||||||
function Gate:setportstate(index, state)
|
function Gate:setportstate(index, state)
|
||||||
self.ports[index]:setstate(state)
|
self.ports[index]:setstate(state)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Gate:initdata()
|
||||||
|
self.data = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gate:getdata()
|
||||||
|
return self.data
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gate:getportisrising(index)
|
||||||
|
return self.ports[index]:isrising()
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gate:getportisfalling(index)
|
||||||
|
return self.ports[index]:isfalling()
|
||||||
|
end
|
||||||
|
|
||||||
-- function Gate:cb(...)
|
-- function Gate:cb(...)
|
||||||
-- local args = {...}
|
-- local args = {...}
|
||||||
-- local str = tostring(#args)
|
-- local str = tostring(#args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user