Skip to content

Commit 8bbbb28

Browse files
committed
Fixes from testing SPI
1 parent 7dd5380 commit 8bbbb28

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

shared-bindings/busdevice/SPIDevice.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ STATIC mp_obj_t busdevice_spidevice_make_new(const mp_obj_type_t *type, size_t n
103103
STATIC mp_obj_t busdevice_spidevice_obj___enter__(mp_obj_t self_in) {
104104
busdevice_spidevice_obj_t *self = MP_OBJ_TO_PTR(self_in);
105105
common_hal_busdevice_spidevice_enter(self);
106-
return self;
106+
return self->spi;
107107
}
108108
STATIC MP_DEFINE_CONST_FUN_OBJ_1(busdevice_spidevice___enter___obj, busdevice_spidevice_obj___enter__);
109109

shared-bindings/busdevice/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#include "shared-bindings/busdevice/__init__.h"
3535
#include "shared-bindings/busdevice/I2CDevice.h"
36+
#include "shared-bindings/busdevice/SPIDevice.h"
3637

3738

3839
//| """Hardware accelerated external bus access
@@ -46,6 +47,7 @@
4647
STATIC const mp_rom_map_elem_t busdevice_module_globals_table[] = {
4748
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_busdevice) },
4849
{ MP_ROM_QSTR(MP_QSTR_I2CDevice), MP_ROM_PTR(&busdevice_i2cdevice_type) },
50+
{ MP_ROM_QSTR(MP_QSTR_SPIDevice), MP_ROM_PTR(&busdevice_spidevice_type) },
4951
};
5052

5153
STATIC MP_DEFINE_CONST_DICT(busdevice_module_globals, busdevice_module_globals_table);

shared-module/busdevice/I2CDevice.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ void common_hal_busdevice_i2cdevice_lock(busdevice_i2cdevice_obj_t *self) {
3939
bool success = false;
4040
while (!success) {
4141
success = common_hal_busio_i2c_try_lock(self->i2c);
42-
RUN_BACKGROUND_TASKS;
43-
mp_handle_pending();
42+
//RUN_BACKGROUND_TASKS;
43+
//mp_handle_pending();
4444
}
4545
}
4646

0 commit comments

Comments
 (0)