sync0CycleTime static member of StepGen
This commit is contained in:
@@ -16,7 +16,7 @@ public:
|
||||
volatile double_t requestedPosition;
|
||||
HardwareTimer *MyTim;
|
||||
uint32_t stepsPerMM;
|
||||
uint32_t sync0CycleTime;
|
||||
static uint32_t sync0CycleTime;
|
||||
uint8_t dirPin;
|
||||
uint8_t stepPin;
|
||||
uint8_t timerChan;
|
||||
@@ -27,7 +27,6 @@ public:
|
||||
double actPos();
|
||||
double reqPos();
|
||||
void handleStepper(void);
|
||||
void setCycleTime(uint32_t cycleTime);
|
||||
void makePulses(uint64_t cycleTime /* in usecs */, int32_t pulsesAtEnd /* end position*/);
|
||||
void timerCB();
|
||||
void setScale(int32_t spm);
|
||||
|
||||
@@ -99,3 +99,4 @@ void MyEncoder::setLatch(uint8_t latchEnable)
|
||||
}
|
||||
oldLatchCEnable = latchEnable;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,10 +57,6 @@ void StepGen::handleStepper(void)
|
||||
int32_t pulsesAtEndOfCycle = stepsPerMM * requestedPosition; // From Turner.hal X:5000 Z:2000 ps/mm
|
||||
makePulses(sync0CycleTime, pulsesAtEndOfCycle); // Make the pulses using hardware timer
|
||||
}
|
||||
void StepGen::setCycleTime(uint32_t cycleTime)
|
||||
{
|
||||
sync0CycleTime = cycleTime;
|
||||
}
|
||||
|
||||
void StepGen::makePulses(uint64_t cycleTime /* in usecs */, int32_t pulsesAtEnd /* end position*/)
|
||||
{
|
||||
@@ -134,3 +130,5 @@ void StepGen::setScale(int32_t spm)
|
||||
{
|
||||
stepsPerMM = spm;
|
||||
}
|
||||
|
||||
uint32_t StepGen::sync0CycleTime = 0;
|
||||
@@ -150,6 +150,7 @@ uint16_t dc_checker(void)
|
||||
{
|
||||
// Indicate we run DC
|
||||
ESCvar.dcsync = 0;
|
||||
Step1.setCycleTime(ESC_SYNC0cycletime() / 1000); // nsec to usec
|
||||
//Step1.setCycleTime(ESC_SYNC0cycletime() / 1000); // nsec to usec
|
||||
StepGen::sync0CycleTime = ESC_SYNC0cycletime() / 1000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user