Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite01e618

Browse files
committed
Merge branch 'main' ofhttps://github.com/lvgl-micropython/lvgl_micropython into threading
# Conflicts:#builder/esp32.py#ext_mod/lcd_bus/esp32_src/rgb_bus.c
2 parents74db177 +50327e5 commite01e618

File tree

14 files changed

+704
-629
lines changed

14 files changed

+704
-629
lines changed

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ Compiling for ESP32
663663
* cmake
664664
* ninja-build
665665
* python
666+
* libusb-1.0-0-dev
666667

667668
* macOS
668669
*`xcode-select -–install`
@@ -1260,4 +1261,13 @@ Bit orders are a tuple of durations. The first 2 numbers define a bit as 0 and t
12601261
| WS2812B| 400| -850| 800| -450| -5000| GRB|
12611262
| SK6813| 240| -800| 740| -200| -800| GRB|
12621263

1264+
<br>
1265+
1266+
#Projects made with this Binding...
1267+
1268+
-----------------------------------------------------------
1269+
1270+
https://github.com/fabse-hack/temp_humidity_micropython_lvgl
1271+
1272+
12631273

‎api_drivers/common_api_drivers/display/st7789/st7789.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
frommicropythonimportconst# NOQA
22
importdisplay_driver_framework
33
importlcd_bus
4+
importlvglaslv
45

56

67
STATE_HIGH=display_driver_framework.STATE_HIGH

‎builder/__init__.py‎

Lines changed: 116 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importshutil
12
importsys
23
importos
34
importsubprocess
@@ -8,6 +9,106 @@
89
_windows_env=None
910

1011

12+
defscrub_build_folder():
13+
forfinos.listdir('build'):
14+
f=os.path.join('build',f)
15+
forpatternin ('.h','manifest.py','.board'):
16+
iff.endswith(pattern):
17+
os.remove(f)
18+
19+
20+
defrevert_files(port):
21+
ifportin ('macOS','raspberry_pi'):
22+
revert_files('unix')
23+
24+
src_path=f'micropy_updates/originals/{port}'
25+
26+
ifportin ('raspberry_pi','macOS'):
27+
port='unix'
28+
29+
dst_path=f'lib/micropython/ports/{port}'
30+
31+
ifnotos.path.exists(src_path)ornotos.listdir(src_path):
32+
return
33+
34+
defiter_path(src_p,dst_p):
35+
forfileinos.listdir(src_p):
36+
src_file=os.path.join(src_p,file)
37+
dst_file=os.path.join(dst_p,file)
38+
39+
ifos.path.isdir(src_file):
40+
iter_path(src_file,dst_file)
41+
os.rmdir(src_file)
42+
else:
43+
shutil.copyfile(src_file,dst_file)
44+
os.remove(src_file)
45+
46+
iter_path(src_path,dst_path)
47+
48+
49+
defcopy_micropy_updates(port):
50+
51+
src_path=f'micropy_updates/{port}'
52+
org_path=f'micropy_updates/originals/{port}'
53+
54+
ifportin ('raspberry_pi','macOS'):
55+
port='unix'
56+
57+
dst_path=f'lib/micropython/ports/{port}'
58+
59+
defiter_files(s_path,d_path,o_path):
60+
forfileinos.listdir(s_path):
61+
src_file=os.path.join(s_path,file)
62+
dst_file=os.path.join(d_path,file)
63+
org_file=os.path.join(o_path,file)
64+
65+
ifos.path.isdir(src_file):
66+
ifnotos.path.exists(org_file):
67+
os.makedirs(org_file)
68+
69+
iter_files(src_file,dst_file,org_file)
70+
else:
71+
shutil.copyfile(dst_file,org_file)
72+
shutil.copyfile(src_file,dst_file)
73+
74+
iter_files(src_path,dst_path,org_path)
75+
76+
77+
defwrite_file(file,data):
78+
withopen(file,'wb')asf:
79+
f.write(data.encode('utf-8'))
80+
81+
82+
defread_file(port,file):
83+
org_path=f'micropy_updates/originals/{port}'
84+
85+
filepath,filename=os.path.split(file)
86+
87+
ifportin ('raspberry_pi','macOS'):
88+
port='unix'
89+
90+
head,tail=os.path.split(filepath)
91+
save_path= []
92+
whiletail!=port:
93+
save_path.insert(0,tail)
94+
head,tail=os.path.split(head)
95+
96+
ifsave_path:
97+
org_path=os.path.join(org_path,*save_path)
98+
99+
ifnotos.path.exists(org_path):
100+
os.makedirs(org_path)
101+
102+
org_file=os.path.join(org_path,filename)
103+
ifnotos.path.exists(org_file):
104+
shutil.copyfile(file,org_file)
105+
106+
withopen(file,'rb')asf:
107+
data=f.read()
108+
109+
returndata.decode('utf-8')
110+
111+
11112
defsetup_windows_build():
12113

