Просмотр исходного кода

"fix" adding spi sensors unitemp

but sensors are being read incorrectly, need to find such sensor and make it work properly
MX 1 год назад
Родитель
Сommit
7157dc8e96
3 измененных файлов с 8 добавлено и 6 удалено
  1. 4 2
      Sensors.c
  2. 2 2
      sensors/MAX31855.c
  3. 2 2
      sensors/MAX6675.c

+ 4 - 2
Sensors.c

@@ -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++) {

+ 2 - 2
sensors/MAX31855.c

@@ -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;
 }
 

+ 2 - 2
sensors/MAX6675.c

@@ -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;
 }