Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
0bb3c7d3
Commit
0bb3c7d3
authored
Oct 06, 2016
by
Damien George
Browse files
stmhal: Enable machine.time_pulse_us() function.
parent
c08f50bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
stmhal/modmachine.c
View file @
0bb3c7d3
...
...
@@ -31,6 +31,7 @@
#include
"py/runtime.h"
#include
"py/mphal.h"
#include
"extmod/machine_mem.h"
#include
"extmod/machine_pulse.h"
#include
"extmod/machine_i2c.h"
#include
"lib/fatfs/ff.h"
#include
"lib/fatfs/diskio.h"
...
...
@@ -517,6 +518,8 @@ STATIC const mp_map_elem_t machine_module_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_disable_irq
),
(
mp_obj_t
)
&
pyb_disable_irq_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_enable_irq
),
(
mp_obj_t
)
&
pyb_enable_irq_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_time_pulse_us
),
(
mp_obj_t
)
&
machine_time_pulse_us_obj
},
{
MP_ROM_QSTR
(
MP_QSTR_mem8
),
(
mp_obj_t
)
&
machine_mem8_obj
},
{
MP_ROM_QSTR
(
MP_QSTR_mem16
),
(
mp_obj_t
)
&
machine_mem16_obj
},
{
MP_ROM_QSTR
(
MP_QSTR_mem32
),
(
mp_obj_t
)
&
machine_mem32_obj
},
...
...
stmhal/mpconfigport.h
View file @
0bb3c7d3
...
...
@@ -95,6 +95,7 @@
#define MICROPY_PY_UHEAPQ (1)
#define MICROPY_PY_UHASHLIB (1)
#define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE_PULSE (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_SPI (1)
#define MICROPY_PY_MACHINE_SPI_MIN_DELAY (0)
...
...
stmhal/mphalport.h
View file @
0bb3c7d3
...
...
@@ -34,12 +34,12 @@ extern const unsigned char mp_hal_status_to_errno_table[4];
NORETURN
void
mp_hal_raise
(
HAL_StatusTypeDef
status
);
void
mp_hal_set_interrupt_char
(
int
c
);
// -1 to disable
#define mp_hal_delay_ms HAL_Delay
#define mp_hal_ticks_ms HAL_GetTick
// needed for machine.I2C
// timing functions
#include
"stmhal/systick.h"
#define mp_hal_delay_ms HAL_Delay
#define mp_hal_delay_us_fast(us) sys_tick_udelay(us)
#define mp_hal_ticks_ms HAL_GetTick
#define mp_hal_ticks_us() sys_tick_get_microseconds()
// C-level pin HAL
#include
"stmhal/pin.h"
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment