Merge pull request #14570 from fjmolinas/pr_fix_mock_rtt_defs
drivers/rtt: override RTT_MAX_VALUE and RTT_FREQUENCY for mock
This commit is contained in:
commit
d187e83221
@ -79,21 +79,23 @@ extern "C" {
|
|||||||
#define RTT_MIN_OFFSET (2U)
|
#define RTT_MIN_OFFSET (2U)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RTT_FREQUENCY
|
|
||||||
/* Allow mock-RTT for unit tests */
|
/* Allow mock-RTT for unit tests */
|
||||||
#ifdef MOCK_RTT_FREQUENCY
|
#ifdef MOCK_RTT_FREQUENCY
|
||||||
|
#undef RTT_FREQUENCY
|
||||||
#define RTT_FREQUENCY MOCK_RTT_FREQUENCY
|
#define RTT_FREQUENCY MOCK_RTT_FREQUENCY
|
||||||
#else
|
#else
|
||||||
|
#ifndef RTT_FREQUENCY
|
||||||
#warning "RTT_FREQUENCY undefined. Set RTT_FREQUENCY to the number of ticks " \
|
#warning "RTT_FREQUENCY undefined. Set RTT_FREQUENCY to the number of ticks " \
|
||||||
"per second for the current architecture."
|
"per second for the current architecture."
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RTT_MAX_VALUE
|
|
||||||
/* Allow mock-RTT for unit tests */
|
/* Allow mock-RTT for unit tests */
|
||||||
#ifdef MOCK_RTT_MAX_VALUE
|
#ifdef MOCK_RTT_MAX_VALUE
|
||||||
|
#undef RTT_MAX_VALUE
|
||||||
#define RTT_MAX_VALUE MOCK_RTT_MAX_VALUE
|
#define RTT_MAX_VALUE MOCK_RTT_MAX_VALUE
|
||||||
#else
|
#else
|
||||||
|
#ifndef RTT_MAX_VALUE
|
||||||
#warning "RTT_MAX_VALUE is undefined. Set RTT_MAX_VALUE to the maximum value " \
|
#warning "RTT_MAX_VALUE is undefined. Set RTT_MAX_VALUE to the maximum value " \
|
||||||
"for the RTT counter, ensure it is (2^n - 1)."
|
"for the RTT counter, ensure it is (2^n - 1)."
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user