Skip to content

Commit

Permalink
fix liquidcrystal luacheck warnings (#3081)
Browse files Browse the repository at this point in the history
Co-authored-by: Matsievskiy S.V <[email protected]>
  • Loading branch information
seregaxvm and Matsievskiy S.V authored Apr 29, 2020
1 parent 9ef5c7d commit cd6452d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions lua_modules/liquidcrystal/lc-gpio4bit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions lua_modules/liquidcrystal/lc-gpio8bit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions lua_modules/liquidcrystal/lc-i2c4bit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd6452d

Please sign in to comment.