13114
global_windows_env
@@ -63,13 +164,7 @@ def set_mp_version(port):
63164

64165

65166
defupdate_mphalport(target):
66-
iftarget=='esp8266':
67-
mphalport_path=f'lib/micropython/ports/{target}/esp_mphal.h'
68-
eliftarget=='pic16bit':
69-
mphalport_path=f'lib/micropython/ports/{target}/pic16bit_mphal.h'
70-
eliftarget=='teensy':
71-
mphalport_path=f'lib/micropython/ports/{target}/teensy_hal.h'
72-
eliftarget=='macOS':
167+
iftargetin ('macOS','raspberry_pi'):
73168
mphalport_path=f'lib/micropython/ports/unix/mphalport.h'
74169
eliftarget=='windows':
75170
mphalport_path=f'lib/micropython/ports/{target}/windows_mphal.h'
@@ -79,18 +174,17 @@ def update_mphalport(target):
79174
ifnotos.path.exists(mphalport_path):
80175
raiseRuntimeError(mphalport_path)
81176

82-
withopen(mphalport_path,'rb')asf:
83-
data=f.read().decode('utf-8')
177+
data=read_file(target,mphalport_path)
84178

85-
if'#ifndef _MPHALPORT_H_'notindata:
179+
if'__MPHALPORT_H__'notindata:
86180
data= (
87-
f'#ifndef_MPHALPORT_H_\n'
88-
f'#define_MPHALPORT_H_\n'
181+
f'#ifndef__MPHALPORT_H__\n'
182+
f'#define__MPHALPORT_H__\n'
89183
f'{data}\n'
90-
f'#endif /*_MPHALPORT_H_ */\n'
184+
f'#endif /*__MPHALPORT_H__ */\n'
91185
)
92-
withopen(mphalport_path,'wb')asf:
93-
f.write(data.encode('utf-8'))
186+
187+
write_file(mphalport_path,data)
94188

95189

96190
defgenerate_manifest(
@@ -157,7 +251,7 @@ def generate_manifest(
157251
forfileinindevs:
158252
ifnotos.path.exists(file):
159253
tmp_file= (
160-
f'{script_dir}/api_drivers/common_api_drivers/indev/{file}.py'
254+
f'{script_dir}/api_drivers/common_api_drivers/indev/{file.lower()}.py'
161255
)
162256

163257
ifnotos.path.exists(tmp_file):
@@ -176,11 +270,11 @@ def generate_manifest(
176270
file=tmp_file
177271

178272
directory,file_name=os.path.split(file)
179-
extension_file=file_name.rsplit('.')[0]+'_extension.py'
273+
extension_file=file_name.rsplit('.',1)[0]+'_extension.py'
180274
extension=os.path.join(directory,extension_file)
181275

182276
ifos.path.exists(extension):
183-
print(extension_file)
277+
print(extension)
184278
entry=f"freeze('{directory}', '{extension_file}')"
185279
manifest_files.append(entry)
186280

@@ -194,7 +288,7 @@ def generate_manifest(
194288
forfileindisplays:
195289
ifnotos.path.exists(file):
196290
tmp_file= (
197-
f'{script_dir}/api_drivers/common_api_drivers/display/{file}'
291+
f'{script_dir}/api_drivers/common_api_drivers/display/{file.lower()}'
198292
)
199293

200294
ifnotos.path.exists(tmp_file):
@@ -205,7 +299,7 @@ def generate_manifest(
205299
ifnotfile_name.endswith('.py'):
206300
continue
207301

208-
print(file_name)
302+
print(os.path.join(tmp_file,file_name))
209303

210304
entry=f"freeze('{tmp_file}', '{file_name}')"
211305
manifest_files.append(entry)
@@ -225,13 +319,7 @@ def generate_manifest(
225319

226320
defget_lvgl():
227321
cmd_= [
228-
'git',
229-
'submodule',
230-
'update',
231-
'--init',
232-
'--depth=1',
233-
'--',
234-
f'lib/lvgl'
322+
'git submodule update --init --depth=1 -- lib/lvgl'
235323
]
236324
print()
237325
print('collecting LVGL')
@@ -244,13 +332,7 @@ def get_lvgl():
244332
defget_micropython():
245333

246334
cmd_= [
247-
'git',
248-
'submodule',
249-
'update',
250-
'--init',
251-
'--depth=1',
252-
'--',
253-
f'lib/micropython'
335+
'git submodule update --init --depth=1 -- lib/micropython',
254336
]
255337
print()
256338
print('collecting MicroPython 1.23.0')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp