Skip to content
This repository was archived by the owner on Apr 25, 2021. It is now read-only.

Commit 4332c30

Browse files
committed
components to component
1 parent 4153f65 commit 4332c30

File tree

6 files changed

+42
-42
lines changed

6 files changed

+42
-42
lines changed

src/eeprom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
def main():
55
globals().pop('main')
6-
from ucomponents import invoke, components
6+
from ucomponent import invoke, components
77
from ucomputer import crash, get_computer_address
88

99
def component(t):

src/moducomponents.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,54 @@
55
mp_obj_t wrap_result(int code);
66

77

8-
STATIC mp_obj_t ucomponents_components(size_t n_args, const mp_obj_t *args) {
8+
STATIC mp_obj_t ucomponent_components(size_t n_args, const mp_obj_t *args) {
99
if (n_args == 0) {
10-
return wrap_result(__syscall2(SYS_COMPONENTS_LIST, 0, 0));
10+
return wrap_result(__syscall2(SYS_COMPONENT_LIST, 0, 0));
1111
} else {
1212
size_t len = 0;
1313
const char *buf = mp_obj_str_get_data(args[0], &len);
14-
return wrap_result(__syscall2(SYS_COMPONENTS_LIST, (int) buf, (int) len));
14+
return wrap_result(__syscall2(SYS_COMPONENT_LIST, (int) buf, (int) len));
1515
}
1616
}
1717

18-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucomponents_components_obj, 0, 1, ucomponents_components);
18+
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucomponent_components_obj, 0, 1, ucomponent_components);
1919

2020

