mbed

Fork of mbed-dev by mbed official

Revision:
144:ef7eb2e8f9f7
Child:
147:30b64687e01f
diff -r 423e1876dc07 -r ef7eb2e8f9f7 targets/hal/TARGET_ONSEMI/TARGET_NCS36510/macros.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/hal/TARGET_ONSEMI/TARGET_NCS36510/macros.h	Fri Sep 02 15:07:44 2016 +0100
@@ -0,0 +1,35 @@
+/**
+ ******************************************************************************
+ * @file macros.h
+ * @brief      Implements some handy macros
+ * @internal
+ * @author     : ON Semiconductor.
+ * $Rev: 2076 $
+ * $Date: 2013-07-10 18:26:10 +0530 (Wed, 10 Jul 2013) $
+ *******************************************************************************
+ * @copyright (c) 2012 ON Semiconductor. All rights reserved.
+ * ON Semiconductor is supplying this software for use with ON Semiconductor
+ * processor based microcontrollers only.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+ * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+ * @endinternal
+ *
+ * @details
+ *
+ * @ingroup UTILITY
+ */
+
+#ifndef MACROS_H_
+#define MACROS_H_
+
+#define BM(n) (1 << (n))
+#define BF(x,b,s) (((x) & (b)) >> (s))
+#define MIN(n,m) (((n) < (m)) ? (n) : (m))
+#define MAX(n,m) (((n) < (m)) ? (m) : (n))
+#define ABS(n) ((n < 0) ? -(n) : (n))
+
+#endif /* MACROS_H_ */