Skip to content

Commit

Permalink
"fix" adding spi sensors unitemp
Browse files Browse the repository at this point in the history
but sensors are being read incorrectly, need to find such sensor and make it work properly
  • Loading branch information
xMasterX committed Mar 24, 2024
1 parent 47d5101 commit 6e9c797
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions base_pack/unitemp/Sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,15 @@ const GPIO*
return NULL;
}
}
if(interface == &SPI) {

// This check is incorrect and not working anymore
/*if(interface == &SPI) {
if(!((gpio_interfaces_list[0] == NULL || gpio_interfaces_list[0] == &SPI) &&
(gpio_interfaces_list[1] == NULL || gpio_interfaces_list[1] == &SPI) &&
(gpio_interfaces_list[3] == NULL || gpio_interfaces_list[3] == &SPI))) {
return NULL;
}
}
}*/

uint8_t aviable_index = 0;
for(uint8_t i = 0; i < GPIO_ITEMS; i++) {
Expand Down
4 changes: 2 additions & 2 deletions base_pack/unitemp/sensors/MAX31855.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ bool unitemp_MAX31855_free(Sensor* sensor) {
bool unitemp_MAX31855_init(Sensor* sensor) {
SPISensor* instance = sensor->instance;
furi_hal_spi_bus_handle_init(instance->spi);
UNUSED(instance);
return true;
}

bool unitemp_MAX31855_deinit(Sensor* sensor) {
UNUSED(sensor);
SPISensor* instance = sensor->instance;
furi_hal_spi_bus_handle_deinit(instance->spi);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions base_pack/unitemp/sensors/MAX6675.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ bool unitemp_MAX6675_free(Sensor* sensor) {
bool unitemp_MAX6675_init(Sensor* sensor) {
SPISensor* instance = sensor->instance;
furi_hal_spi_bus_handle_init(instance->spi);
UNUSED(instance);
return true;
}

bool unitemp_MAX6675_deinit(Sensor* sensor) {
UNUSED(sensor);
SPISensor* instance = sensor->instance;
furi_hal_spi_bus_handle_deinit(instance->spi);
return true;
}

Expand Down

0 comments on commit 6e9c797

Please sign in to comment.