summaryrefslogtreecommitdiffstats
path: root/cpukit/libtest/t-test-interrupt.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/libtest/t-test-interrupt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/cpukit/libtest/t-test-interrupt.c b/cpukit/libtest/t-test-interrupt.c
index 5d83b7876a..8796dc0b5a 100644
--- a/cpukit/libtest/t-test-interrupt.c
+++ b/cpukit/libtest/t-test-interrupt.c
@@ -5,11 +5,12 @@
*
* @ingroup RTEMSTestFrameworkImpl
*
- * @brief Implementation of T_interrupt_test().
+ * @brief This source file contains the implementation of
+ * T_interrupt_test().
*/
/*
- * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2020 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -456,9 +457,16 @@ T_interrupt_test(const T_interrupt_test_config *config, void *arg)
lower_bound[sample] = lower - delta;
sample = (sample + 1) % T_INTERRUPT_SAMPLE_COUNT;
- } else if (state == T_INTERRUPT_TEST_LATE) {
+ } else if (state == T_INTERRUPT_TEST_LATE ||
+ state == T_INTERRUPT_TEST_ACTION) {
uint_fast32_t upper;
+ /*
+ * If the state is T_INTERRUPT_TEST_ACTION, then there
+ * was probably no interrupt during the action, so the
+ * interrupt would be late.
+ */
+
lower_sum -= lower_bound[sample];
lower_sum += busy;
lower_bound[sample] = busy;