summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-01-31 11:47:07 +0700
committerhathach <[email protected]>2013-01-31 11:47:07 +0700
commitbef17fb67fc283cdc8cbda068d122c2a95c3b880 (patch)
treea03377deb8b7cefbad31105e9058305d5e6ebe5a /tinyusb
parenteca87e5ee54f688372d2d34ee51dc3f72947d604 (diff)
add version macros
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/common/common.h6
-rw-r--r--tinyusb/tusb_option.h6
2 files changed, 10 insertions, 2 deletions
diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h
index 17c70429e..e6550e586 100644
--- a/tinyusb/common/common.h
+++ b/tinyusb/common/common.h
@@ -62,11 +62,11 @@
#include <stdio.h>
#include "compiler/compiler.h"
-#include "tusb_option.h"
-#include "errors.h"
#include "assertion.h"
#include "binary.h"
+#include "errors.h"
+#include "tusb_option.h"
#include "hal/hal.h"
#include "core/tusb_types.h"
#include "core/std_descriptors.h"
@@ -78,6 +78,8 @@
#define STATIC_
#endif
+#define STRING_(x) #x // stringify without expand
+#define XSTRING_(x) STRING_(x) // expand then stringify
/// form an uint32_t from 4 x uint8_t
static inline uint32_t u32_from_u8(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4) ATTR_ALWAYS_INLINE ATTR_CONST;
diff --git a/tinyusb/tusb_option.h b/tinyusb/tusb_option.h
index 0b0d308a2..04316ac9c 100644
--- a/tinyusb/tusb_option.h
+++ b/tinyusb/tusb_option.h
@@ -53,6 +53,12 @@
extern "C" {
#endif
+#define TUSB_VERSION_YEAR 00
+#define TUSB_VERSION_MONTH 00
+#define TUSB_VERSION_WEEK 0
+#define TUSB_VERSION_NAME "alpha"
+#define TUSB_VERSION XSTRING_(TUSB_VERSION_YEAR) "." XSTRING_(TUSB_VERSION_MONTH)
+
/// define this symbol will make tinyusb look for external configure file
#include "tusb_config.h"