summaryrefslogtreecommitdiffstatshomepage
path: root/py/modsys.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-08-10 17:50:28 +0100
committerDamien George <damien.p.george@gmail.com>2014-08-10 17:50:28 +0100
commit30dd23aa7f2c7f142bab66d189f7f479091cf161 (patch)
treeba241aa796a558d212d31bcced54509164958896 /py/modsys.c
parent0c64c634ca15627b93c0f029835c9725d617fd77 (diff)
downloadmicropython-30dd23aa7f2c7f142bab66d189f7f479091cf161.tar.gz
micropython-30dd23aa7f2c7f142bab66d189f7f479091cf161.zip
doc: Document gc, sys, math, cmath.
Diffstat (limited to 'py/modsys.c')
-rw-r--r--py/modsys.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/py/modsys.c b/py/modsys.c
index c248e5626f..a1a9265dbd 100644
--- a/py/modsys.c
+++ b/py/modsys.c
@@ -40,6 +40,8 @@
#if MICROPY_PY_SYS
+/// \module sys - system specific functions
+
// These should be implemented by ports, specific types don't matter,
// only addresses.
struct _dummy_t;
@@ -47,14 +49,21 @@ extern struct _dummy_t mp_sys_exit_obj;
extern mp_obj_int_t mp_maxsize_obj;
+// TODO document these, they aren't constants or functions...
mp_obj_list_t mp_sys_path_obj;
mp_obj_list_t mp_sys_argv_obj;
+
+/// \constant version - Python language version that this implementation conforms to, as a string
+STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0");
+
+/// \constant version - Python language version that this implementation conforms to, as a tuple of ints
#define I(n) MP_OBJ_NEW_SMALL_INT(n)
// TODO: CPython is now at 5-element array, but save 2 els so far...
STATIC const mp_obj_tuple_t mp_sys_version_info_obj = {{&mp_type_tuple}, 3, {I(3), I(4), I(0)}};
#undef I
-STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0");
+
#ifdef MICROPY_PY_SYS_PLATFORM
+/// \constant platform - the platform that Micro Python is running on
STATIC const MP_DEFINE_STR_OBJ(platform_obj, MICROPY_PY_SYS_PLATFORM);
#endif
@@ -68,6 +77,7 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
#ifdef MICROPY_PY_SYS_PLATFORM
{ MP_OBJ_NEW_QSTR(MP_QSTR_platform), (mp_obj_t)&platform_obj },
#endif
+ /// \constant byteorder - the byte order of the system ("little" or "big")
#if MP_ENDIANNESS_LITTLE
{ MP_OBJ_NEW_QSTR(MP_QSTR_byteorder), MP_OBJ_NEW_QSTR(MP_QSTR_little) },
#else
@@ -86,12 +96,13 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
#endif
#endif
-
#if MICROPY_PY_SYS_EXIT
+ // documented per-port
{ MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj },
#endif
#if MICROPY_PY_SYS_STDFILES
+ // documented per-port
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdin), (mp_obj_t)&mp_sys_stdin_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdout), (mp_obj_t)&mp_sys_stdout_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_stderr), (mp_obj_t)&mp_sys_stderr_obj },