Skip to content

Commit d0479e7

Browse files
committed
quectel: Rename uos to os.
1 parent 48bcf95 commit d0479e7

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

ports/quectel/modules/_boot.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import uos
15+
import os
1616
import ujson
1717

1818
"""
@@ -25,7 +25,7 @@
2525

2626
def _repl_enable():
2727
global datacall_flag
28-
if "system_config.json" in uos.listdir("/"):
28+
if "system_config.json" in os.listdir("/"):
2929
with open("/system_config.json", "r", encoding="utf-8") as fd:
3030
try:
3131
json_data = ujson.load(fd)
@@ -43,21 +43,21 @@ def _repl_enable():
4343
try:
4444
udev = None
4545
try:
46-
from uos import VfsLfs1 as VfsLfs
46+
from os import VfsLfs1 as VfsLfs
4747
except Exception:
48-
from uos import VfsLfs2 as VfsLfs
48+
from os import VfsLfs2 as VfsLfs
4949

50-
udev = uos.FlashDevice("customer_fs", 4096)
50+
udev = os.FlashDevice("customer_fs", 4096)
5151
try:
52-
uos.mount(udev, "/")
52+
os.mount(udev, "/")
5353
except Exception as e:
5454
if "ENODEV" in str(e):
5555
VfsLfs.mkfs(udev)
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")
56+
os.mount(udev, "/")
57+
if "usr" not in os.listdir():
58+
os.mkdir("usr")
59+
if "bak" not in os.listdir():
60+
os.mkdir("bak")
6161

6262
except Exception:
6363
print("error occurs in boot step.")

ports/quectel/moduos.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "vfs_quecfs.h"
4141
#endif
4242

43-
#if MICROPY_QPY_MODULE_UOS
43+
#if MICROPY_QPY_MODULE_OS
4444

4545
static char sysname[30] = {0};
4646
static char nodename[20] = {0};
@@ -150,7 +150,7 @@ static MP_DEFINE_CONST_FUN_OBJ_0(os_urandom___init___obj, os_urandom___init__);
150150
static mp_obj_t os_dupterm_notify(mp_obj_t obj_in) {
151151
(void)obj_in;
152152
for (;;) {
153-
int c = mp_uos_dupterm_rx_chr();
153+
int c = mp_os_dupterm_rx_chr();
154154
if (c < 0) {
155155
break;
156156
}
@@ -163,14 +163,14 @@ static MP_DEFINE_CONST_FUN_OBJ_1(os_dupterm_notify_obj, os_dupterm_notify);
163163

164164
extern const mp_obj_type_t helios_flash_device_type;
165165
static const mp_rom_map_elem_t os_module_globals_table[] = {
166-
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uos) },
166+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_os) },
167167
#if OS_URANDOM_SEED_ON_IMPORT
168168
{ MP_ROM_QSTR(MP_QSTR___init__), MP_ROM_PTR(&os_urandom___init___obj) },
169169
#endif
170170
{ MP_ROM_QSTR(MP_QSTR_uname), MP_ROM_PTR(&os_uname_obj) },
171171
{ MP_ROM_QSTR(MP_QSTR_uname2), MP_ROM_PTR(&os_uname2_obj) },
172172
#if MICROPY_PY_OS_DUPTERM
173-
{ MP_ROM_QSTR(MP_QSTR_dupterm), MP_ROM_PTR(&mp_uos_dupterm_obj) },
173+
{ MP_ROM_QSTR(MP_QSTR_dupterm), MP_ROM_PTR(&mp_os_dupterm_obj) },
174174
{ MP_ROM_QSTR(MP_QSTR_dupterm_notify), MP_ROM_PTR(&os_dupterm_notify_obj) },
175175
#endif
176176
{ MP_ROM_QSTR(MP_QSTR_FlashDevice), MP_ROM_PTR(&helios_flash_device_type) },
@@ -217,10 +217,10 @@ static const mp_rom_map_elem_t os_module_globals_table[] = {
217217

218218
static MP_DEFINE_CONST_DICT(os_module_globals, os_module_globals_table);
219219

220-
const mp_obj_module_t uos_module = {
220+
const mp_obj_module_t os_module = {
221221
.base = { &mp_type_module },
222222
.globals = (mp_obj_dict_t *)&os_module_globals,
223223
};
224224

225-
MP_REGISTER_MODULE(MP_QSTR_uos, uos_module);
225+
MP_REGISTER_MODULE(MP_QSTR_os, os_module);
226226
#endif

0 commit comments

Comments
 (0)