1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

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:
Francisco 2020-07-22 16:33:29 +02:00 committed by GitHub
commit d187e83221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,21 +79,23 @@ extern "C" {
#define RTT_MIN_OFFSET (2U)
#endif
#ifndef RTT_FREQUENCY
/* Allow mock-RTT for unit tests */
#ifdef MOCK_RTT_FREQUENCY
#undef RTT_FREQUENCY
#define RTT_FREQUENCY MOCK_RTT_FREQUENCY
#else
#ifndef RTT_FREQUENCY
#warning "RTT_FREQUENCY undefined. Set RTT_FREQUENCY to the number of ticks " \
"per second for the current architecture."
#endif
#endif
#ifndef RTT_MAX_VALUE
/* Allow mock-RTT for unit tests */
#ifdef MOCK_RTT_MAX_VALUE
#undef RTT_MAX_VALUE
#define RTT_MAX_VALUE MOCK_RTT_MAX_VALUE
#else
#ifndef RTT_MAX_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)."
#endif