Work more with even less memory! what a terrible world :-/
This commit is contained in:
		@@ -151,5 +151,6 @@ function generateLEDs(words, color)
 | 
				
			|||||||
  else
 | 
					  else
 | 
				
			||||||
    buf= buf .. white:rep(1)
 | 
					    buf= buf .. white:rep(1)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					  collectgarbage()
 | 
				
			||||||
  return buf
 | 
					  return buf
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,7 @@ function sendWebPage(conn,answertype)
 | 
				
			|||||||
    timezoneoffset=1
 | 
					    timezoneoffset=1
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
  buf="HTTP/1.1 200 OK\nServer: NodeMCU\nContent-Type: text/html\n\n"
 | 
					  buf="HTTP/1.1 200 OK\nServer: NodeMCU\nContent-Type: text/html\n\n"
 | 
				
			||||||
  if (node.heap() < 10000) then
 | 
					  if (node.heap() < 8000) then
 | 
				
			||||||
  buf = buf .. "<h1>Busy, please come later again</h1>"
 | 
					  buf = buf .. "<h1>Busy, please come later again</h1>"
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
  buf = buf .. "<html>"
 | 
					  buf = buf .. "<html>"
 | 
				
			||||||
@@ -73,6 +73,7 @@ function startWebServer()
 | 
				
			|||||||
      file.close()
 | 
					      file.close()
 | 
				
			||||||
      file.remove(configFile)
 | 
					      file.remove(configFile)
 | 
				
			||||||
      if (file.rename(configFile .. ".new", configFile)) then
 | 
					      if (file.rename(configFile .. ".new", configFile)) then
 | 
				
			||||||
 | 
					        dofile(configFile) -- load the new values
 | 
				
			||||||
        sendWebPage(conn,2) -- success
 | 
					        sendWebPage(conn,2) -- success
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        sendWebPage(conn,3) -- error
 | 
					        sendWebPage(conn,3) -- error
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -123,6 +123,6 @@ function display_timestat(hours, minutes, longmode)
 | 
				
			|||||||
 elseif (hours == 12) then
 | 
					 elseif (hours == 12) then
 | 
				
			||||||
  ret.twelve=1 
 | 
					  ret.twelve=1 
 | 
				
			||||||
 end
 | 
					 end
 | 
				
			||||||
 
 | 
					 collectgarbage()
 | 
				
			||||||
 return ret
 | 
					 return ret
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user