Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
e381efed
Commit
e381efed
authored
Oct 29, 2016
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
unix/modtime: Use ticks_diff() implementation from extmod/utime_mphal.c.
parent
aee64835
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
unix/modtime.c
+2
-8
2 additions, 8 deletions
unix/modtime.c
unix/mpconfigport.h
+1
-0
1 addition, 0 deletions
unix/mpconfigport.h
with
3 additions
and
8 deletions
unix/modtime.c
+
2
−
8
View file @
e381efed
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include
"py/runtime.h"
#include
"py/runtime.h"
#include
"py/smallint.h"
#include
"py/smallint.h"
#include
"py/mphal.h"
#include
"py/mphal.h"
#include
"extmod/utime_mphal.h"
#ifdef _WIN32
#ifdef _WIN32
static
inline
int
msec_sleep_tv
(
struct
timeval
*
tv
)
{
static
inline
int
msec_sleep_tv
(
struct
timeval
*
tv
)
{
...
@@ -92,13 +93,6 @@ STATIC mp_obj_t mod_time_ticks_ms(void) {
...
@@ -92,13 +93,6 @@ STATIC mp_obj_t mod_time_ticks_ms(void) {
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mod_time_ticks_ms_obj
,
mod_time_ticks_ms
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mod_time_ticks_ms_obj
,
mod_time_ticks_ms
);
STATIC
mp_obj_t
mod_time_ticks_diff
(
mp_obj_t
oldval
,
mp_obj_t
newval
)
{
mp_uint_t
old
=
MP_OBJ_SMALL_INT_VALUE
(
oldval
);
mp_uint_t
new
=
MP_OBJ_SMALL_INT_VALUE
(
newval
);
return
MP_OBJ_NEW_SMALL_INT
((
new
-
old
)
&
MP_SMALL_INT_POSITIVE_MASK
);
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_2
(
mod_time_ticks_diff_obj
,
mod_time_ticks_diff
);
// Note: this is deprecated since CPy3.3, but pystone still uses it.
// Note: this is deprecated since CPy3.3, but pystone still uses it.
STATIC
mp_obj_t
mod_time_clock
(
void
)
{
STATIC
mp_obj_t
mod_time_clock
(
void
)
{
#if MICROPY_PY_BUILTINS_FLOAT
#if MICROPY_PY_BUILTINS_FLOAT
...
@@ -190,7 +184,7 @@ STATIC const mp_rom_map_elem_t mp_module_time_globals_table[] = {
...
@@ -190,7 +184,7 @@ STATIC const mp_rom_map_elem_t mp_module_time_globals_table[] = {
{
MP_ROM_QSTR
(
MP_QSTR_time
),
MP_ROM_PTR
(
&
mod_time_time_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_time
),
MP_ROM_PTR
(
&
mod_time_time_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_ticks_ms
),
MP_ROM_PTR
(
&
mod_time_ticks_ms_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_ticks_ms
),
MP_ROM_PTR
(
&
mod_time_ticks_ms_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_ticks_us
),
MP_ROM_PTR
(
&
mod_time_ticks_us_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_ticks_us
),
MP_ROM_PTR
(
&
mod_time_ticks_us_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_ticks_diff
),
MP_ROM_PTR
(
&
m
od_
time_ticks_diff_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_ticks_diff
),
MP_ROM_PTR
(
&
m
p_u
time_ticks_diff_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_strftime
),
MP_ROM_PTR
(
&
mod_time_strftime_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_strftime
),
MP_ROM_PTR
(
&
mod_time_strftime_obj
)
},
};
};
...
...
This diff is collapsed.
Click to expand it.
unix/mpconfigport.h
+
1
−
0
View file @
e381efed
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
#define MICROPY_PY_OS_STATVFS (1)
#define MICROPY_PY_OS_STATVFS (1)
#define MICROPY_PY_UTIME (1)
#define MICROPY_PY_UTIME (1)
#define MICROPY_PY_UTIME_MP_HAL (1)
#define MICROPY_PY_UERRNO (1)
#define MICROPY_PY_UERRNO (1)
#define MICROPY_PY_UCTYPES (1)
#define MICROPY_PY_UCTYPES (1)
#define MICROPY_PY_UZLIB (1)
#define MICROPY_PY_UZLIB (1)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment