Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
ebd9f550
Commit
ebd9f550
authored
Oct 29, 2015
by
Paul Sokolovsky
Browse files
esp8266: Switch to standard mp_hal_delay_ms() MPHAL function.
parent
5699fc9d
Changes
4
Hide whitespace changes
Inline
Side-by-side
esp8266/esp_mphal.c
View file @
ebd9f550
...
...
@@ -86,8 +86,8 @@ uint32_t HAL_GetTick(void) {
return
system_get_time
()
/
1000
;
}
void
HAL_D
elay
(
uint32_t
D
elay
)
{
mp_hal_delay_us
(
D
elay
*
1000
);
void
mp_hal_d
elay
_ms
(
uint32_t
d
elay
)
{
mp_hal_delay_us
(
d
elay
*
1000
);
}
void
mp_hal_set_interrupt_char
(
int
c
)
{
...
...
esp8266/esp_mphal.h
View file @
ebd9f550
...
...
@@ -38,7 +38,7 @@ void mp_hal_stdout_tx_strn(const char *str, uint32_t len);
void
mp_hal_stdout_tx_strn_cooked
(
const
char
*
str
,
uint32_t
len
);
uint32_t
HAL_GetTick
(
void
);
void
HAL_D
elay
(
uint32_t
D
elay
);
void
mp_hal_d
elay
_ms
(
uint32_t
d
elay
);
void
mp_hal_delay_us
(
uint32_t
);
void
mp_hal_set_interrupt_char
(
int
c
);
uint32_t
mp_hal_get_cpu_freq
(
void
);
...
...
esp8266/modpyb.c
View file @
ebd9f550
...
...
@@ -128,7 +128,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_elapsed_micros_obj, pyb_elapsed_micros);
STATIC
mp_obj_t
pyb_delay
(
mp_obj_t
ms_in
)
{
mp_int_t
ms
=
mp_obj_get_int
(
ms_in
);
if
(
ms
>=
0
)
{
HAL_D
elay
(
ms
);
mp_hal_d
elay
_ms
(
ms
);
}
return
mp_const_none
;
}
...
...
esp8266/modutime.c
View file @
ebd9f550
...
...
@@ -101,7 +101,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime);
/// \function sleep(seconds)
/// Sleep for the given number of seconds.
STATIC
mp_obj_t
time_sleep
(
mp_obj_t
seconds_o
)
{
HAL_D
elay
(
1000
*
mp_obj_get_int
(
seconds_o
));
mp_hal_d
elay
_ms
(
1000
*
mp_obj_get_int
(
seconds_o
));
return
mp_const_none
;
}
MP_DEFINE_CONST_FUN_OBJ_1
(
time_sleep_obj
,
time_sleep
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment