Skip to content

Commit 6e9c797

Browse files
committed
"fix" adding spi sensors unitemp
but sensors are being read incorrectly, need to find such sensor and make it work properly
1 parent 47d5101 commit 6e9c797

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

base_pack/unitemp/Sensors.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,15 @@ const GPIO*
196196
return NULL;
197197
}
198198
}
199-
if(interface == &SPI) {
199+
200+
// This check is incorrect and not working anymore
201+
/*if(interface == &SPI) {
200202
if(!((gpio_interfaces_list[0] == NULL || gpio_interfaces_list[0] == &SPI) &&
201203
(gpio_interfaces_list[1] == NULL || gpio_interfaces_list[1] == &SPI) &&
202204
(gpio_interfaces_list[3] == NULL || gpio_interfaces_list[3] == &SPI))) {
203205
return NULL;
204206
}
205-
}
207+
}*/
206208

207209
uint8_t aviable_index = 0;
208210
for(uint8_t i = 0; i < GPIO_ITEMS; i++) {

base_pack/unitemp/sensors/MAX31855.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ bool unitemp_MAX31855_free(Sensor* sensor) {
4343
bool unitemp_MAX31855_init(Sensor* sensor) {
4444
SPISensor* instance = sensor->instance;
4545
furi_hal_spi_bus_handle_init(instance->spi);
46-
UNUSED(instance);
4746
return true;
4847
}
4948

5049
bool unitemp_MAX31855_deinit(Sensor* sensor) {
51-
UNUSED(sensor);
50+
SPISensor* instance = sensor->instance;
51+
furi_hal_spi_bus_handle_deinit(instance->spi);
5252
return true;
5353
}
5454

base_pack/unitemp/sensors/MAX6675.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ bool unitemp_MAX6675_free(Sensor* sensor) {
4343
bool unitemp_MAX6675_init(Sensor* sensor) {
4444
SPISensor* instance = sensor->instance;
4545
furi_hal_spi_bus_handle_init(instance->spi);
46-
UNUSED(instance);
4746
return true;
4847
}
4948

5049
bool unitemp_MAX6675_deinit(Sensor* sensor) {
51-
UNUSED(sensor);
50+
SPISensor* instance = sensor->instance;
51+
furi_hal_spi_bus_handle_deinit(instance->spi);
5252
return true;
5353
}
5454

0 commit comments

Comments
 (0)