Skip to content

Commit 624738c

Browse files
committed
extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr.
1 parent 109990f commit 624738c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

esp8266/esp_mphal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void ets_event_poll(void);
6363
#include "etshal.h"
6464
#include "gpio.h"
6565
#include "esp8266/modpyb.h"
66-
#define mp_hal_pin_obj_t pyb_pin_obj_t
66+
#define mp_hal_pin_obj_t pyb_pin_obj_t*
6767
#define mp_hal_get_pin_obj(o) mp_obj_get_pin_obj(o)
6868
#define mp_hal_pin_config_od(p) do { \
6969
ETS_GPIO_INTR_DISABLE(); \

extmod/machine_i2c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
typedef struct _machine_i2c_obj_t {
3838
mp_obj_base_t base;
3939
uint32_t us_delay;
40-
mp_hal_pin_obj_t *scl;
41-
mp_hal_pin_obj_t *sda;
40+
mp_hal_pin_obj_t scl;
41+
mp_hal_pin_obj_t sda;
4242
} machine_i2c_obj_t;
4343

4444
STATIC void mp_hal_i2c_delay(machine_i2c_obj_t *self) {

stmhal/mphalport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
4343

4444
// C-level pin HAL
4545
#include "stmhal/pin.h"
46-
#define mp_hal_pin_obj_t pin_obj_t
46+
#define mp_hal_pin_obj_t pin_obj_t*
4747
#define mp_hal_get_pin_obj(o) (pin_obj_t*)pin_find(o)
4848
#define mp_hal_pin_config_od(p) mp_hal_gpio_config((p)->gpio, (p)->pin, 5, 0, 0)
4949
#define mp_hal_pin_low(p) GPIO_clear_pin((p)->gpio, (p)->pin_mask)

0 commit comments

Comments
 (0)