fix liquidcrystal luacheck warnings (#3081)
Co-authored-by: Matsievskiy S.V <matsievskiysv@gmail.com>
This commit is contained in:
parent
bbeb09b695
commit
70cad7de5d
|
@ -56,25 +56,25 @@ return function(bus_args)
|
|||
-- Return backend object
|
||||
return {
|
||||
fourbits = true,
|
||||
command = function (screen, cmd)
|
||||
command = function (_, cmd)
|
||||
return send4bitGPIO(cmd, false, false, false)
|
||||
end,
|
||||
busy = function(screen)
|
||||
busy = function(_)
|
||||
if rw == nil then return false end
|
||||
return bit.isset(send4bitGPIO(0xff, false, true, true), 7)
|
||||
end,
|
||||
position = function(screen)
|
||||
position = function(_)
|
||||
if rw == nil then return 0 end
|
||||
return bit.clear(send4bitGPIO(0xff, false, true, true), 7)
|
||||
end,
|
||||
write = function(screen, value)
|
||||
write = function(_, value)
|
||||
return send4bitGPIO(value, true, false, false)
|
||||
end,
|
||||
read = function(screen)
|
||||
read = function(_)
|
||||
if rw == nil then return nil end
|
||||
return send4bitGPIO(0xff, true, true, true)
|
||||
end,
|
||||
backlight = function(screen, on)
|
||||
backlight = function(_, on)
|
||||
if (bl) then gpio.write(bl, on and gpio.HIGH or gpio.LOW) end
|
||||
return on
|
||||
end,
|
||||
|
|
|
@ -53,25 +53,25 @@ return function(bus_args)
|
|||
-- Return backend object
|
||||
return {
|
||||
fourbits = false,
|
||||
command = function (screen, cmd)
|
||||
command = function (_, cmd)
|
||||
return send8bitGPIO(cmd, false, false, false)
|
||||
end,
|
||||
busy = function(screen)
|
||||
busy = function(_)
|
||||
if rw == nil then return false end
|
||||
return bit.isset(send8bitGPIO(0xff, false, true, true), 7)
|
||||
end,
|
||||
position = function(screen)
|
||||
position = function(_)
|
||||
if rw == nil then return 0 end
|
||||
return bit.clear(send8bitGPIO(0xff, false, true, true), 7)
|
||||
end,
|
||||
write = function(screen, value)
|
||||
write = function(_, value)
|
||||
return send8bitGPIO(value, true, false, false)
|
||||
end,
|
||||
read = function(screen)
|
||||
read = function(_)
|
||||
if rw == nil then return nil end
|
||||
return send8bitGPIO(0xff, true, true, true)
|
||||
end,
|
||||
backlight = function(screen, on)
|
||||
backlight = function(_, on)
|
||||
if (bl) then gpio.write(bl, on and gpio.HIGH or gpio.LOW) end
|
||||
return on
|
||||
end,
|
||||
|
|
|
@ -73,26 +73,26 @@ return function(bus_args)
|
|||
-- Return backend object
|
||||
return {
|
||||
fourbits = true,
|
||||
command = function (screen, cmd)
|
||||
command = function (_, cmd)
|
||||
return send4bitI2C(cmd, false, false, false)
|
||||
end,
|
||||
busy = function(screen)
|
||||
busy = function(_)
|
||||
local rv = send4bitI2C(0xff, false, true, true)
|
||||
send4bitI2C(bit.bor(0x80, bit.clear(rv, 7)), false, false, false)
|
||||
return bit.isset(rv, 7)
|
||||
end,
|
||||
position = function(screen)
|
||||
position = function(_)
|
||||
local rv = bit.clear(send4bitI2C(0xff, false, true, true), 7)
|
||||
send4bitI2C(bit.bor(0x80, rv), false, false, false)
|
||||
return rv
|
||||
end,
|
||||
write = function(screen, value)
|
||||
write = function(_, value)
|
||||
return send4bitI2C(value, true, false, false)
|
||||
end,
|
||||
read = function(screen)
|
||||
read = function(_)
|
||||
return send4bitI2C(0xff, true, true, true)
|
||||
end,
|
||||
backlight = function(screen, on)
|
||||
backlight = function(_, on)
|
||||
backlight = on
|
||||
local rv = bit.clear(send4bitI2C(0xff, false, true, true), 7)
|
||||
send4bitI2C(bit.bor(0x80, rv), false, false, false)
|
||||
|
|
Loading…
Reference in New Issue