pull/10970/head
Jonas Vanthornhout 2022-10-31 17:31:40 +01:00 zatwierdzone przez morris
rodzic 88482af17a
commit bc225c8886
3 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -34,7 +34,7 @@ typedef struct {
/**
* @brief temperature_sensor_config_t default constructure
*/
#define TEMPERAUTRE_SENSOR_CONFIG_DEFAULT(min, max) \
#define TEMPERATURE_SENSOR_CONFIG_DEFAULT(min, max) \
{ \
.range_min = min, \
.range_max = max, \

Wyświetl plik

@ -13,7 +13,7 @@ TEST_CASE("Temperature_sensor_driver_workflow_test", "[temperature_sensor]")
{
printf("Initializing Temperature sensor\n");
float tsens_out;
temperature_sensor_config_t temp_sensor = TEMPERAUTRE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_config_t temp_sensor = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_handle_t temp_handle = NULL;
TEST_ESP_OK(temperature_sensor_install(&temp_sensor, &temp_handle));
// read sensor before enable it should fail
@ -41,7 +41,7 @@ TEST_CASE("Temperature_sensor_driver_workflow_test", "[temperature_sensor]")
TEST_CASE("Double install error cause test", "[temperature_sensor]")
{
printf("Initializing Temperature sensor\n");
temperature_sensor_config_t temp_sensor = TEMPERAUTRE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_config_t temp_sensor = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_handle_t temp_handle = NULL;
TEST_ESP_OK(temperature_sensor_install(&temp_sensor, &temp_handle));
TEST_ESP_ERR(ESP_ERR_INVALID_STATE, temperature_sensor_install(&temp_sensor, &temp_handle));
@ -51,7 +51,7 @@ TEST_CASE("Double install error cause test", "[temperature_sensor]")
TEST_CASE("Double start error cause test", "[temperature_sensor]")
{
printf("Initializing Temperature sensor\n");
temperature_sensor_config_t temp_sensor = TEMPERAUTRE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_config_t temp_sensor = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_handle_t temp_handle = NULL;
TEST_ESP_OK(temperature_sensor_install(&temp_sensor, &temp_handle));
TEST_ESP_OK(temperature_sensor_enable(temp_handle));
@ -64,7 +64,7 @@ TEST_CASE("Double Start-Stop test", "[temperature_sensor]")
{
printf("Initializing Temperature sensor\n");
float tsens_out;
temperature_sensor_config_t temp_sensor = TEMPERAUTRE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_config_t temp_sensor = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_handle_t temp_handle = NULL;
TEST_ESP_OK(temperature_sensor_install(&temp_sensor, &temp_handle));
TEST_ESP_OK(temperature_sensor_enable(temp_handle));

Wyświetl plik

@ -15,7 +15,7 @@ void app_main(void)
{
ESP_LOGI(TAG, "Install temperature sensor, expected temp ranger range: 10~50 ℃");
temperature_sensor_handle_t temp_sensor = NULL;
temperature_sensor_config_t temp_sensor_config = TEMPERAUTRE_SENSOR_CONFIG_DEFAULT(10, 50);
temperature_sensor_config_t temp_sensor_config = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);
ESP_ERROR_CHECK(temperature_sensor_install(&temp_sensor_config, &temp_sensor));
ESP_LOGI(TAG, "Enable temperature sensor");