Reduce debug output; calibrate DM320 timer
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@372 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
37637344e4
commit
9048998778
@ -1,4 +1,4 @@
|
|||||||
/************************************************************
|
/****************************************************************************
|
||||||
* common/up_initialize.c
|
* common/up_initialize.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||||
@ -31,11 +31,11 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -45,37 +45,67 @@
|
|||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
|
* Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Define to enable timing loop calibration */
|
||||||
|
|
||||||
|
#undef CONFIG_ARM_CALIBRATION
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Private Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Global Functions
|
* Name: up_calibratedelay
|
||||||
************************************************************/
|
*
|
||||||
|
* Description:
|
||||||
|
* Delay loops are provided for short timing loops. This function, if
|
||||||
|
* enabled, will just wait for 100 seconds. Using a stopwatch, you can
|
||||||
|
* can then determine if the timing loops are properly calibrated.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
#if defined(CONFIG_ARM_CALIBRATION) & defined(CONFIG_DEBUG)
|
||||||
|
static void up_calibratedelay(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
lldbg("Beginning 100s delay\n");
|
||||||
|
for (i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
up_mdelay(1000);
|
||||||
|
}
|
||||||
|
lldbg("End 100s delay\n");
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
# define up_calibratedelay()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
* Name: up_initialize
|
* Name: up_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* up_initialize will be called once during OS
|
* up_initialize will be called once during OS initialization after the
|
||||||
* initialization after the basic OS services have been
|
* basic OS services have been initialized. The architecture specific
|
||||||
* initialized. The architecture specific details of
|
* details of initializing the OS will be handled here. Such things as
|
||||||
* initializing the OS will be handled here. Such things as
|
* setting up interrupt service routines, starting the clock, and
|
||||||
* setting up interrupt service routines, starting the
|
* registering device drivers are some of the things that are different
|
||||||
* clock, and registering device drivers are some of the
|
* for each processor and hardware platform.
|
||||||
* things that are different for each processor and hardware
|
|
||||||
* platform.
|
|
||||||
*
|
*
|
||||||
* up_initialize is called after the OS initialized but
|
* up_initialize is called after the OS initialized but before the user
|
||||||
* before the init process has been started and before the
|
* initialization logic has been started and before the libraries have
|
||||||
* libraries have been initialized. OS services and driver
|
* been initialized. OS services and driver services are available.
|
||||||
* services are available.
|
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_initialize(void)
|
void up_initialize(void)
|
||||||
{
|
{
|
||||||
@ -83,6 +113,10 @@ void up_initialize(void)
|
|||||||
|
|
||||||
current_regs = NULL;
|
current_regs = NULL;
|
||||||
|
|
||||||
|
/* Calibrate the timing loop */
|
||||||
|
|
||||||
|
up_calibratedelay();
|
||||||
|
|
||||||
/* Initialize the interrupt subsystem */
|
/* Initialize the interrupt subsystem */
|
||||||
|
|
||||||
up_irqinitialize();
|
up_irqinitialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user