summaryrefslogtreecommitdiff
path: root/tinyusb/common/assertion.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-28 13:38:17 +0700
committerhathach <[email protected]>2018-03-28 13:38:17 +0700
commit604275341ecbb830e852a3522d7957ad66828dee (patch)
tree7593a52cb324df454d84b180cfcc76212707c4c6 /tinyusb/common/assertion.h
parent03582f74b8ac7fd83c9bb695777713f781e8f1a1 (diff)
repo cleanup
Diffstat (limited to 'tinyusb/common/assertion.h')
-rw-r--r--tinyusb/common/assertion.h32
1 files changed, 2 insertions, 30 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h
index edb3f69f7..edc1a2c45 100644
--- a/tinyusb/common/assertion.h
+++ b/tinyusb/common/assertion.h
@@ -49,10 +49,10 @@ extern "C"
{
#endif
-#include "tusb_option.h"
#include <stdbool.h>
#include <stdint.h>
-#include "compiler/tusb_compiler.h"
+#include "tusb_option.h"
+#include "tusb_compiler.h"
#include "tusb_hal.h" // TODO find a way to break hal dependency
@@ -108,9 +108,7 @@ extern "C"
//--------------------------------------------------------------------+
#define ASSERT(...) ASSERT_TRUE(__VA_ARGS__)
#define ASSERT_TRUE(condition , error) ASSERT_DEFINE( , (condition), error, "%s", "evaluated to false")
-#define ASSERT_FALSE(condition , error) ASSERT_DEFINE( ,!(condition), error, "%s", "evaluated to true")
#define ASSERT_FAILED(error) ASSERT_DEFINE( , false, error, "%s", "FAILED")
-#define ASSERT_FAILED_MSG(error, msg) ASSERT_DEFINE( , false, error, "FAILED: %s", msg)
//--------------------------------------------------------------------+
// Pointer Assert
@@ -150,32 +148,6 @@ extern "C"
#define ASSERT_HEX_EQUAL(...) ASSERT_XXX_EQUAL("0x%x", __VA_ARGS__)
#define ASSERT_HEX_WITHIN(...) ASSERT_XXX_WITHIN("0x%x", __VA_ARGS__)
-//--------------------------------------------------------------------+
-// Bin Assert
-//--------------------------------------------------------------------+
-#define BIN8_PRINTF_PATTERN "%d%d%d%d%d%d%d%d"
-#define BIN8_PRINTF_CONVERT(byte) \
- ((byte) & 0x80 ? 1 : 0), \
- ((byte) & 0x40 ? 1 : 0), \
- ((byte) & 0x20 ? 1 : 0), \
- ((byte) & 0x10 ? 1 : 0), \
- ((byte) & 0x08 ? 1 : 0), \
- ((byte) & 0x04 ? 1 : 0), \
- ((byte) & 0x02 ? 1 : 0), \
- ((byte) & 0x01 ? 1 : 0)
-
-#define ASSERT_BIN8(...) ASSERT_BIN8_EQUAL(__VA_ARGS__)
-#define ASSERT_BIN8_EQUAL(expected, actual, error)\
- ASSERT_DEFINE(\
- uint8_t exp = (expected); uint8_t act = (actual),\
- exp==act,\
- error,\
- "expected " BIN8_PRINTF_PATTERN ", actual " BIN8_PRINTF_PATTERN, BIN8_PRINTF_CONVERT(exp), BIN8_PRINTF_CONVERT(act) )
-
-//--------------------------------------------------------------------+
-// TODO Bit Assert
-//--------------------------------------------------------------------+
-
#ifdef __cplusplus
}