Cleanup and replace constants
- Delete unused declaration of `g_is_component_initialized`. - Replace the following constants with approprite config options: + `relay_chn_count` > `CONFIG_RELAY_CHN_COUNT` + `opposite_inerta_ms` > `CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS` - Replace the definition of the `test_delay_margin_ms` constant with `#define TEST_DELAY_MARGIN_MS 50` for preprocessor calculations.
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
|
||||
const char *TEST_TAG = "RELAY_CHN_TEST";
|
||||
|
||||
const uint8_t relay_chn_count = CONFIG_RELAY_CHN_COUNT;
|
||||
const uint32_t opposite_inertia_ms = CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS;
|
||||
const uint32_t test_delay_margin_ms = 50; // ms tolerance
|
||||
|
||||
// Test-wide GPIO map
|
||||
#if CONFIG_RELAY_CHN_COUNT > 1
|
||||
const uint8_t gpio_map[] = {
|
||||
@@ -40,13 +36,13 @@ void reset_channels_to_idle_state()
|
||||
{
|
||||
#if CONFIG_RELAY_CHN_COUNT > 1
|
||||
relay_chn_stop_all();
|
||||
vTaskDelay(pdMS_TO_TICKS(opposite_inertia_ms + test_delay_margin_ms));
|
||||
vTaskDelay(pdMS_TO_TICKS(CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS + TEST_DELAY_MARGIN_MS));
|
||||
for (int i = 0; i < CONFIG_RELAY_CHN_COUNT; i++) {
|
||||
TEST_ASSERT_EQUAL(RELAY_CHN_STATE_IDLE, relay_chn_get_state(i));
|
||||
}
|
||||
#else
|
||||
relay_chn_stop();
|
||||
vTaskDelay(pdMS_TO_TICKS(opposite_inertia_ms + test_delay_margin_ms));
|
||||
vTaskDelay(pdMS_TO_TICKS(CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS + TEST_DELAY_MARGIN_MS));
|
||||
TEST_ASSERT_EQUAL(RELAY_CHN_STATE_IDLE, relay_chn_get_state());
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user