summaryrefslogtreecommitdiff
path: root/nuttx/arch/z80/src/ez80/ez80_timerisr.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-28 18:50:44 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-28 18:50:44 +0000
commitd24dad139fc6732f277a07158aca093acf874db2 (patch)
tree19004dd607c872a7cdde99c63e630293eb6c24b3 /nuttx/arch/z80/src/ez80/ez80_timerisr.c
parent5a7efee60f2d6a02cae752e1ac777d5a23b3e5da (diff)
downloadpx4-nuttx-d24dad139fc6732f277a07158aca093acf874db2.tar.gz
px4-nuttx-d24dad139fc6732f277a07158aca093acf874db2.tar.bz2
px4-nuttx-d24dad139fc6732f277a07158aca093acf874db2.zip
Fix more overflow/truncation problems in timer setups
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1537 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z80/src/ez80/ez80_timerisr.c')
-rw-r--r--nuttx/arch/z80/src/ez80/ez80_timerisr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/nuttx/arch/z80/src/ez80/ez80_timerisr.c b/nuttx/arch/z80/src/ez80/ez80_timerisr.c
index 60e46322b..65e728f48 100644
--- a/nuttx/arch/z80/src/ez80/ez80_timerisr.c
+++ b/nuttx/arch/z80/src/ez80/ez80_timerisr.c
@@ -1,7 +1,7 @@
/***************************************************************************
* arch/z80/src/ez80/ez80_timerisr.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -53,11 +53,6 @@
* Definitions
***************************************************************************/
-/* The system clock frequency is defined in the linkcmd file */
-
-extern unsigned long SYS_CLK_FREQ;
-#define _DEFCLK ((unsigned long)&SYS_CLK_FREQ)
-
/***************************************************************************
* Private Types
***************************************************************************/
@@ -143,9 +138,11 @@ void up_timerinit(void)
*
* For a system timer of 50,000,000 that would result in a reload value of
* 31,250
+ *
+ * NOTE: The system clock frequency value is defined in the board.h file
*/
- reload = (uint16)(_DEFCLK / 1600);
+ reload = (uint16)(ez80_systemclock / 1600);
outp(EZ80_TMR0_RRH, (ubyte)(reload >> 8));
outp(EZ80_TMR0_RRL, (ubyte)(reload));