Skip to content

Commit c9896be

Browse files
committed
Merge pull request #11 from niklas-arm/feature/yotta_config
Add yotta config defaults
2 parents c86f924 + a5bff5d commit c9896be

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

minar-platform/minar_platform_types.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@
2121
#include <stdint.h>
2222
#include "objects.h" //TODO: Replace by the proper target config file
2323

24+
// provide default values for the config
25+
#ifndef YOTTA_CFG_MINAR_PLATFORM_TIME_MASK
26+
# define YOTTA_CFG_MINAR_PLATFORM_TIME_MASK 0xFFFFFFFFu
27+
#endif
28+
#ifndef YOTTA_CFG_MINAR_PLATFORM_TIME_BASE
29+
# define YOTTA_CFG_MINAR_PLATFORM_TIME_BASE 1000
30+
#endif
31+
#ifndef YOTTA_CFG_MINAR_PLATFORM_MINIMUM_SLEEP
32+
# define YOTTA_CFG_MINAR_PLATFORM_MINIMUM_SLEEP 1
33+
#endif
34+
35+
#define MINAR_PLATFORM_TIME_MASK YOTTA_CFG_MINAR_PLATFORM_TIME_MASK
36+
// backwards compatible guard for definition in `mbed-hal-<chip>/target_config.h`
37+
#ifndef MINAR_PLATFORM_TIME_BASE
38+
# define MINAR_PLATFORM_TIME_BASE YOTTA_CFG_MINAR_PLATFORM_TIME_BASE
39+
#endif
40+
#ifndef MINAR_PLATFORM_MINIMUM_SLEEP
41+
# define MINAR_PLATFORM_MINIMUM_SLEEP YOTTA_CFG_MINAR_PLATFORM_MINIMUM_SLEEP
42+
#endif
43+
44+
2445
namespace minar {
2546
namespace platform {
2647

@@ -33,7 +54,7 @@ enum Constants{
3354
Time_Mask = YOTTA_CFG_MINAR_TEST_CLOCK_OVERFLOW
3455
#else
3556
// 32 bits of time for mbed platforms
36-
Time_Mask = 0xFFFFFFFFu
57+
Time_Mask = MINAR_PLATFORM_TIME_MASK
3758
#endif
3859
};
3960

0 commit comments

Comments
 (0)