Skip to content

Commit ed88473

Browse files
committed
Some build error fixes
1 parent 3934532 commit ed88473

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

micropy_updates/common/mp_i2c_common.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#include "py/obj.h"
44
#include "py/runtime.h"
55

6+
#include "freertos/FreeRTOS.h"
7+
#include "freertos/task.h"
8+
#include "freertos/semphr.h"
9+
610
#ifndef __MP_I2C_COMMON_H__
711
#define __MP_I2C_COMMON_H__
812

@@ -11,7 +15,11 @@
1115
typedef struct _mp_machine_hw_i2c_bus_obj_t mp_machine_hw_i2c_bus_obj_t;
1216
typedef struct _mp_machine_hw_i2c_device_obj_t mp_machine_hw_i2c_device_obj_t;
1317

14-
typedef struct _i2c_bus_lock_t i2c_bus_lock_t;
18+
typedef struct _i2c_bus_lock_t {
19+
SemaphoreHandle_t handle;
20+
StaticSemaphore_t buffer;
21+
} i2c_bus_lock_t;
22+
1523

1624
struct _mp_machine_hw_i2c_bus_obj_t {
1725
mp_obj_base_t base;

micropy_updates/esp32/machine_i2c.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@
7272
static mp_machine_hw_i2c_bus_obj_t machine_hw_i2c_obj[I2C_NUM_MAX];
7373

7474

75-
struct _i2c_bus_lock_t {
76-
SemaphoreHandle_t handle;
77-
StaticSemaphore_t buffer;
78-
};
79-
80-
8175
#define I2C_BUS_LOCK_ACQUIRE(self) xSemaphoreTake(self->lock.handle, portMAX_DELAY)
8276
#define I2C_BUS_LOCK_DELETE(self) vSemaphoreDelete(self->lock.handle)
8377
#define I2C_BUS_LOCK_RELEASE(self) xSemaphoreGive(self->lock.handle)

0 commit comments

Comments
 (0)