21-
STATIC mp_obj_t ucomponents_component_count() {
22-
return wrap_result(__syscall0(SYS_COMPONENTS_COUNT));
21+
STATIC mp_obj_t ucomponent_component_count() {
22+
return wrap_result(__syscall0(SYS_COMPONENT_COUNT));
2323
}
2424

25-
MP_DEFINE_CONST_FUN_OBJ_0(ucomponents_component_count_obj, ucomponents_component_count);
25+
MP_DEFINE_CONST_FUN_OBJ_0(ucomponent_component_count_obj, ucomponent_component_count);
2626

2727

28-
STATIC mp_obj_t ucomponents_max_components() {
29-
return wrap_result(__syscall0(SYS_COMPONENTS_MAX));
28+
STATIC mp_obj_t ucomponent_max_components() {
29+
return wrap_result(__syscall0(SYS_COMPONENT_MAX));
3030
}
3131

32-
MP_DEFINE_CONST_FUN_OBJ_0(ucomponents_max_components_obj, ucomponents_max_components);
32+
MP_DEFINE_CONST_FUN_OBJ_0(ucomponent_max_components_obj, ucomponent_max_components);
3333

3434

35-
STATIC mp_obj_t ucomponents_methods(mp_obj_t address_obj) {
35+
STATIC mp_obj_t ucomponent_methods(mp_obj_t address_obj) {
3636
mp_obj_t items[] = {address_obj};
3737
msgpack_result_t result = msgpack_args_dumps(1, items);
38-
return wrap_result(__syscall2(SYS_COMPONENTS_METHODS, (int)result.data, (int)result.size));
38+
return wrap_result(__syscall2(SYS_COMPONENT_METHODS, (int)result.data, (int)result.size));
3939
}
4040

41-
MP_DEFINE_CONST_FUN_OBJ_1(ucomponents_methods_obj, ucomponents_methods);
41+
MP_DEFINE_CONST_FUN_OBJ_1(ucomponent_methods_obj, ucomponent_methods);
4242

4343

44-
STATIC mp_obj_t ucomponents_doc(mp_obj_t address_obj, mp_obj_t method_obj) {
44+
STATIC mp_obj_t ucomponent_doc(mp_obj_t address_obj, mp_obj_t method_obj) {
4545
mp_obj_t items[] = {address_obj, method_obj};
4646
msgpack_result_t result = msgpack_args_dumps(2, items);
47-
return wrap_result(__syscall2(SYS_COMPONENTS_DOC, (int)result.data, (int)result.size));
47+
return wrap_result(__syscall2(SYS_COMPONENT_DOC, (int)result.data, (int)result.size));
4848
}
4949

50-
MP_DEFINE_CONST_FUN_OBJ_2(ucomponents_doc_obj, ucomponents_doc);
50+
MP_DEFINE_CONST_FUN_OBJ_2(ucomponent_doc_obj, ucomponent_doc);
5151

5252

53-
STATIC mp_obj_t ucomponents_invoke(size_t n_args, const mp_obj_t *args) {
53+
STATIC mp_obj_t ucomponent_invoke(size_t n_args, const mp_obj_t *args) {
5454
msgpack_result_t result = msgpack_args_dumps(n_args, args);
55-
mp_obj_t values = wrap_result(__syscall2(SYS_COMPONENTS_INVOKE, (int)result.data, (int)result.size));
55+
mp_obj_t values = wrap_result(__syscall2(SYS_COMPONENT_INVOKE, (int)result.data, (int)result.size));
5656
if (values == mp_const_none)
5757
return mp_const_none;
5858

@@ -67,26 +67,26 @@ STATIC mp_obj_t ucomponents_invoke(size_t n_args, const mp_obj_t *args) {
6767
return values;
6868
}
6969

70-
MP_DEFINE_CONST_FUN_OBJ_VAR(ucomponents_invoke_obj, 2, ucomponents_invoke);
70+
MP_DEFINE_CONST_FUN_OBJ_VAR(ucomponent_invoke_obj, 2, ucomponent_invoke);
7171

7272

73-
STATIC const mp_rom_map_elem_t ucomponents_module_globals_table[] = {
74-
{MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ucomponents)},
73+
STATIC const mp_rom_map_elem_t ucomponent_module_globals_table[] = {
74+
{MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ucomponent)},
7575

7676
// components
77-
{MP_ROM_QSTR(MP_QSTR_components), MP_ROM_PTR(&ucomponents_components_obj)},
78-
{MP_ROM_QSTR(MP_QSTR_component_count), MP_ROM_PTR(&ucomponents_component_count_obj)},
79-
{MP_ROM_QSTR(MP_QSTR_max_components), MP_ROM_PTR(&ucomponents_max_components_obj)},
80-
{MP_ROM_QSTR(MP_QSTR_methods), MP_ROM_PTR(&ucomponents_methods_obj)},
81-
{MP_ROM_QSTR(MP_QSTR_doc), MP_ROM_PTR(&ucomponents_doc_obj)},
77+
{MP_ROM_QSTR(MP_QSTR_components), MP_ROM_PTR(&ucomponent_components_obj)},
78+
{MP_ROM_QSTR(MP_QSTR_component_count), MP_ROM_PTR(&ucomponent_component_count_obj)},
79+
{MP_ROM_QSTR(MP_QSTR_max_components), MP_ROM_PTR(&ucomponent_max_components_obj)},
80+
{MP_ROM_QSTR(MP_QSTR_methods), MP_ROM_PTR(&ucomponent_methods_obj)},
81+
{MP_ROM_QSTR(MP_QSTR_doc), MP_ROM_PTR(&ucomponent_doc_obj)},
8282

8383
// invoke
84-
{MP_ROM_QSTR(MP_QSTR_invoke), MP_ROM_PTR(&ucomponents_invoke_obj)},
84+
{MP_ROM_QSTR(MP_QSTR_invoke), MP_ROM_PTR(&ucomponent_invoke_obj)},
8585
};
8686

87-
STATIC MP_DEFINE_CONST_DICT(ucomponents_module_globals, ucomponents_module_globals_table);
87+
STATIC MP_DEFINE_CONST_DICT(ucomponent_module_globals, ucomponent_module_globals_table);
8888

89-
const mp_obj_module_t mp_module_ucomponents = {
89+
const mp_obj_module_t mp_module_ucomponent = {
9090
.base = {&mp_type_module},
91-
.globals = (mp_obj_dict_t *) &ucomponents_module_globals,
91+
.globals = (mp_obj_dict_t *) &ucomponent_module_globals,
9292
};

src/modules/bios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ def bios():
22
globals().pop('bios')
33

44
from ucomputer import crash
5-
from ucomponents import invoke, components
5+
from ucomponent import invoke, components
66

77
eeproms = components("eeprom")
88
if not eeproms:

src/mpconfigport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ extern const struct _mp_obj_type_t mp_type_SystemError;
248248
// Modules
249249
extern const struct _mp_obj_module_t mp_module_machine;
250250
extern const struct _mp_obj_module_t mp_module_ucode;
251-
extern const struct _mp_obj_module_t mp_module_ucomponents;
251+
extern const struct _mp_obj_module_t mp_module_ucomponent;
252252
extern const struct _mp_obj_module_t mp_module_ucomputer;
253253
extern const struct _mp_obj_module_t mp_module_uos;
254254
extern const struct _mp_obj_module_t mp_module_uimp;
@@ -259,7 +259,7 @@ extern const struct _mp_obj_module_t mp_module_uvalue;
259259
#define MICROPY_PORT_BUILTIN_MODULES \
260260
{ MP_ROM_QSTR(MP_QSTR_machine), MP_ROM_PTR(&mp_module_machine) }, \
261261
{ MP_ROM_QSTR(MP_QSTR_ucode), MP_ROM_PTR(&mp_module_ucode) }, \
262-
{ MP_ROM_QSTR(MP_QSTR_ucomponents), MP_ROM_PTR(&mp_module_ucomponents) }, \
262+
{ MP_ROM_QSTR(MP_QSTR_ucomponent), MP_ROM_PTR(&mp_module_ucomponent) }, \
263263
{ MP_ROM_QSTR(MP_QSTR_ucomputer), MP_ROM_PTR(&mp_module_ucomputer) }, \
264264
{ MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos) }, \
265265
{ MP_ROM_QSTR(MP_QSTR_uimp), MP_ROM_PTR(&mp_module_uimp) }, \

src/syscall_table.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#define SYS_SIGNAL_PENDING (SYS_SIGNAL | 2)
1616
#define SYS_SIGNAL_PUSH (SYS_SIGNAL | 3)
1717

18-
#define SYS_COMPONENTS (0x040000)
19-
#define SYS_COMPONENTS_INVOKE (SYS_COMPONENTS | 0)
20-
#define SYS_COMPONENTS_LIST (SYS_COMPONENTS | 16)
21-
#define SYS_COMPONENTS_COUNT (SYS_COMPONENTS | 17)
22-
#define SYS_COMPONENTS_MAX (SYS_COMPONENTS | 18)
23-
#define SYS_COMPONENTS_METHODS (SYS_COMPONENTS | 19)
24-
#define SYS_COMPONENTS_DOC (SYS_COMPONENTS | 20)
18+
#define SYS_COMPONENT (0x040000)
19+
#define SYS_COMPONENT_INVOKE (SYS_COMPONENT | 0)
20+
#define SYS_COMPONENT_LIST (SYS_COMPONENT | 16)
21+
#define SYS_COMPONENT_COUNT (SYS_COMPONENT | 17)
22+
#define SYS_COMPONENT_MAX (SYS_COMPONENT | 18)
23+
#define SYS_COMPONENT_METHODS (SYS_COMPONENT | 19)
24+
#define SYS_COMPONENT_DOC (SYS_COMPONENT | 20)
2525

2626
#define SYS_VALUE (0x050000)
2727
#define SYS_VALUE_INVOKE (SYS_VALUE | 1)

src/umodules/ucomponents.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ucomponents
1+
# ucomponent
22
"functions related to the components"
33
from typing import Dict, List, Any, Union, overload, Tuple
44

0 commit comments

Comments
 (0)