#include <StepCounter.h>
#include <GPIO.h>
#include <Timers.h>
#include <InputPin.h>
// derived classes
#include <StepDirectionCounter.h>
#include <QuadratureCounter4X.h>
#include <HallCounter.h>
#include <ClosedLoopCounter.h>
#include <driverlib/interrupt.h>
StepCounter::StepCounter() {
// Serial.println( " StepCounter" );
stepCount = 0; };
StepCounter::~StepCounter() {
#ifdef DebugDelete
Serial.println( " delete StepCounter" );
#endif
};
float
StepCounter::readScaledCount() {
IntMasterDisable();
int32_t counter = stepCount;
stepCount = 0;
IntMasterEnable();
return
scale
* counter; };
void
StepCounter::adjust( int32_t adjustment ) {
stepCount += adjustment; };