Skip to content

Allocate I2C mutex with IDF #5220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/busio/I2C.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
}
#endif

self->xSemaphore = xSemaphoreCreateMutexStatic(&self->xSemaphoreBuffer);
self->xSemaphore = xSemaphoreCreateMutex();
if (self->xSemaphore == NULL) {
mp_raise_RuntimeError(translate("Unable to create lock"));
}
Expand Down
1 change: 0 additions & 1 deletion ports/esp32s2/common-hal/busio/I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ typedef struct {
const mcu_pin_obj_t *sda_pin;
i2c_port_t i2c_num;
SemaphoreHandle_t xSemaphore;
StaticSemaphore_t xSemaphoreBuffer;
bool has_lock;
} busio_i2c_obj_t;

Expand Down