|
From: <ak...@us...> - 2008-02-17 15:47:15
|
Revision: 848
http://can.svn.sourceforge.net/can/?rev=848&view=rev
Author: akhe
Date: 2008-02-17 07:47:03 -0800 (Sun, 17 Feb 2008)
Log Message:
-----------
Changed name of common files thta are uP dependent
Modified Paths:
--------------
trunk/firmware/arm/str/common/delay.c
Added Paths:
-----------
trunk/firmware/arm/str/common/sysTime73x.c
trunk/firmware/arm/str/common/sysTime73x.h
trunk/firmware/arm/str/common/sysTime75x.c
trunk/firmware/arm/str/common/sysTime75x.h
Removed Paths:
-------------
trunk/firmware/arm/str/common/sysTime.c
trunk/firmware/arm/str/common/sysTime.h
Modified: trunk/firmware/arm/str/common/delay.c
===================================================================
--- trunk/firmware/arm/str/common/delay.c 2008-02-17 15:42:27 UTC (rev 847)
+++ trunk/firmware/arm/str/common/delay.c 2008-02-17 15:47:03 UTC (rev 848)
@@ -3,8 +3,7 @@
Martin Thomas, 11/2004
*/
-#include "73x_lib.h"
-#include "systime.h"
+
#include "delay.h"
Deleted: trunk/firmware/arm/str/common/sysTime.c
===================================================================
--- trunk/firmware/arm/str/common/sysTime.c 2008-02-17 15:42:27 UTC (rev 847)
+++ trunk/firmware/arm/str/common/sysTime.c 2008-02-17 15:47:03 UTC (rev 848)
@@ -1,127 +0,0 @@
-/******************************************************************************
- *
- * $RCSfile: sysTime.c,v $
- * $Revision: 1.4 $
- *
- * This module provides the interface routines for initializing and
- * accessing the system timing functions.
- * Copyright 2004, R O SoftWare
- * No guarantees, warrantees, or promises, implied or otherwise.
- * May be used for hobby or commercial purposes provided copyright
- * notice remains intact.
- *
- *****************************************************************************/
-
-//
-// The TB2_IRQHandler handler in vectors.c must be implemented fot this to work
-// This rotine should update the sysTICs value once each millisecond.
-// Something like this is needed
-//
-// sysTICs++;
-// TB_FlagClear( TB2 );
-//
-
-#include "sysTime.h"
-
-volatile vu32 sysTICs;
-
-/******************************************************************************
- *
- * Function Name: initTimebase2()
- *
- * Description:
- * This function initializes the TB2 for use as the system timer.
- *
- * Calling Sequence:
- * void
- *
- * Returns:
- * void
- *
- *****************************************************************************/
-void initTimebase2(void)
-{
- TB_InitTypeDef TB_InitStructure;
-
- sysTICs = 0;
-
- CFG_PeripheralClockConfig( CFG_CLK_TB2, ENABLE );
-
- // TB2 Configuration to get timbase IRQ each 1ms
- TB_InitStructure.TB_CLK_Source = TB_CLK_INTERNAL ;
- TB_InitStructure.TB_Prescaler = 50; // The internal TB Frequency = 160KHz
- TB_InitStructure.TB_Preload = 160; // 160000Hz * 0.001 s = 160
-
- TB_Init( TB2, &TB_InitStructure );
- TB_ITConfig( TB2, ENABLE );
-
- EIC_IRQChannelConfig( TB2_IRQChannel, ENABLE ); // Enable IRQ
-
- TB_Cmd( TB2, ENABLE ); // Enable the timer
-}
-
-/******************************************************************************
- *
- * Function Name: getSysTICs()
- *
- * Description:
- * This function returns the current syetem time in TICs.
- *
- * Calling Sequence:
- * void
- *
- * Returns:
- * The current time in TICs as represented by sysTICs
- *
- *****************************************************************************/
-u32 getSysTICs(void)
-{
- return sysTICs;
-}
-
-
-/******************************************************************************
- *
- * Function Name: getElapsedSysTICs()
- *
- * Description:
- * This function then returns the difference in TICs between the
- * given starting time and the current system time.
- *
- * Calling Sequence:
- * The starting time.
- *
- * Returns:
- * The time difference.
- *
- *****************************************************************************/
-u32 getElapsedSysTICs( u32 startTime )
-{
- return ( getSysTICs() - startTime );
-}
-
-
-/******************************************************************************
- *
- * Function Name: pause()
- *
- * Description:
- * This function does not return until the specified 'duration' in
- * TICs has elapsed.
- *
- * Calling Sequence:
- * duration - length of time in TICs to wait before returning
- *
- * Returns:
- * void
- *
- *****************************************************************************/
-void pause( u32 duration )
-{
- u32 startTime = getSysTICs();
-
- while ( getElapsedSysTICs( startTime ) < duration ) ;
-
-}
-
-
Deleted: trunk/firmware/arm/str/common/sysTime.h
===================================================================
--- trunk/firmware/arm/str/common/sysTime.h 2008-02-17 15:42:27 UTC (rev 847)
+++ trunk/firmware/arm/str/common/sysTime.h 2008-02-17 15:47:03 UTC (rev 848)
@@ -1,108 +0,0 @@
-/******************************************************************************
- *
- * $RCSfile: sysTime.h,v $
- * $Revision: 1.2 $
- *
- * This module provides the interface definitions for sysTime.c
- * Copyright 2004, R O SoftWare
- *
- * Ported for STR73xF 2006 <ak...@do...>
- *
- * No guarantees, warrantees, or promises, implied or otherwise.
- * May be used for hobby or commercial purposes provided copyright
- * notice remains intact.
- *
- *****************************************************************************/
-#ifndef INC_SYS_TIME_H
-#define INC_SYS_TIME_H
-
-#include "73x_lib.h"
-
-// setup parameters
-#define sysTICSperSEC 1000
-
-// some helpful times for pause()
-#define ONE_MS (u32)(( 1e-3 * sysTICSperSEC) + .5)
-#define TWO_MS (u32)(( 2e-3 * sysTICSperSEC) + .5)
-#define FIVE_MS (u32)(( 5e-3 * sysTICSperSEC) + .5)
-#define TEN_MS (u32)(( 10e-3 * sysTICSperSEC) + .5)
-#define TWENTY_MS (u32)(( 20e-3 * sysTICSperSEC) + .5)
-#define THIRTY_MS (u32)(( 30e-3 * sysTICSperSEC) + .5)
-#define FIFTY_MS (u32)(( 50e-3 * sysTICSperSEC) + .5)
-#define HUNDRED_MS (u32)((100e-3 * sysTICSperSEC) + .5)
-#define ONE_FIFTY_MS (u32)((150e-3 * sysTICSperSEC) + .5)
-#define QUARTER_SEC (u32)((250e-3 * sysTICSperSEC) + .5)
-#define HALF_SEC (u32)((500e-3 * sysTICSperSEC) + .5)
-#define ONE_SEC (u32)(( 1.0 * sysTICSperSEC) + .5)
-#define TWO_SEC (u32)(( 2.0 * sysTICSperSEC) + .5)
-#define FIVE_SEC (u32)(( 5.0 * sysTICSperSEC) + .5)
-#define TEN_SEC (u32)((10.0 * sysTICSperSEC) + .5)
-
-
-/******************************************************************************
- *
- * Function Name: initTimebase2()
- *
- * Description:
- * Init. TB2 for 1ms interrupts.
- *
- * Calling Sequence:
- * void
- *
- * Returns:
- * void
- *
- *****************************************************************************/
-void initTimebase2(void);
-
-/******************************************************************************
- *
- * Function Name: getSysTICs()
- *
- * Description:
- * This function returns the current system time in TICs.
- *
- * Calling Sequence:
- * void
- *
- * Returns:
- * The current time in TICs
- *
- *****************************************************************************/
-u32 getSysTICs(void);
-
-/******************************************************************************
- *
- * Function Name: getElapsedSysTICs()
- *
- * Description:
- * This function then returns the difference in TICs between the
- * given starting time and the current system time.
- *
- * Calling Sequence:
- * The starting time.
- *
- * Returns:
- * The time difference.
- *
- *****************************************************************************/
-u32 getElapsedSysTICs( u32 startTime);
-
-/******************************************************************************
- *
- * Function Name: pause()
- *
- * Description:
- * This function does not return until the specified 'duration' in
- * TICs has elapsed.
- *
- * Calling Sequence:
- * duration - length of time in TICs to wait before returning
- *
- * Returns:
- * void
- *
- *****************************************************************************/
-void pause( u32 duration);
-
-#endif
Copied: trunk/firmware/arm/str/common/sysTime73x.c (from rev 842, trunk/firmware/arm/str/common/sysTime.c)
===================================================================
--- trunk/firmware/arm/str/common/sysTime73x.c (rev 0)
+++ trunk/firmware/arm/str/common/sysTime73x.c 2008-02-17 15:47:03 UTC (rev 848)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ *
+ * $RCSfile: sysTime.c,v $
+ * $Revision: 1.4 $
+ *
+ * This module provides the interface routines for initializing and
+ * accessing the system timing functions.
+ * Copyright 2004, R O SoftWare
+ * No guarantees, warrantees, or promises, implied or otherwise.
+ * May be used for hobby or commercial purposes provided copyright
+ * notice remains intact.
+ *
+ *****************************************************************************/
+
+//
+// The TB2_IRQHandler handler in vectors.c must be implemented fot this to work
+// This rotine should update the sysTICs value once each millisecond.
+// Something like this is needed
+//
+// sysTICs++;
+// TB_FlagClear( TB2 );
+//
+
+#include "sysTime.h"
+
+volatile vu32 sysTICs;
+
+/******************************************************************************
+ *
+ * Function Name: initTimebase2()
+ *
+ * Description:
+ * This function initializes the TB2 for use as the system timer.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void initTimebase2(void)
+{
+ TB_InitTypeDef TB_InitStructure;
+
+ sysTICs = 0;
+
+ CFG_PeripheralClockConfig( CFG_CLK_TB2, ENABLE );
+
+ // TB2 Configuration to get timbase IRQ each 1ms
+ TB_InitStructure.TB_CLK_Source = TB_CLK_INTERNAL ;
+ TB_InitStructure.TB_Prescaler = 50; // The internal TB Frequency = 160KHz
+ TB_InitStructure.TB_Preload = 160; // 160000Hz * 0.001 s = 160
+
+ TB_Init( TB2, &TB_InitStructure );
+ TB_ITConfig( TB2, ENABLE );
+
+ EIC_IRQChannelConfig( TB2_IRQChannel, ENABLE ); // Enable IRQ
+
+ TB_Cmd( TB2, ENABLE ); // Enable the timer
+}
+
+/******************************************************************************
+ *
+ * Function Name: getSysTICs()
+ *
+ * Description:
+ * This function returns the current syetem time in TICs.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * The current time in TICs as represented by sysTICs
+ *
+ *****************************************************************************/
+u32 getSysTICs(void)
+{
+ return sysTICs;
+}
+
+
+/******************************************************************************
+ *
+ * Function Name: getElapsedSysTICs()
+ *
+ * Description:
+ * This function then returns the difference in TICs between the
+ * given starting time and the current system time.
+ *
+ * Calling Sequence:
+ * The starting time.
+ *
+ * Returns:
+ * The time difference.
+ *
+ *****************************************************************************/
+u32 getElapsedSysTICs( u32 startTime )
+{
+ return ( getSysTICs() - startTime );
+}
+
+
+/******************************************************************************
+ *
+ * Function Name: pause()
+ *
+ * Description:
+ * This function does not return until the specified 'duration' in
+ * TICs has elapsed.
+ *
+ * Calling Sequence:
+ * duration - length of time in TICs to wait before returning
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void pause( u32 duration )
+{
+ u32 startTime = getSysTICs();
+
+ while ( getElapsedSysTICs( startTime ) < duration ) ;
+
+}
+
+
Copied: trunk/firmware/arm/str/common/sysTime73x.h (from rev 842, trunk/firmware/arm/str/common/sysTime.h)
===================================================================
--- trunk/firmware/arm/str/common/sysTime73x.h (rev 0)
+++ trunk/firmware/arm/str/common/sysTime73x.h 2008-02-17 15:47:03 UTC (rev 848)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ *
+ * $RCSfile: sysTime.h,v $
+ * $Revision: 1.2 $
+ *
+ * This module provides the interface definitions for sysTime.c
+ * Copyright 2004, R O SoftWare
+ *
+ * Ported for STR73xF 2006 <ak...@do...>
+ *
+ * No guarantees, warrantees, or promises, implied or otherwise.
+ * May be used for hobby or commercial purposes provided copyright
+ * notice remains intact.
+ *
+ *****************************************************************************/
+#ifndef INC_SYS_TIME_H
+#define INC_SYS_TIME_H
+
+#include "73x_lib.h"
+
+// setup parameters
+#define sysTICSperSEC 1000
+
+// some helpful times for pause()
+#define ONE_MS (u32)(( 1e-3 * sysTICSperSEC) + .5)
+#define TWO_MS (u32)(( 2e-3 * sysTICSperSEC) + .5)
+#define FIVE_MS (u32)(( 5e-3 * sysTICSperSEC) + .5)
+#define TEN_MS (u32)(( 10e-3 * sysTICSperSEC) + .5)
+#define TWENTY_MS (u32)(( 20e-3 * sysTICSperSEC) + .5)
+#define THIRTY_MS (u32)(( 30e-3 * sysTICSperSEC) + .5)
+#define FIFTY_MS (u32)(( 50e-3 * sysTICSperSEC) + .5)
+#define HUNDRED_MS (u32)((100e-3 * sysTICSperSEC) + .5)
+#define ONE_FIFTY_MS (u32)((150e-3 * sysTICSperSEC) + .5)
+#define QUARTER_SEC (u32)((250e-3 * sysTICSperSEC) + .5)
+#define HALF_SEC (u32)((500e-3 * sysTICSperSEC) + .5)
+#define ONE_SEC (u32)(( 1.0 * sysTICSperSEC) + .5)
+#define TWO_SEC (u32)(( 2.0 * sysTICSperSEC) + .5)
+#define FIVE_SEC (u32)(( 5.0 * sysTICSperSEC) + .5)
+#define TEN_SEC (u32)((10.0 * sysTICSperSEC) + .5)
+
+
+/******************************************************************************
+ *
+ * Function Name: initTimebase2()
+ *
+ * Description:
+ * Init. TB2 for 1ms interrupts.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void initTimebase2(void);
+
+/******************************************************************************
+ *
+ * Function Name: getSysTICs()
+ *
+ * Description:
+ * This function returns the current system time in TICs.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * The current time in TICs
+ *
+ *****************************************************************************/
+u32 getSysTICs(void);
+
+/******************************************************************************
+ *
+ * Function Name: getElapsedSysTICs()
+ *
+ * Description:
+ * This function then returns the difference in TICs between the
+ * given starting time and the current system time.
+ *
+ * Calling Sequence:
+ * The starting time.
+ *
+ * Returns:
+ * The time difference.
+ *
+ *****************************************************************************/
+u32 getElapsedSysTICs( u32 startTime);
+
+/******************************************************************************
+ *
+ * Function Name: pause()
+ *
+ * Description:
+ * This function does not return until the specified 'duration' in
+ * TICs has elapsed.
+ *
+ * Calling Sequence:
+ * duration - length of time in TICs to wait before returning
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void pause( u32 duration);
+
+#endif
Added: trunk/firmware/arm/str/common/sysTime75x.c
===================================================================
--- trunk/firmware/arm/str/common/sysTime75x.c (rev 0)
+++ trunk/firmware/arm/str/common/sysTime75x.c 2008-02-17 15:47:03 UTC (rev 848)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ *
+ * $RCSfile: sysTime.c,v $
+ * $Revision: 1.4 $
+ *
+ * This module provides the interface routines for initializing and
+ * accessing the system timing functions.
+ * Copyright 2004, R O SoftWare
+ * No guarantees, warrantees, or promises, implied or otherwise.
+ * May be used for hobby or commercial purposes provided copyright
+ * notice remains intact.
+ *
+ *****************************************************************************/
+
+//
+// The TB2_IRQHandler handler in vectors.c must be implemented fot this to work
+// This rotine should update the sysTICs value once each millisecond.
+// Something like this is needed
+//
+// sysTICs++;
+// TB_FlagClear( TB2 );
+//
+
+#include "sysTime75x.h"
+
+volatile vu32 sysTICs;
+
+/******************************************************************************
+ *
+ * Function Name: initTimebase2()
+ *
+ * Description:
+ * This function initializes the TB2 for use as the system timer.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void initTimebase2(void)
+{
+ TB_InitTypeDef TB_InitStructure;
+
+ sysTICs = 0;
+
+ CFG_PeripheralClockConfig( CFG_CLK_TB2, ENABLE );
+
+ // TB2 Configuration to get timbase IRQ each 1ms
+ TB_InitStructure.TB_CLK_Source = TB_CLK_INTERNAL ;
+ TB_InitStructure.TB_Prescaler = 50; // The internal TB Frequency = 160KHz
+ TB_InitStructure.TB_Preload = 160; // 160000Hz * 0.001 s = 160
+
+ TB_Init( TB2, &TB_InitStructure );
+ TB_ITConfig( TB2, ENABLE );
+
+ EIC_IRQChannelConfig( TB2_IRQChannel, ENABLE ); // Enable IRQ
+
+ TB_Cmd( TB2, ENABLE ); // Enable the timer
+}
+
+/******************************************************************************
+ *
+ * Function Name: getSysTICs()
+ *
+ * Description:
+ * This function returns the current syetem time in TICs.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * The current time in TICs as represented by sysTICs
+ *
+ *****************************************************************************/
+u32 getSysTICs(void)
+{
+ return sysTICs;
+}
+
+
+/******************************************************************************
+ *
+ * Function Name: getElapsedSysTICs()
+ *
+ * Description:
+ * This function then returns the difference in TICs between the
+ * given starting time and the current system time.
+ *
+ * Calling Sequence:
+ * The starting time.
+ *
+ * Returns:
+ * The time difference.
+ *
+ *****************************************************************************/
+u32 getElapsedSysTICs( u32 startTime )
+{
+ return ( getSysTICs() - startTime );
+}
+
+
+/******************************************************************************
+ *
+ * Function Name: pause()
+ *
+ * Description:
+ * This function does not return until the specified 'duration' in
+ * TICs has elapsed.
+ *
+ * Calling Sequence:
+ * duration - length of time in TICs to wait before returning
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void pause( u32 duration )
+{
+ u32 startTime = getSysTICs();
+
+ while ( getElapsedSysTICs( startTime ) < duration ) ;
+
+}
+
+
Added: trunk/firmware/arm/str/common/sysTime75x.h
===================================================================
--- trunk/firmware/arm/str/common/sysTime75x.h (rev 0)
+++ trunk/firmware/arm/str/common/sysTime75x.h 2008-02-17 15:47:03 UTC (rev 848)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ *
+ * $RCSfile: sysTime.h,v $
+ * $Revision: 1.2 $
+ *
+ * This module provides the interface definitions for sysTime.c
+ * Copyright 2004, R O SoftWare
+ *
+ * Ported for STR73xF 2006 <ak...@do...>
+ *
+ * No guarantees, warrantees, or promises, implied or otherwise.
+ * May be used for hobby or commercial purposes provided copyright
+ * notice remains intact.
+ *
+ *****************************************************************************/
+#ifndef INC_SYS_TIME_H
+#define INC_SYS_TIME_H
+
+#include "75x_lib.h"
+
+// setup parameters
+#define sysTICSperSEC 1000
+
+// some helpful times for pause()
+#define ONE_MS (u32)(( 1e-3 * sysTICSperSEC) + .5)
+#define TWO_MS (u32)(( 2e-3 * sysTICSperSEC) + .5)
+#define FIVE_MS (u32)(( 5e-3 * sysTICSperSEC) + .5)
+#define TEN_MS (u32)(( 10e-3 * sysTICSperSEC) + .5)
+#define TWENTY_MS (u32)(( 20e-3 * sysTICSperSEC) + .5)
+#define THIRTY_MS (u32)(( 30e-3 * sysTICSperSEC) + .5)
+#define FIFTY_MS (u32)(( 50e-3 * sysTICSperSEC) + .5)
+#define HUNDRED_MS (u32)((100e-3 * sysTICSperSEC) + .5)
+#define ONE_FIFTY_MS (u32)((150e-3 * sysTICSperSEC) + .5)
+#define QUARTER_SEC (u32)((250e-3 * sysTICSperSEC) + .5)
+#define HALF_SEC (u32)((500e-3 * sysTICSperSEC) + .5)
+#define ONE_SEC (u32)(( 1.0 * sysTICSperSEC) + .5)
+#define TWO_SEC (u32)(( 2.0 * sysTICSperSEC) + .5)
+#define FIVE_SEC (u32)(( 5.0 * sysTICSperSEC) + .5)
+#define TEN_SEC (u32)((10.0 * sysTICSperSEC) + .5)
+
+
+/******************************************************************************
+ *
+ * Function Name: initTimebase2()
+ *
+ * Description:
+ * Init. TB2 for 1ms interrupts.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void initTimebase2(void);
+
+/******************************************************************************
+ *
+ * Function Name: getSysTICs()
+ *
+ * Description:
+ * This function returns the current system time in TICs.
+ *
+ * Calling Sequence:
+ * void
+ *
+ * Returns:
+ * The current time in TICs
+ *
+ *****************************************************************************/
+u32 getSysTICs(void);
+
+/******************************************************************************
+ *
+ * Function Name: getElapsedSysTICs()
+ *
+ * Description:
+ * This function then returns the difference in TICs between the
+ * given starting time and the current system time.
+ *
+ * Calling Sequence:
+ * The starting time.
+ *
+ * Returns:
+ * The time difference.
+ *
+ *****************************************************************************/
+u32 getElapsedSysTICs( u32 startTime);
+
+/******************************************************************************
+ *
+ * Function Name: pause()
+ *
+ * Description:
+ * This function does not return until the specified 'duration' in
+ * TICs has elapsed.
+ *
+ * Calling Sequence:
+ * duration - length of time in TICs to wait before returning
+ *
+ * Returns:
+ * void
+ *
+ *****************************************************************************/
+void pause( u32 duration);
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|