File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 3
3
#include "py/obj.h"
4
4
#include "py/runtime.h"
5
5
6
+ #include "freertos/FreeRTOS.h"
7
+ #include "freertos/task.h"
8
+ #include "freertos/semphr.h"
9
+
6
10
#ifndef __MP_I2C_COMMON_H__
7
11
#define __MP_I2C_COMMON_H__
8
12
11
15
typedef struct _mp_machine_hw_i2c_bus_obj_t mp_machine_hw_i2c_bus_obj_t ;
12
16
typedef struct _mp_machine_hw_i2c_device_obj_t mp_machine_hw_i2c_device_obj_t ;
13
17
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
+
15
23
16
24
struct _mp_machine_hw_i2c_bus_obj_t {
17
25
mp_obj_base_t base ;
Original file line number Diff line number Diff line change 72
72
static mp_machine_hw_i2c_bus_obj_t machine_hw_i2c_obj [I2C_NUM_MAX ];
73
73
74
74
75
- struct _i2c_bus_lock_t {
76
- SemaphoreHandle_t handle ;
77
- StaticSemaphore_t buffer ;
78
- };
79
-
80
-
81
75
#define I2C_BUS_LOCK_ACQUIRE (self ) xSemaphoreTake(self->lock.handle, portMAX_DELAY)
82
76
#define I2C_BUS_LOCK_DELETE (self ) vSemaphoreDelete(self->lock.handle)
83
77
#define I2C_BUS_LOCK_RELEASE (self ) xSemaphoreGive(self->lock.handle)
You can’t perform that action at this time.
0 commit comments