From 2479eec4afb05aa3df2a58a174d0873e5eb2c7ba Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Sun, 20 Feb 2022 21:10:07 -0500 Subject: [PATCH] Add explanatory comments --- mesecons_fpga/init.lua | 2 ++ mesecons_luacontroller/init.lua | 2 ++ mesecons_microcontroller/init.lua | 2 ++ 3 files changed, 6 insertions(+) diff --git a/mesecons_fpga/init.lua b/mesecons_fpga/init.lua index 622dd46..32412f4 100644 --- a/mesecons_fpga/init.lua +++ b/mesecons_fpga/init.lua @@ -327,6 +327,8 @@ plg.update = function(pos) plg.setports(pos, A, B, C, D) end +-- Updates the port states according to the signal change. +-- Returns whether the port states actually changed. plg.ports_changed = function(pos, rule, newstate) if rule == nil then return false end local meta = minetest.get_meta(pos) diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index f77d4b3..8e60b1a 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -43,6 +43,8 @@ local rules = { ------------------ -- These helpers are required to set the port states of the luacontroller +-- Updates the real port states according to the signal change. +-- Returns whether the real port states actually changed. local function update_real_port_states(pos, rule_name, new_state) local meta = minetest.get_meta(pos) if rule_name == nil then diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua index 02f7bc7..7134dc5 100644 --- a/mesecons_microcontroller/init.lua +++ b/mesecons_microcontroller/init.lua @@ -656,6 +656,8 @@ yc.set_portstate = function(port, state, L) return L end +-- Updates the real port states according to the signal change. +-- Returns whether the real port states actually changed. yc.update_real_portstates = function(pos, _, rulename, newstate) local meta = minetest.get_meta(pos) if rulename == nil then