File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 31
31
#include "py/runtime.h"
32
32
#include "py/mphal.h"
33
33
#include "extmod/machine_mem.h"
34
+ #include "extmod/machine_pulse.h"
34
35
#include "extmod/machine_i2c.h"
35
36
#include "lib/fatfs/ff.h"
36
37
#include "lib/fatfs/diskio.h"
@@ -517,6 +518,8 @@ STATIC const mp_map_elem_t machine_module_globals_table[] = {
517
518
{ MP_OBJ_NEW_QSTR(MP_QSTR_disable_irq), (mp_obj_t)&pyb_disable_irq_obj },
518
519
{ MP_OBJ_NEW_QSTR(MP_QSTR_enable_irq), (mp_obj_t)&pyb_enable_irq_obj },
519
520
521
+ { MP_OBJ_NEW_QSTR(MP_QSTR_time_pulse_us), (mp_obj_t)&machine_time_pulse_us_obj },
522
+
520
523
{ MP_ROM_QSTR(MP_QSTR_mem8), (mp_obj_t)&machine_mem8_obj },
521
524
{ MP_ROM_QSTR(MP_QSTR_mem16), (mp_obj_t)&machine_mem16_obj },
522
525
{ MP_ROM_QSTR(MP_QSTR_mem32), (mp_obj_t)&machine_mem32_obj },
Original file line number Diff line number Diff line change 95
95
#define MICROPY_PY_UHEAPQ (1)
96
96
#define MICROPY_PY_UHASHLIB (1)
97
97
#define MICROPY_PY_MACHINE (1)
98
+ #define MICROPY_PY_MACHINE_PULSE (1)
98
99
#define MICROPY_PY_MACHINE_I2C (1)
99
100
#define MICROPY_PY_MACHINE_SPI (1)
100
101
#define MICROPY_PY_MACHINE_SPI_MIN_DELAY (0)
Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ extern const unsigned char mp_hal_status_to_errno_table[4];
34
34
NORETURN void mp_hal_raise(HAL_StatusTypeDef status);
35
35
void mp_hal_set_interrupt_char(int c); // -1 to disable
36
36
37
- #define mp_hal_delay_ms HAL_Delay
38
- #define mp_hal_ticks_ms HAL_GetTick
39
-
40
- // needed for machine.I2C
37
+ // timing functions
41
38
#include "stmhal/systick.h"
39
+ #define mp_hal_delay_ms HAL_Delay
42
40
#define mp_hal_delay_us_fast(us) sys_tick_udelay(us)
41
+ #define mp_hal_ticks_ms HAL_GetTick
42
+ #define mp_hal_ticks_us() sys_tick_get_microseconds()
43
43
44
44
// C-level pin HAL
45
45
#include "stmhal/pin.h"
You can’t perform that action at this time.
0 commit comments