Skip to content

Commit a9e007b

Browse files
committed
ports/quectel: Update boot and manifest.
1 parent a2792d9 commit a9e007b

File tree

5 files changed

+22
-26
lines changed

5 files changed

+22
-26
lines changed

ports/quectel/boards/manifest.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

ports/quectel/modules/_boot.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright (c) Quectel Wireless Solution, Co., Ltd.All Rights Reserved.
2-
#
2+
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
55
# You may obtain a copy of the License at
6-
#
6+
#
77
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
8+
#
99
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,54 +15,52 @@
1515
import uos
1616
import ujson
1717

18-
'''
18+
"""
1919
Mark.Zhu - 2022/12/02
2020
Added the littlefs2 mount function,it will be called after a failed attempt to mount littlefs1
21-
'''
21+
"""
2222
# global datacall_flag
2323
datacall_flag = 1
2424

25+
2526
def _repl_enable():
2627
global datacall_flag
2728
if "system_config.json" in uos.listdir("/"):
28-
with open("/system_config.json", "r", encoding='utf-8') as fd:
29+
with open("/system_config.json", "r", encoding="utf-8") as fd:
2930
try:
3031
json_data = ujson.load(fd)
3132
datacall_flag = json_data.get("datacallFlag", 1)
32-
3333
except ValueError:
34-
with open("/usr/system_config.json", "w", encoding='utf-8') as fdw:
34+
with open("/usr/system_config.json", "w", encoding="utf-8") as fdw:
3535
new_json_data = ujson.dumps({"replFlag": 0, "datacallFlag": datacall_flag})
3636
fdw.write(new_json_data)
3737
else:
38-
with open("/system_config.json", "w+", encoding='utf-8') as fd:
38+
with open("/system_config.json", "w+", encoding="utf-8") as fd:
3939
repl_data = ujson.dumps({"replFlag": 0})
4040
fd.write(repl_data)
4141

42-
try:
42+
43+
try:
4344
udev = None
4445
try:
4546
from uos import VfsLfs1 as VfsLfs
4647
except Exception:
4748
from uos import VfsLfs2 as VfsLfs
4849

49-
udev = uos.FlashDevice('customer_fs', 4096)
50+
udev = uos.FlashDevice("customer_fs", 4096)
5051
try:
51-
uos.mount(udev, '/')
52+
uos.mount(udev, "/")
5253
except Exception as e:
53-
if 'ENODEV' in str(e):
54+
if "ENODEV" in str(e):
5455
VfsLfs.mkfs(udev)
55-
uos.mount(udev, '/')
56-
else:
57-
raise ValueError("LFS usr mount fail".format(e))
58-
if 'usr' not in uos.listdir():
59-
uos.mkdir('usr')
60-
if 'bak' not in uos.listdir():
61-
uos.mkdir('bak')
62-
56+
uos.mount(udev, "/")
57+
if "usr" not in uos.listdir():
58+
uos.mkdir("usr")
59+
if "bak" not in uos.listdir():
60+
uos.mkdir("bak")
6361

6462
except Exception:
65-
print('error occurs in boot step.')
63+
print("error occurs in boot step.")
6664

6765
finally:
6866
_repl_enable()

ports/quectel/modules/manifest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
freeze("$(PORT_DIR)/modules")

ports/quectel/modules/modules.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

ports/quectel/quectel.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ QUEC_SRC_MOD += \
8383
modhelios.c
8484

8585
# py modules define
86-
QUEC_PY_MOD = modules/modules.py
86+
QUEC_PY_MOD = modules/manifest.py

0 commit comments

Comments
 (0)