This repository was archived by the owner on Oct 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot.py
More file actions
53 lines (53 loc) · 1.57 KB
/
boot.py
File metadata and controls
53 lines (53 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from LPSystem.devlib import*
from LPSystem.Core import BinImage
import gc,_thread,time
stop = False
speed = 0.01
logo = BinImage("/LPSystem/System/images/logo.bin")
gc.collect()
def _load():
global stop,speed
i = 0
while True:
if not stop:
oled.fill(0)
oled.Bitmap(52,19,logo,24,24,1)
oled.Bitmap(54,44,BinImage("/LPSystem/System/images/loads.bin",i),20,20,1)
oled.show()
i = i+1 if i<17 else 0
time.sleep(speed)
else:break
#----bootloader-----#
StartSystem = False
oled.fill(0)
oled.DispChar("---LP OS 系统加载器---",0,0)
oled.DispChar("A-进入LP OS",0,16)
oled.DispChar("B-进入main.py",0,32)
oled.show()
while True:
if button_a.is_pressed():
StartSystem = True
break
elif button_b.is_pressed():
break
#-----启动项------#
if StartSystem:
_thread.start_new_thread(_load,())
import ntptime
with open('LPSystem/System/network.conf','r') as f:
f.seek(0)
config = f.readline().replace('\r','').replace('\n','')
while not config == '':
config = config.split(',')
print("Connecting to WiFi:",config[0])
if wifi().connectWiFi(config[0],config[1]):
ntptime.settime(timezone=8, server='time.windows.com')
break
config = f.readline().replace('\r','').replace('\n','')
#----------------#
logo,loads = [None] * 2
del loads,logo
gc.collect()
print("[info] Memory Free:",gc.mem_free())
stop = True
execfile("/LPSystem/Desktop.py")