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
800d5cd1
Commit
800d5cd1
authored
10 years ago
by
Josef Gajdusek
Committed by
Damien George
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
esp8266: Implement time functions
parent
c7df9c6c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
esp8266/esp_mphal.c
+2
-2
2 additions, 2 deletions
esp8266/esp_mphal.c
esp8266/modpyb.c
+2
-2
2 additions, 2 deletions
esp8266/modpyb.c
with
4 additions
and
4 deletions
esp8266/esp_mphal.c
+
2
−
2
View file @
800d5cd1
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include
"etshal.h"
#include
"etshal.h"
#include
"uart.h"
#include
"uart.h"
#include
"esp_mphal.h"
#include
"esp_mphal.h"
#include
"user_interface.h"
extern
void
ets_wdt_disable
(
void
);
extern
void
ets_wdt_disable
(
void
);
extern
void
wdt_feed
(
void
);
extern
void
wdt_feed
(
void
);
...
@@ -82,8 +83,7 @@ void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len) {
...
@@ -82,8 +83,7 @@ void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len) {
}
}
uint32_t
HAL_GetTick
(
void
)
{
uint32_t
HAL_GetTick
(
void
)
{
// TODO
return
system_get_time
()
/
1000
;
return
0
;
}
}
void
HAL_Delay
(
uint32_t
Delay
)
{
void
HAL_Delay
(
uint32_t
Delay
)
{
...
...
This diff is collapsed.
Click to expand it.
esp8266/modpyb.c
+
2
−
2
View file @
800d5cd1
...
@@ -108,13 +108,13 @@ STATIC mp_obj_t pyb_elapsed_millis(mp_obj_t start) {
...
@@ -108,13 +108,13 @@ STATIC mp_obj_t pyb_elapsed_millis(mp_obj_t start) {
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
pyb_elapsed_millis_obj
,
pyb_elapsed_millis
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
pyb_elapsed_millis_obj
,
pyb_elapsed_millis
);
STATIC
mp_obj_t
pyb_micros
(
void
)
{
STATIC
mp_obj_t
pyb_micros
(
void
)
{
return
MP_OBJ_NEW_SMALL_INT
(
0
);
return
MP_OBJ_NEW_SMALL_INT
(
system_get_time
()
);
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
pyb_micros_obj
,
pyb_micros
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
pyb_micros_obj
,
pyb_micros
);
STATIC
mp_obj_t
pyb_elapsed_micros
(
mp_obj_t
start
)
{
STATIC
mp_obj_t
pyb_elapsed_micros
(
mp_obj_t
start
)
{
uint32_t
startMicros
=
mp_obj_get_int
(
start
);
uint32_t
startMicros
=
mp_obj_get_int
(
start
);
uint32_t
currMicros
=
0
;
uint32_t
currMicros
=
system_get_time
()
;
return
MP_OBJ_NEW_SMALL_INT
((
currMicros
-
startMicros
)
&
0x3fffffff
);
return
MP_OBJ_NEW_SMALL_INT
((
currMicros
-
startMicros
)
&
0x3fffffff
);
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
pyb_elapsed_micros_obj
,
pyb_elapsed_micros
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
pyb_elapsed_micros_obj
,
pyb_elapsed_micros
);
...
...
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