Skip to content

Commit 26b5136

Browse files
stanislav-poborilnordic-krch
authored andcommitted
tests: drivers: counter: Enabled counter tests on UDOO Neo board
Tests i.MX EPIT timer peripheral driver. Since it supports zero number of channel alarms, some tests had to be adjusted to look at the number of channel alarms supported first. Signed-off-by: Stanislav Poboril <[email protected]>
1 parent b3b8f65 commit 26b5136

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_COUNTER_IMX_EPIT_1=y
2+
CONFIG_COUNTER_IMX_EPIT_2=y

tests/drivers/counter/counter_basic_api/src/test_counter.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ const char *devices[] = {
4646
#ifdef CONFIG_COUNTER_RTC2
4747
CONFIG_COUNTER_RTC2_NAME,
4848
#endif
49+
#ifdef CONFIG_COUNTER_IMX_EPIT_1
50+
EPIT_1_LABEL,
51+
#endif
52+
#ifdef CONFIG_COUNTER_IMX_EPIT_2
53+
EPIT_2_LABEL,
54+
#endif
4955
};
5056
typedef void (*counter_test_func_t)(const char *dev_name);
5157

@@ -143,6 +149,11 @@ void test_single_shot_alarm_instance(const char *dev_name)
143149

144150
alarm_cnt = 0;
145151

152+
if (counter_get_num_of_channels(dev) < 1U) {
153+
/* Counter does not support any alarm */
154+
return;
155+
}
156+
146157
err = counter_start(dev);
147158
zassert_equal(0, err, "Counter failed to start\n");
148159

@@ -216,6 +227,11 @@ void test_multiple_alarms_instance(const char *dev_name)
216227

217228
alarm_cnt = 0;
218229

230+
if (counter_get_num_of_channels(dev) < 2U) {
231+
/* Counter does not support two alarms */
232+
return;
233+
}
234+
219235
err = counter_start(dev);
220236
zassert_equal(0, err, "Counter failed to start\n");
221237

0 commit comments

Comments
 (0)