summaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
Diffstat (limited to 'extmod')
-rw-r--r--extmod/asyncio/__init__.py (renamed from extmod/uasyncio/__init__.py)2
-rw-r--r--extmod/asyncio/core.py (renamed from extmod/uasyncio/core.py)4
-rw-r--r--extmod/asyncio/event.py (renamed from extmod/uasyncio/event.py)2
-rw-r--r--extmod/asyncio/funcs.py (renamed from extmod/uasyncio/funcs.py)2
-rw-r--r--extmod/asyncio/lock.py (renamed from extmod/uasyncio/lock.py)2
-rw-r--r--extmod/asyncio/manifest.py (renamed from extmod/uasyncio/manifest.py)2
-rw-r--r--extmod/asyncio/stream.py (renamed from extmod/uasyncio/stream.py)2
-rw-r--r--extmod/asyncio/task.py (renamed from extmod/uasyncio/task.py)2
-rw-r--r--extmod/extmod.cmake2
-rw-r--r--extmod/extmod.mk2
-rw-r--r--extmod/modasyncio.c (renamed from extmod/moduasyncio.c)32
11 files changed, 27 insertions, 27 deletions
diff --git a/extmod/uasyncio/__init__.py b/extmod/asyncio/__init__.py
index 373de52af..1f83750c5 100644
--- a/extmod/uasyncio/__init__.py
+++ b/extmod/asyncio/__init__.py
@@ -1,4 +1,4 @@
-# MicroPython uasyncio module
+# MicroPython asyncio module
# MIT license; Copyright (c) 2019 Damien P. George
from .core import *
diff --git a/extmod/uasyncio/core.py b/extmod/asyncio/core.py
index f191d202e..be5119ba6 100644
--- a/extmod/uasyncio/core.py
+++ b/extmod/asyncio/core.py
@@ -1,4 +1,4 @@
-# MicroPython uasyncio module
+# MicroPython asyncio module
# MIT license; Copyright (c) 2019 Damien P. George
from time import ticks_ms as ticks, ticks_diff, ticks_add
@@ -6,7 +6,7 @@ import sys, select
# Import TaskQueue and Task, preferring built-in C code over Python code
try:
- from _uasyncio import TaskQueue, Task
+ from _asyncio import TaskQueue, Task
except:
from .task import TaskQueue, Task
diff --git a/extmod/uasyncio/event.py b/extmod/asyncio/event.py
index 8a9053459..e0b41f732 100644
--- a/extmod/uasyncio/event.py
+++ b/extmod/asyncio/event.py
@@ -1,4 +1,4 @@
-# MicroPython uasyncio module
+# MicroPython asyncio module
# MIT license; Copyright (c) 2019-2020 Damien P. George
from . import core
diff --git a/extmod/uasyncio/funcs.py b/extmod/asyncio/funcs.py
index dc52ad395..599091dfb 100644
--- a/extmod/uasyncio/funcs.py
+++ b/extmod/asyncio/funcs.py
@@ -1,4 +1,4 @@
-# MicroPython uasyncio module
+# MicroPython asyncio module
# MIT license; Copyright (c) 2019-2022 Damien P. George
from . import core
diff --git a/extmod/uasyncio/lock.py b/extmod/asyncio/lock.py
index 85a9437b4..0a46ac326 100644
--- a/extmod/uasyncio/lock.py
+++ b/extmod/asyncio/lock.py
@@ -1,4 +1,4 @@
-# MicroPython uasyncio module
+# MicroPython asyncio module
# MIT license; Copyright (c) 2019-2020 Damien P. George
from . import core
diff --git a/extmod/uasyncio/manifest.py b/extmod/asyncio/manifest.py
index d425a467b..0aba5b185 100644
--- a/extmod/uasyncio/manifest.py
+++ b/extmod/asyncio/manifest.py
@@ -1,7 +1,7 @@
# This list of package files doesn't include task.py because that's provided
# by the C module.
package(
- "uasyncio",
+ "asyncio",
(
"__init__.py",
"core.py",
diff --git a/extmod/uasyncio/stream.py b/extmod/asyncio/stream.py
index ac297cce0..c47c48cf0 100644
--- a/extmod/uasyncio/stream.py
+++ b/extmod/asyncio/stream.py
@@ -1,4 +1,4 @@
-# MicroPython uasyncio module
+# MicroPython asyncio module
# MIT license; Copyright (c) 2019-2020 Damien P. George
from . import core
diff --git a/extmod/uasyncio/task.py b/extmod/asyncio/task.py
index 4ead2a130..30be2170e 100644
--- a/extmod/uasyncio/task.py
+++ b/extmod/asyncio/task.py
@@ -1,4 +1,4 @@
-# MicroPython uasyncio module
+# MicroPython asyncio module
# MIT license; Copyright (c) 2019-2020 Damien P. George
# This file contains the core TaskQueue based on a pairing heap, and the core Task class.
diff --git a/extmod/extmod.cmake b/extmod/extmod.cmake
index 59f07b8ae..67f33cf91 100644
--- a/extmod/extmod.cmake
+++ b/extmod/extmod.cmake
@@ -19,7 +19,7 @@ set(MICROPY_SOURCE_EXTMOD
${MICROPY_EXTMOD_DIR}/modlwip.c
${MICROPY_EXTMOD_DIR}/modnetwork.c
${MICROPY_EXTMOD_DIR}/modonewire.c
- ${MICROPY_EXTMOD_DIR}/moduasyncio.c
+ ${MICROPY_EXTMOD_DIR}/modasyncio.c
${MICROPY_EXTMOD_DIR}/modbinascii.c
${MICROPY_EXTMOD_DIR}/modcryptolib.c
${MICROPY_EXTMOD_DIR}/moductypes.c
diff --git a/extmod/extmod.mk b/extmod/extmod.mk
index c544e8179..41d200fce 100644
--- a/extmod/extmod.mk
+++ b/extmod/extmod.mk
@@ -11,6 +11,7 @@ SRC_EXTMOD_C += \
extmod/machine_signal.c \
extmod/machine_spi.c \
extmod/machine_timer.c \
+ extmod/modasyncio.c \
extmod/modbinascii.c \
extmod/modbluetooth.c \
extmod/modbtree.c \
@@ -31,7 +32,6 @@ SRC_EXTMOD_C += \
extmod/modssl_axtls.c \
extmod/modssl_mbedtls.c \
extmod/modtime.c \
- extmod/moduasyncio.c \
extmod/moductypes.c \
extmod/modwebrepl.c \
extmod/modwebsocket.c \
diff --git a/extmod/moduasyncio.c b/extmod/modasyncio.c
index c05a8dfc6..a6a54eba8 100644
--- a/extmod/moduasyncio.c
+++ b/extmod/modasyncio.c
@@ -29,7 +29,7 @@
#include "py/pairheap.h"
#include "py/mphal.h"
-#if MICROPY_PY_UASYNCIO
+#if MICROPY_PY_ASYNCIO
// Used when task cannot be guaranteed to be non-NULL.
#define TASK_PAIRHEAP(task) ((task) ? &(task)->pairheap : NULL)
@@ -155,8 +155,8 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
/******************************************************************************/
// Task class
-// This is the core uasyncio context with cur_task, _task_queue and CancelledError.
-STATIC mp_obj_t uasyncio_context = MP_OBJ_NULL;
+// This is the core asyncio context with cur_task, _task_queue and CancelledError.
+STATIC mp_obj_t asyncio_context = MP_OBJ_NULL;
STATIC mp_obj_t task_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 1, 2, false);
@@ -168,7 +168,7 @@ STATIC mp_obj_t task_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
self->state = TASK_STATE_RUNNING_NOT_WAITED_ON;
self->ph_key = MP_OBJ_NEW_SMALL_INT(0);
if (n_args == 2) {
- uasyncio_context = args[1];
+ asyncio_context = args[1];
}
return MP_OBJ_FROM_PTR(self);
}
@@ -186,7 +186,7 @@ STATIC mp_obj_t task_cancel(mp_obj_t self_in) {
return mp_const_false;
}
// Can't cancel self (not supported yet).
- mp_obj_t cur_task = mp_obj_dict_get(uasyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_cur_task));
+ mp_obj_t cur_task = mp_obj_dict_get(asyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_cur_task));
if (self_in == cur_task) {
mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("can't cancel self"));
}
@@ -195,7 +195,7 @@ STATIC mp_obj_t task_cancel(mp_obj_t self_in) {
self = MP_OBJ_TO_PTR(self->data);
}
- mp_obj_t _task_queue = mp_obj_dict_get(uasyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR__task_queue));
+ mp_obj_t _task_queue = mp_obj_dict_get(asyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR__task_queue));
// Reschedule Task as a cancelled task.
mp_obj_t dest[3];
@@ -218,7 +218,7 @@ STATIC mp_obj_t task_cancel(mp_obj_t self_in) {
task_queue_push(2, dest);
}
- self->data = mp_obj_dict_get(uasyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_CancelledError));
+ self->data = mp_obj_dict_get(asyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_CancelledError));
return mp_const_true;
}
@@ -278,7 +278,7 @@ STATIC mp_obj_t task_iternext(mp_obj_t self_in) {
nlr_raise(self->data);
} else {
// Put calling task on waiting queue.
- mp_obj_t cur_task = mp_obj_dict_get(uasyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_cur_task));
+ mp_obj_t cur_task = mp_obj_dict_get(asyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_cur_task));
mp_obj_t args[2] = { self->state, cur_task };
task_queue_push(2, args);
// Set calling task's data to this task that it waits on, to double-link it.
@@ -302,20 +302,20 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
);
/******************************************************************************/
-// C-level uasyncio module
+// C-level asyncio module
-STATIC const mp_rom_map_elem_t mp_module_uasyncio_globals_table[] = {
- { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__uasyncio) },
+STATIC const mp_rom_map_elem_t mp_module_asyncio_globals_table[] = {
+ { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__asyncio) },
{ MP_ROM_QSTR(MP_QSTR_TaskQueue), MP_ROM_PTR(&task_queue_type) },
{ MP_ROM_QSTR(MP_QSTR_Task), MP_ROM_PTR(&task_type) },
};
-STATIC MP_DEFINE_CONST_DICT(mp_module_uasyncio_globals, mp_module_uasyncio_globals_table);
+STATIC MP_DEFINE_CONST_DICT(mp_module_asyncio_globals, mp_module_asyncio_globals_table);
-const mp_obj_module_t mp_module_uasyncio = {
+const mp_obj_module_t mp_module_asyncio = {
.base = { &mp_type_module },
- .globals = (mp_obj_dict_t *)&mp_module_uasyncio_globals,
+ .globals = (mp_obj_dict_t *)&mp_module_asyncio_globals,
};
-MP_REGISTER_MODULE(MP_QSTR__uasyncio, mp_module_uasyncio);
+MP_REGISTER_MODULE(MP_QSTR__asyncio, mp_module_asyncio);
-#endif // MICROPY_PY_UASYNCIO
+#endif // MICROPY_PY_ASYNCIO