From 0f57e7c23cf5e9542992b12edbb279e1b3ac7083 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 9 Oct 2010 14:18:52 +0200 Subject: replace unused PwnFreq IOMap with RegulationTime --- AT91SAM7S256/Source/d_output.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'AT91SAM7S256/Source/d_output.c') diff --git a/AT91SAM7S256/Source/d_output.c b/AT91SAM7S256/Source/d_output.c index 44a43a7..35e426b 100644 --- a/AT91SAM7S256/Source/d_output.c +++ b/AT91SAM7S256/Source/d_output.c @@ -27,7 +27,6 @@ #define REG_MAX_VALUE 100 #define RAMP_TIME_INTERVAL 25 // Measured in 1 mS => 25 mS interval -#define REGULATION_TIME 100 // Measured in 1 mS => 100 mS regulation interval #define RAMPDOWN_STATE_RAMPDOWN 0 #define RAMPDOWN_STATE_CONTINIUE 1 @@ -76,6 +75,7 @@ typedef struct static MOTORDATA MotorData[3]; static SYNCMOTORDATA SyncData; +static UBYTE RegulationTime; void dOutputInit(void) { @@ -157,7 +157,7 @@ void dOutputCtrl(void) pMD->MotorRunState = MOTOR_RUN_STATE_RUNNING; } - if (pMD->RegulationTimeCount > REGULATION_TIME) + if (pMD->RegulationTimeCount > RegulationTime) { pMD->RegulationTimeCount = 0; dOutputRegulateMotor(MotorNr); @@ -272,6 +272,12 @@ void dOutputSetPIDParameters(UBYTE MotorNr, UBYTE NewRegPParameter, UBYTE NewReg pMD->RegDParameter = NewRegDParameter; } +/* Set new regulation time */ +void dOutputSetRegulationTime(UBYTE NewRegulationTime) +{ + RegulationTime = NewRegulationTime; +} + /* Called to set TachoCountToRun which is used for position control for the model */ /* Must be called before motor start */ /* TachoCountToRun is calculated as a signed value */ -- cgit v1.2.3