Only format ESP if no file is specified
This commit is contained in:
parent
f72295e709
commit
f93d0df461
6
init.lua
6
init.lua
@ -5,11 +5,13 @@ ws2812.init() -- WS2812 LEDs initialized on GPIO2
|
||||
MAXLEDS=110
|
||||
counter1=0
|
||||
ws2812.write(string.char(0,0,0):rep(114))
|
||||
tmr.alarm(2, 85, 1, function()
|
||||
local bootledtimer = tmr.create()
|
||||
bootledtimer:register(5000, tmr.ALARM_AUTO, function (t)
|
||||
counter1=counter1+1
|
||||
spaceLeds = math.max(MAXLEDS - (counter1*2), 0)
|
||||
ws2812.write(string.char(128,0,0):rep(counter1) .. string.char(0,0,0):rep(spaceLeds) .. string.char(0,0,64):rep(counter1))
|
||||
end)
|
||||
bootledtimer:start()
|
||||
|
||||
local blacklistfile="init.lua config.lua config.lua.new webpage.html"
|
||||
function recompileAll()
|
||||
@ -44,6 +46,7 @@ end
|
||||
|
||||
local initTimer = tmr.create()
|
||||
initTimer:register(5000, tmr.ALARM_SINGLE, function (t)
|
||||
bootledtimer:unregister()
|
||||
if (
|
||||
(file.open("main.lua")) or
|
||||
(file.open("timecore.lua")) or
|
||||
@ -69,4 +72,3 @@ initTimer:register(5000, tmr.ALARM_SINGLE, function (t)
|
||||
t:unregister()
|
||||
end)
|
||||
initTimer:start()
|
||||
print("Init file end reached")
|
||||
|
@ -32,12 +32,14 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# Format filesystem first
|
||||
echo "Format the complete ESP"
|
||||
python3 $LUATOOL -p $DEVICE -w -b $BAUD
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "STOOOOP"
|
||||
exit 1
|
||||
if [ $# -eq 1 ]; then
|
||||
# Format filesystem first
|
||||
echo "Format the complete ESP"
|
||||
python3 $LUATOOL -p $DEVICE -w -b $BAUD
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "STOOOOP"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
#stty -F $DEVICE $BAUD
|
||||
|
Loading…
Reference in New Issue
Block a user