diff options
author | Perry Hung <iperry@gmail.com> | 2011-02-27 03:07:31 -0500 |
---|---|---|
committer | Perry Hung <iperry@gmail.com> | 2011-02-27 04:58:43 -0500 |
commit | def4173e683c3538388aabceeb08e5336c2bdadf (patch) | |
tree | 54e2571fb12b31d6730eb1a1b33d09fc53e003a8 /libmaple/util.h | |
parent | c8ca7a2eb7528462677c80497854b940931eab16 (diff) | |
download | librambutan-def4173e683c3538388aabceeb08e5336c2bdadf.tar.gz librambutan-def4173e683c3538388aabceeb08e5336c2bdadf.zip |
libmaple: Refactor ADC routines
ADC routines rewritten, support for ADC2, 3, added.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/util.h')
-rw-r--r-- | libmaple/util.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libmaple/util.h b/libmaple/util.h index 64782d9..63427cc 100644 --- a/libmaple/util.h +++ b/libmaple/util.h @@ -44,7 +44,8 @@ /* Convert SRAM address */ #define BITBAND_SRAM(a,b) ((BITBAND_SRAM_BASE+(a-BITBAND_SRAM_REF)*32+(b*4))) /* Convert PERI address */ -#define BITBAND_PERI(a,b) ((BITBAND_PERI_BASE+(a-BITBAND_PERI_REF)*32+(b*4))) +#define BITBAND_PERI(a, b) ((BITBAND_PERI_BASE + \ + ((uint32)a - BITBAND_PERI_REF) * 32 + (b * 4))) #define REG_SET(reg, val) (*(volatile uint32*)(reg) = (val)) #define REG_SET_BIT(reg, bit) (*(volatile uint32*)(reg) |= BIT(bit)) |