File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
ports/analog/common-hal/busio Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
46
46
const mcu_pin_obj_t * scl ,
47
47
const mcu_pin_obj_t * sda ,
48
48
uint32_t frequency , uint32_t timeout ) {
49
-
50
- int temp = 0 ;
51
-
52
49
// Check for NULL Pointers && valid I2C settings
53
50
assert (self );
54
51
@@ -58,12 +55,12 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
58
55
*/
59
56
60
57
// Assign I2C ID based on pins
61
- temp = pinsToI2c (sda , scl );
62
- if (temp == -1 ) {
58
+ int i2c_id = pinsToI2c (sda , scl );
59
+ if (i2c_id == -1 ) {
63
60
return ;
64
61
} else {
65
- self -> i2c_id = temp ;
66
- self -> i2c_regs = MXC_I2C_GET_I2C (temp );
62
+ self -> i2c_id = i2c_id ;
63
+ self -> i2c_regs = MXC_I2C_GET_I2C (i2c_id );
67
64
}
68
65
69
66
// Check for valid I2C controller
Original file line number Diff line number Diff line change @@ -56,18 +56,18 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
56
56
const mcu_pin_obj_t * mosi ,
57
57
const mcu_pin_obj_t * miso ,
58
58
bool half_duplex ) {
59
- int temp , err = 0 ;
59
+ int err = 0 ;
60
60
61
61
// Check for NULL Pointer
62
62
assert (self );
63
63
64
64
// Assign SPI ID based on pins
65
- temp = pinsToSpi (mosi , miso , sck );
66
- if (temp == -1 ) {
65
+ int spi_id = pinsToSpi (mosi , miso , sck );
66
+ if (spi_id == -1 ) {
67
67
return ;
68
68
} else {
69
- self -> spi_id = temp ;
70
- self -> spi_regs = MXC_SPI_GET_SPI (temp );
69
+ self -> spi_id = spi_id ;
70
+ self -> spi_regs = MXC_SPI_GET_SPI (spi_id );
71
71
}
72
72
73
73
// Other pins default to true
You can’t perform that action at this time.
0 commit comments