From 34c91a6726f42b444955f7e148fc654c89b5898a Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Thu, 21 May 2009 14:52:27 -0400 Subject: [PATCH] this code starts up the 32kHZ clock --- include/crm.h | 2 +- include/utils.h | 5 +++++ tests/sleep.c | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/include/crm.h b/include/crm.h index e7b80710f..0110074c1 100644 --- a/include/crm.h +++ b/include/crm.h @@ -16,7 +16,7 @@ #define CRM_RTC_TIMEOUT (CRM_BASE+0x2c) #define CRM_CAL_CNTL (CRM_BASE+0x34) #define CRM_CAL_COUNT (CRM_BASE+0x38) -#define CRM_RINGOSC_CTNL (CRM_BASE+0x3c) +#define CRM_RINGOSC_CNTL (CRM_BASE+0x3c) #define CRM_XTAL_CNTL (CRM_BASE+0x40) #define CRM_XTAL32_CNTL (CRM_BASE+0x44) #define CRM_VREG_CNTL (CRM_BASE+0x48) diff --git a/include/utils.h b/include/utils.h index 87bbf5bb4..21ad6f711 100644 --- a/include/utils.h +++ b/include/utils.h @@ -4,4 +4,9 @@ #define reg32(x) (*(volatile uint32_t *)(x)) #define reg16(x) (*(volatile uint16_t *)(x)) +#define bit(bit) (1<> bit) == 1) +#define clear_bit(val,bit) (val=(val & ~(1<