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 backend object
|
||||||
return {
|
return {
|
||||||
fourbits = true,
|
fourbits = true,
|
||||||
command = function (screen, cmd)
|
command = function (_, cmd)
|
||||||
return send4bitGPIO(cmd, false, false, false)
|
return send4bitGPIO(cmd, false, false, false)
|
||||||
end,
|
end,
|
||||||
busy = function(screen)
|
busy = function(_)
|
||||||
if rw == nil then return false end
|
if rw == nil then return false end
|
||||||
return bit.isset(send4bitGPIO(0xff, false, true, true), 7)
|
return bit.isset(send4bitGPIO(0xff, false, true, true), 7)
|
||||||
end,
|
end,
|
||||||
position = function(screen)
|
position = function(_)
|
||||||
if rw == nil then return 0 end
|
if rw == nil then return 0 end
|
||||||
return bit.clear(send4bitGPIO(0xff, false, true, true), 7)
|
return bit.clear(send4bitGPIO(0xff, false, true, true), 7)
|
||||||
end,
|
end,
|
||||||
write = function(screen, value)
|
write = function(_, value)
|
||||||
return send4bitGPIO(value, true, false, false)
|
return send4bitGPIO(value, true, false, false)
|
||||||
end,
|
end,
|
||||||
read = function(screen)
|
read = function(_)
|
||||||
if rw == nil then return nil end
|
if rw == nil then return nil end
|
||||||
return send4bitGPIO(0xff, true, true, true)
|
return send4bitGPIO(0xff, true, true, true)
|
||||||
end,
|
end,
|
||||||
backlight = function(screen, on)
|
backlight = function(_, on)
|
||||||
if (bl) then gpio.write(bl, on and gpio.HIGH or gpio.LOW) end
|
if (bl) then gpio.write(bl, on and gpio.HIGH or gpio.LOW) end
|
||||||
return on
|
return on
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -53,25 +53,25 @@ return function(bus_args)
|
||||||
-- Return backend object
|
-- Return backend object
|
||||||
return {
|
return {
|
||||||
fourbits = false,
|
fourbits = false,
|
||||||
command = function (screen, cmd)
|
command = function (_, cmd)
|
||||||
return send8bitGPIO(cmd, false, false, false)
|
return send8bitGPIO(cmd, false, false, false)
|
||||||
end,
|
end,
|
||||||
busy = function(screen)
|
busy = function(_)
|
||||||
if rw == nil then return false end
|
if rw == nil then return false end
|
||||||
return bit.isset(send8bitGPIO(0xff, false, true, true), 7)
|
return bit.isset(send8bitGPIO(0xff, false, true, true), 7)
|
||||||
end,
|
end,
|
||||||
position = function(screen)
|
position = function(_)
|
||||||
if rw == nil then return 0 end
|
if rw == nil then return 0 end
|
||||||
return bit.clear(send8bitGPIO(0xff, false, true, true), 7)
|
return bit.clear(send8bitGPIO(0xff, false, true, true), 7)
|
||||||
end,
|
end,
|
||||||
write = function(screen, value)
|
write = function(_, value)
|
||||||
return send8bitGPIO(value, true, false, false)
|
return send8bitGPIO(value, true, false, false)
|
||||||
end,
|
end,
|
||||||
read = function(screen)
|
read = function(_)
|
||||||
if rw == nil then return nil end
|
if rw == nil then return nil end
|
||||||
return send8bitGPIO(0xff, true, true, true)
|
return send8bitGPIO(0xff, true, true, true)
|
||||||
end,
|
end,
|
||||||
backlight = function(screen, on)
|
backlight = function(_, on)
|
||||||
if (bl) then gpio.write(bl, on and gpio.HIGH or gpio.LOW) end
|
if (bl) then gpio.write(bl, on and gpio.HIGH or gpio.LOW) end
|
||||||
return on
|
return on
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -73,26 +73,26 @@ return function(bus_args)
|
||||||
-- Return backend object
|
-- Return backend object
|
||||||
return {
|
return {
|
||||||
fourbits = true,
|
fourbits = true,
|
||||||
command = function (screen, cmd)
|
command = function (_, cmd)
|
||||||
return send4bitI2C(cmd, false, false, false)
|
return send4bitI2C(cmd, false, false, false)
|
||||||
end,
|
end,
|
||||||
busy = function(screen)
|
busy = function(_)
|
||||||
local rv = send4bitI2C(0xff, false, true, true)
|
local rv = send4bitI2C(0xff, false, true, true)
|
||||||
send4bitI2C(bit.bor(0x80, bit.clear(rv, 7)), false, false, false)
|
send4bitI2C(bit.bor(0x80, bit.clear(rv, 7)), false, false, false)
|
||||||
return bit.isset(rv, 7)
|
return bit.isset(rv, 7)
|
||||||
end,
|
end,
|
||||||
position = function(screen)
|
position = function(_)
|
||||||
local rv = bit.clear(send4bitI2C(0xff, false, true, true), 7)
|
local rv = bit.clear(send4bitI2C(0xff, false, true, true), 7)
|
||||||
send4bitI2C(bit.bor(0x80, rv), false, false, false)
|
send4bitI2C(bit.bor(0x80, rv), false, false, false)
|
||||||
return rv
|
return rv
|
||||||
end,
|
end,
|
||||||
write = function(screen, value)
|
write = function(_, value)
|
||||||
return send4bitI2C(value, true, false, false)
|
return send4bitI2C(value, true, false, false)
|
||||||
end,
|
end,
|
||||||
read = function(screen)
|
read = function(_)
|
||||||
return send4bitI2C(0xff, true, true, true)
|
return send4bitI2C(0xff, true, true, true)
|
||||||
end,
|
end,
|
||||||
backlight = function(screen, on)
|
backlight = function(_, on)
|
||||||
backlight = on
|
backlight = on
|
||||||
local rv = bit.clear(send4bitI2C(0xff, false, true, true), 7)
|
local rv = bit.clear(send4bitI2C(0xff, false, true, true), 7)
|
||||||
send4bitI2C(bit.bor(0x80, rv), false, false, false)
|
send4bitI2C(bit.bor(0x80, rv), false, false, false)
|
||||||
|
|
Loading…
Reference in New Issue