diff options
author | Perry Hung <iperry@alum.mit.edu> | 2010-08-04 04:38:58 -0400 |
---|---|---|
committer | Perry Hung <iperry@alum.mit.edu> | 2010-08-04 04:38:58 -0400 |
commit | c58c7dbe188509addf817dc208a234ddca6042fe (patch) | |
tree | b4cb0d95935306985804f482ec8622a9dfee2c9d /libmaple/util.h | |
parent | 57df5396fe83d0bb7aa55a9f4cd3a9eb2e4a6116 (diff) | |
download | librambutan-c58c7dbe188509addf817dc208a234ddca6042fe.tar.gz librambutan-c58c7dbe188509addf817dc208a234ddca6042fe.zip |
New usart implementation:
Fixed a bug where the maximum baud rate was incorrectly set to 225000
General cleanup
Use new rcc and nvic APIs
Diffstat (limited to 'libmaple/util.h')
-rw-r--r-- | libmaple/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmaple/util.h b/libmaple/util.h index a18fa84..5b20088 100644 --- a/libmaple/util.h +++ b/libmaple/util.h @@ -65,6 +65,8 @@ #define __read(reg) *(volatile uint32*)(reg) #define __write(reg, value) *(volatile uint32*)(reg) = (value) +#define IS_POWER_OF_TWO(v) (v && !(v & (v - 1))) + #ifdef __cplusplus extern "C"{ #endif |