Verified Commit 66cd10d4 authored by Rahix's avatar Rahix
Browse files

docs: Document os.reset()



Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 5fe5fe31
......@@ -43,3 +43,12 @@ Epicardium-Specific
:param str name: Path to new app/script/l0dable.
:return: This function never returns. It can, however raise an exception.
.. py:function:: os.reset()
Reboot card10.
.. warning::
Please only call this function if absolutely necessary. In most cases
you'll want to just :py:func:`os.exit` instead.
......@@ -19,15 +19,6 @@ static mp_obj_t mp_os_exit(size_t n_args, const mp_obj_t *args)
}
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(exit_obj, 0, 1, mp_os_exit);
static mp_obj_t mp_os_reset(void)
{
epic_system_reset();
/* unreachable */
return mp_const_none;
}
static MP_DEFINE_CONST_FUN_OBJ_0(reset_obj, mp_os_reset);
static mp_obj_t mp_os_exec(mp_obj_t name_in)
{
const char *name_ptr;
......@@ -57,6 +48,15 @@ static mp_obj_t mp_os_exec(mp_obj_t name_in)
}
static MP_DEFINE_CONST_FUN_OBJ_1(exec_obj, mp_os_exec);
static mp_obj_t mp_os_reset(void)
{
epic_system_reset();
/* unreachable */
return mp_const_none;
}
static MP_DEFINE_CONST_FUN_OBJ_0(reset_obj, mp_os_reset);
static mp_obj_t mp_os_listdir(mp_obj_t py_path)
{
const char *path = mp_obj_str_get_str(py_path);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment