diff --git a/porting/himax/we2/el_config_porting.h b/porting/himax/we2/el_config_porting.h index e39d4379..e6467dcf 100644 --- a/porting/himax/we2/el_config_porting.h +++ b/porting/himax/we2/el_config_porting.h @@ -44,7 +44,7 @@ #endif #endif -#define CONFIG_EL_DEBUG 4 // use 0 to make firmware generator happy +#define CONFIG_EL_DEBUG 0 // use 0 to make firmware generator happy #define CONFIG_EL_DEBUG_COLOR 0 #define CONFIG_EL_HAS_FREERTOS_SUPPORT 1 #define SSCMA_REPL_EXECUTOR_PRIO 2 diff --git a/sscma/callback/invoke.hpp b/sscma/callback/invoke.hpp index 547b8cd8..e36fb798 100644 --- a/sscma/callback/invoke.hpp +++ b/sscma/callback/invoke.hpp @@ -292,11 +292,13 @@ class Invoke final : public std::enable_shared_from_this { static_resource->executor->add_task( [algorithm, cmd = std::move(argv[0]), value, ret, caller](const std::atomic&) mutable { if (ret == EL_OK) [[likely]] { - algorithm->set_score_threshold(value); - ret = static_resource->storage->emplace( - el_make_storage_kv_from_type(algorithm->get_algorithm_config())) - ? EL_OK - : EL_EIO; + if (algorithm->get_score_threshold() != value) [[likely]] { + algorithm->set_score_threshold(value); + ret = static_resource->storage->emplace( + el_make_storage_kv_from_type(algorithm->get_algorithm_config())) + ? EL_OK + : EL_EIO; + } } auto ss{concat_strings("\r{\"type\": 0, \"name\": \"", cmd, @@ -341,11 +343,13 @@ class Invoke final : public std::enable_shared_from_this { static_resource->executor->add_task( [algorithm, cmd = std::move(argv[0]), value, ret, caller](const std::atomic&) mutable { if (ret == EL_OK) [[likely]] { - algorithm->set_iou_threshold(value); - ret = static_resource->storage->emplace( - el_make_storage_kv_from_type(algorithm->get_algorithm_config())) - ? EL_OK - : EL_EIO; + if (algorithm->get_iou_threshold() != value) [[likely]] { + algorithm->set_iou_threshold(value); + ret = static_resource->storage->emplace( + el_make_storage_kv_from_type(algorithm->get_algorithm_config())) + ? EL_OK + : EL_EIO; + } } auto ss{concat_strings("\r{\"type\": 0, \"name\": \"", cmd, diff --git a/sscma/callback/sensor.hpp b/sscma/callback/sensor.hpp index 6884df23..59b1b4e3 100644 --- a/sscma/callback/sensor.hpp +++ b/sscma/callback/sensor.hpp @@ -53,8 +53,9 @@ void set_sensor( ret = camera->init(opt_id); // TODO: custom resolution if (ret != EL_OK) [[unlikely]] goto SensorError; - +#ifndef CONFIG_EL_BOARD_SENSECAP_WATCHER // watcher does not store sensor id static_resource->storage->emplace(el_make_storage_kv(SSCMA_STORAGE_KEY_CONF_SENSOR_OPT, opt_id)); +#endif } // set the sensor state to available @@ -65,11 +66,13 @@ void set_sensor( // if sensor id changed, update current sensor id if (static_resource->current_sensor_id != sensor_id) { static_resource->current_sensor_id = sensor_id; +#ifndef CONFIG_EL_BOARD_SENSECAP_WATCHER // watcher does not store sensor id if (!called_by_event) ret = static_resource->storage->emplace( el_make_storage_kv(SSCMA_STORAGE_KEY_CONF_SENSOR_ID, static_resource->current_sensor_id)) ? EL_OK : EL_EIO; +#endif } } else ret = EL_ENOTSUP;