From 8350be64a07b8489076ac2aa4e2977261bb12d7a Mon Sep 17 00:00:00 2001 From: Tim Leuschner Date: Sat, 7 Sep 2019 14:09:44 +0200 Subject: [PATCH] . --- lib/A4988_Stepper/keywords.txt | 2 +- lib/A4988_Stepper/src/A4988_Stepper.cpp | 12 ++++++------ lib/A4988_Stepper/src/A4988_Stepper.h | 4 ++-- sonoff/xdrv_25_A4988_Stepper.ino | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/A4988_Stepper/keywords.txt b/lib/A4988_Stepper/keywords.txt index c799eacc6..c83465c8b 100755 --- a/lib/A4988_Stepper/keywords.txt +++ b/lib/A4988_Stepper/keywords.txt @@ -16,7 +16,7 @@ doMove KEYWORD2 doRotate KEYWORD2 setRPM KEYWORD2 setSPR KEYWORD2 -setMIC KEYWORD2 +setMIS KEYWORD2 version KEYWORD2 ####################################### diff --git a/lib/A4988_Stepper/src/A4988_Stepper.cpp b/lib/A4988_Stepper/src/A4988_Stepper.cpp index 92aabea30..ad83d3e87 100644 --- a/lib/A4988_Stepper/src/A4988_Stepper.cpp +++ b/lib/A4988_Stepper/src/A4988_Stepper.cpp @@ -20,7 +20,7 @@ #include A4988_Stepper::A4988_Stepper( int m_spr , int m_rpm - , short m_mic + , short m_mis , short m_dir_pin , short m_stp_pin , short m_ena_pin @@ -30,7 +30,7 @@ A4988_Stepper::A4988_Stepper( int m_spr last_time = 0; // time stamp in us of the last step taken motor_SPR = m_spr; // StepsPerRevolution motor_RPM = m_rpm; // RoundsPerMinute - motor_MIC = m_mic; // Microsteps w/o effect if MS1-MS3 not connected - then full steps anyway + motor_MIS = m_mis; // Microsteps w/o effect if MS1-MS3 not connected - then full steps anyway motor_dir_pin = m_dir_pin; motor_stp_pin = m_stp_pin; motor_ena_pin = m_ena_pin; @@ -61,7 +61,7 @@ void A4988_Stepper::adjustPins(void) { void A4988_Stepper::adjustMicrosteps() { if ((motor_ms1_pin<99)&&(motor_ms2_pin<99)&&(motor_ms3_pin<99)) { - switch (motor_MIC){ + switch (motor_MIS){ case 1: digitalWrite(motor_ms1_pin, LOW); digitalWrite(motor_ms2_pin, LOW); @@ -100,12 +100,12 @@ void A4988_Stepper::adjustMicrosteps() { motor_delay = 60L * 1000L * 1000L / motor_SPR / motor_RPM / motor_MIC; } -void A4988_Stepper::setMIC(short oneToSixteen) { +void A4988_Stepper::setMIS(short oneToSixteen) { motor_MIC = oneToSixteen; adjustMicrosteps(); } - short A4988_Stepper::getMIC(void) { + short A4988_Stepper::getMIS(void) { return motor_MIC; } @@ -158,7 +158,7 @@ void A4988_Stepper::doMove(long howManySteps) void A4988_Stepper::doRotate(long howManyDegrees) { long lSteps = 0; - lSteps = motor_SPR*motor_MIC*howManyDegrees/360; + lSteps = motor_SPR*motor_MIS*howManyDegrees/360; doMove(lSteps); } diff --git a/lib/A4988_Stepper/src/A4988_Stepper.h b/lib/A4988_Stepper/src/A4988_Stepper.h index 0bf9d3f81..b3aa27c35 100644 --- a/lib/A4988_Stepper/src/A4988_Stepper.h +++ b/lib/A4988_Stepper/src/A4988_Stepper.h @@ -35,8 +35,8 @@ class A4988_Stepper { void setRPM (int whatRPM ); int getRPM (void ); - void setMIC (short OneToSixteen); - short getMIC (void ); + void setMIS (short OneToSixteen); + short getMIS (void ); void setSPR (int howMany ); int getSPR (void ); diff --git a/sonoff/xdrv_25_A4988_Stepper.ino b/sonoff/xdrv_25_A4988_Stepper.ino index ddbe0a1fa..e1b6ebb75 100644 --- a/sonoff/xdrv_25_A4988_Stepper.ino +++ b/sonoff/xdrv_25_A4988_Stepper.ino @@ -52,11 +52,11 @@ void A4988Init(void) A4988_ms3_pin = pin[GPIO_A4988_MS3]; A4988_spr = 200; A4988_rpm = 30; - A4988_mic = 1; + A4988_mis = 1; myA4988 = new A4988_Stepper( A4988_spr , A4988_rpm - , A4988_mic + , A4988_mis , A4988_dir_pin , A4988_stp_pin , A4988_ena_pin @@ -65,7 +65,7 @@ void A4988Init(void) , A4988_ms3_pin ); A4988_spr = myA4988->getSPR(); A4988_rpm = myA4988->getRPM(); - A4988_mic = myA4988->getMIC(); + A4988_mis = myA4988->getMIS(); if ((A4988_ms1_pin < 99)&&(A4988_ms2_pin < 99)&&(A4988_ms3_pin < 99)&&(A4988_ena_pin<99)) { AddLog_P2(LOG_LEVEL_INFO, PSTR("STP: A4988-Driver initialized (%dSPR, %dRPM,%dMIC). Pins: Dir[%d] Stp[%d] Ena[%d] MS1[%d] MS2[%d] MS3[%d]"),A4988_spr, A4988_rpm, A4988_mic, A4988_dir_pin,A4988_stp_pin,A4988_ena_pin,A4988_ms1_pin,A4988_ms2_pin,A4988_ms3_pin); } else { @@ -229,7 +229,7 @@ void CmndSetSPR(void) ResponseCmndDone(); } -void CmndSetMic(void) +void CmndSetMIS(void) { if ((pin[GPIO_A4988_MS1] < 99) && (pin[GPIO_A4988_MS2] < 99) && (pin[GPIO_A4988_MS3] < 99)) { short micPlease = 1;