Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwtest/main,adcs: Fix unexpected stop on loop test #46

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions tests/hwtest/adcs/src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

#include <zephyr/logging/log.h>

#define CSP_ID_MAIN (1U)
#define CSP_ID_ADCS (2U)
#define CSP_ID_PYLD (3U)
#define CSP_ID_EPS (4U)
#define CSP_ID_SRS3 (5U)
#define CSP_ID_GND (10U)
#define LOOP_STOP_EVENT (1U)
#define LOG_ENABLE (true)
#define LOG_DISABLE (false)
#define CSP_ID_MAIN (1U)
#define CSP_ID_ADCS (2U)
#define CSP_ID_PYLD (3U)
#define CSP_ID_EPS (4U)
#define CSP_ID_SRS3 (5U)
#define CSP_ID_GND (10U)
#define LOOP_START_EVENT (0U)
#define LOOP_STOP_EVENT (1U)
#define LOG_ENABLE (true)
#define LOG_DISABLE (false)

#define HWTEST_LOG_INF(log, format, ...) \
if (log) { \
Expand Down
2 changes: 2 additions & 0 deletions tests/hwtest/adcs/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ static void cmd_handler(void *p1, void *p2, void *p3)
} else if (strcmp(cmd, "rw") == 0) {
ret = rw_test(&err_cnt);
} else if (strcmp(cmd, "loop") == 0) {
k_event_set(&loop_event, LOOP_START_EVENT);
ret = loop_test(atoi(arg), &err_cnt);
k_event_clear(&loop_event, LOOP_STOP_EVENT);
} else if (strcmp(cmd, "syshk") == 0) {
k_event_set(&loop_event, LOOP_START_EVENT);
ret = syshk_test(atoi(arg), &err_cnt);
k_event_clear(&loop_event, LOOP_STOP_EVENT);
} else {
Expand Down
7 changes: 4 additions & 3 deletions tests/hwtest/main/src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

#include <zephyr/logging/log.h>

#define LOOP_STOP_EVENT (1U)
#define LOG_ENABLE (true)
#define LOG_DISABLE (false)
#define LOOP_START_EVENT (0U)
#define LOOP_STOP_EVENT (1U)
#define LOG_ENABLE (true)
#define LOG_DISABLE (false)

enum hwtest_mode {
MAIN_ONLY_WITHOUT_DSTRX = 0,
Expand Down
2 changes: 2 additions & 0 deletions tests/hwtest/main/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ static void cmd_handler(void *p1, void *p2, void *p3)
} else if (strcmp(cmd, "dstrx3") == 0) {
ret = dstrx3_test(&dstrx3_ret, &err_cnt, LOG_ENABLE);
} else if (strcmp(cmd, "loop") == 0) {
k_event_set(&loop_event, LOOP_START_EVENT);
ret = loop_test(atoi(arg), &err_cnt);
k_event_clear(&loop_event, LOOP_STOP_EVENT);
} else if (strcmp(cmd, "syshk") == 0) {
k_event_set(&loop_event, LOOP_START_EVENT);
ret = syshk_test(atoi(arg), &err_cnt);
k_event_clear(&loop_event, LOOP_STOP_EVENT);
} else {
Expand Down