Refactored character counting function

This commit is contained in:
ollo 2018-01-28 14:11:14 +01:00
parent be8b8a99ca
commit cb5205d4af
2 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ function displayTime()
time = getTime(sec, timezoneoffset) time = getTime(sec, timezoneoffset)
words = display_timestat(time.hour, time.minute) words = display_timestat(time.hour, time.minute)
local charactersOfTime = display_countwords_de(words) local charactersOfTime = display_countcharacters_de(words)
ledBuf = generateLEDs(words, color, color1, color2, color3, color4, ledBuf = generateLEDs(words, color, color1, color2, color3, color4,
charactersOfTime) charactersOfTime)

View File

@ -136,11 +136,11 @@ function display_timestat(hours, minutes, longmode)
return ret return ret
end end
-- @fn display_countwords -- @fn display_countcharacters_de
-- Count the amount of characters, used to describe the current time in words -- Count the amount of characters, used to describe the current time in words
-- @param words the same structure, as generated with the function @see display_timestat -- @param words the same structure, as generated with the function @see display_timestat
-- @return the amount of words, used to describe the time or <code>0</code> on errors -- @return the amount of words, used to describe the time or <code>0</code> on errors
function display_countwords_de(words) function display_countcharacters_de(words)
local amount=0 local amount=0
if (words.itis == 1) then if (words.itis == 1) then
amount = amount + 5 amount = amount + 5