Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2017-04-07 15:16:34 +0300
committerDavid Crocker <dcrocker@eschertech.com>2017-04-07 15:24:27 +0300
commit3eb8bac31d2be166e20204c4e1457a1104ad95c9 (patch)
tree6240ad6726da4cdcdeba9969067000fcc17db87c /src
parent1be6e8d7d89699b4eeb7614c94a7f0757297a755 (diff)
Version 1.18
Updated driver to support our new VID/PID and also the Bossa port Fixed issue with IP addresses containing zetos on Duet 06/085 Improved error mesages when M303 command has out-of-range parameters Don't generate error message when the chopper control register is changed, and allow it to be read back Increased max motor current to 2.4A
Diffstat (limited to 'src')
-rw-r--r--src/Duet/Network.cpp150
-rw-r--r--src/Duet/Network.h5
-rw-r--r--src/DuetNG/DuetWiFi/Network.cpp12
-rw-r--r--src/DuetNG/TMC2660.cpp52
-rw-r--r--src/DuetNG/TMC2660.h2
-rw-r--r--src/GCodes/GCodes.cpp10
-rw-r--r--src/GCodes/GCodes2.cpp30
-rw-r--r--src/Platform.cpp10
-rw-r--r--src/Platform.h4
-rw-r--r--src/RepRap.cpp13
-rw-r--r--src/Version.h4
11 files changed, 174 insertions, 118 deletions
diff --git a/src/Duet/Network.cpp b/src/Duet/Network.cpp
index afdeab89..dffd75cf 100644
--- a/src/Duet/Network.cpp
+++ b/src/Duet/Network.cpp
@@ -123,7 +123,9 @@ extern "C"
bool LockLWIP()
{
if (lwipLocked)
+ {
return false;
+ }
lwipLocked = true;
return true;
@@ -136,23 +138,6 @@ void UnlockLWIP()
// Callback functions for the EMAC driver and for LwIP
-// Callback to report when the network interface has gone up or down.
-// Note that this is only a rough indicator and may not be called when
-// the IP address is changed on-the-fly!
-static void ethernet_status_callback(struct netif *netif)
-{
- if (netif_is_up(netif))
- {
- char ip[16];
- ipaddr_ntoa_r(&(netif->ip_addr), ip, sizeof(ip));
- reprap.GetPlatform()->MessageF(HOST_MESSAGE, "Network up, IP=%s\n", ip);
- }
- else
- {
- reprap.GetPlatform()->Message(HOST_MESSAGE, "Network down\n");
- }
-}
-
// Called from ISR
static void ethernet_rx_callback(uint32_t ul_status)
{
@@ -250,10 +235,10 @@ static err_t conn_accept(void *arg, tcp_pcb *pcb, err_t err)
if (targetPcb != nullptr)
{
// Allocate a new ConnectionState for this connection
- ConnectionState *cs = reprap.GetNetwork()->ConnectionAccepted(pcb);
+ ConnectionState * const cs = reprap.GetNetwork()->ConnectionAccepted(pcb);
if (cs != nullptr)
{
- tcp_accepted(targetPcb);
+ tcp_accepted(targetPcb); // keep the listening PCB running
tcp_arg(pcb, cs); // tell LWIP that this is the structure we wish to be passed for our callbacks
tcp_recv(pcb, conn_recv); // tell LWIP that we wish to be informed of incoming data by a call to the conn_recv() function
tcp_err(pcb, conn_err);
@@ -273,7 +258,7 @@ static err_t conn_accept(void *arg, tcp_pcb *pcb, err_t err)
Network::Network(Platform* p) :
platform(p), freeTransactions(nullptr), readyTransactions(nullptr), writingTransactions(nullptr),
- state(NotStarted), isEnabled(true), resetCallback(false),
+ state(NotStarted), isEnabled(true), activated(false), resetCallback(false),
dataCs(nullptr), ftpCs(nullptr), telnetCs(nullptr), freeConnections(nullptr)
{
}
@@ -412,34 +397,34 @@ void Network::Spin(bool full)
{
if (LockLWIP()) // basically we can't do anything if we can't interact with LWIP
{
- if (state == NetworkObtainingIP || state == NetworkActive)
+ if (full)
{
- // Is the link still up?
- if (!ethernet_link_established())
+ if (state == NetworkObtainingIP || state == NetworkActive)
{
- state = NetworkEstablishingLink;
- UnlockLWIP();
+ // Is the link still up?
+ if (!ethernet_link_established())
+ {
+ state = NetworkEstablishingLink;
+ UnlockLWIP();
- platform->ClassReport(longWait);
- return;
- }
+ reprap.GetPlatform()->Message(HOST_MESSAGE, "Network down\n");
+ platform->ClassReport(longWait);
+ return;
+ }
- // See if we can read any packets. They may include DHCP responses too
- ethernet_task();
- if (resetCallback)
- {
- resetCallback = false;
- ethernet_set_rx_callback(&ethernet_rx_callback);
- }
+ // See if we can read any packets. They may include DHCP responses too
+ ethernet_task();
+ if (resetCallback)
+ {
+ resetCallback = false;
+ ethernet_set_rx_callback(&ethernet_rx_callback);
+ }
- // See if we can send anything - only if full spin i.e. not in the middle of file i/o
- if (full)
- {
// Have we obtained a valid IP address yet?
if (state == NetworkObtainingIP)
{
const uint8_t * const ip = ethernet_get_ipaddress();
- if (ip[0] != 0 && ip[1] != 0 && ip[2] != 0 && ip[3] != 0)
+ if (ip[0] != 0 || ip[1] != 0 || ip[2] != 0 || ip[3] != 0)
{
// Yes - we're good to go now
state = NetworkActive;
@@ -452,9 +437,14 @@ void Network::Spin(bool full)
}
}
- // Send mDNS announcement so that some routers can perform hostname mapping
- // if the board is connected via a non-IGMP capable WiFi bridge (like the TP-Link WR701N)
+ // Send mDNS announcement so that some routers can perform hostname mapping if the board is
+ // connected via a non-IGMP capable WiFi bridge (like the TP-Link WR701N)
DoMdnsAnnounce();
+
+ UnlockLWIP();
+ reprap.GetPlatform()->MessageF(HOST_MESSAGE, "Network up, IP=%d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]);
+ platform->ClassReport(longWait);
+ return;
}
}
@@ -486,19 +476,24 @@ void Network::Spin(bool full)
}
}
}
- }
- else if (state == NetworkEstablishingLink && ethernet_establish_link())
- {
- if (!ethernetStarted)
- {
- start_ethernet(platform->GetIPAddress(), platform->NetMask(), platform->GateWay(), &ethernet_status_callback);
- ethernetStarted = true;
- }
- else
+ else if (state == NetworkEstablishingLink && ethernet_establish_link())
{
- ethernet_set_configuration(platform->GetIPAddress(), platform->NetMask(), platform->GateWay());
+ if (!ethernetStarted)
+ {
+ start_ethernet(platform->GetIPAddress(), platform->NetMask(), platform->GateWay(), NULL);
+ ethernetStarted = true;
+ }
+ else
+ {
+ ethernet_set_configuration(platform->GetIPAddress(), platform->NetMask(), platform->GateWay());
+ }
+ state = NetworkObtainingIP;
}
- state = NetworkObtainingIP;
+ }
+ else
+ {
+ // We have been called while waiting for an SD transfer to complete. Just See if we can read any packets.
+ ethernet_task();
}
UnlockLWIP();
@@ -537,6 +532,9 @@ void Network::Diagnostics(MessageType mtype)
}
platform->MessageF(mtype, "Free transactions: %d of %d\n", numFreeTransactions, NETWORK_TRANSACTION_COUNT);
+ // Extra debug to help track down the problems a few people are having
+ platform->MessageF(mtype, "Locked: %d, state: %d, listening: %p, %p, %p\n", (int)lwipLocked, (int)state, pcbs[0], pcbs[1], pcbs[2]);
+
#if LWIP_STATS
// Normally we should NOT try to display LWIP stats here, because it uses debugPrintf(), which will hang the system if no USB cable is connected.
if (reprap.Debug(moduleNetwork))
@@ -633,15 +631,18 @@ void Network::ConnectionClosed(ConnectionState* cs, bool closeConnection)
// Remove all callbacks and close the PCB if requested
tcp_pcb *pcb = cs->pcb;
- tcp_sent(pcb, nullptr);
- tcp_recv(pcb, nullptr);
- tcp_poll(pcb, nullptr, TCP_WRITE_TIMEOUT / TCP_SLOW_INTERVAL / TCP_MAX_SEND_RETRIES);
- if (pcb != nullptr && closeConnection)
+ if (pcb != nullptr)
{
- tcp_err(pcb, nullptr);
- tcp_close(pcb);
+ tcp_sent(pcb, nullptr);
+ tcp_recv(pcb, nullptr);
+ tcp_poll(pcb, nullptr, TCP_WRITE_TIMEOUT / TCP_SLOW_INTERVAL / TCP_MAX_SEND_RETRIES);
+ if (closeConnection)
+ {
+ tcp_err(pcb, nullptr);
+ tcp_close(pcb);
+ }
+ cs->pcb = nullptr;
}
- cs->pcb = nullptr;
// Inform the Webserver that we are about to remove an existing connection
reprap.GetWebserver()->ConnectionLost(cs);
@@ -804,6 +805,33 @@ void Network::SetHostname(const char *name)
void Network::Enable()
{
+ isEnabled = true;
+ if (activated)
+ {
+ Start();
+ }
+}
+
+void Network::Disable()
+{
+ isEnabled = false;
+ if (activated)
+ {
+ Stop();
+ }
+}
+
+void Network::Activate()
+{
+ activated = true;
+ if (isEnabled)
+ {
+ Start();
+ }
+}
+
+void Network::Start()
+{
if (state == NotStarted)
{
// Allow the MAC address to be set only before LwIP is started...
@@ -816,11 +844,10 @@ void Network::Enable()
{
resetCallback = true; // reset EMAC RX callback on next Spin calls
state = NetworkEstablishingLink;
- isEnabled = true;
}
}
-void Network::Disable()
+void Network::Stop()
{
if (state != NotStarted && state != NetworkInactive)
{
@@ -831,7 +858,6 @@ void Network::Disable()
resetCallback = false;
ethernet_set_rx_callback(nullptr);
state = NetworkInactive;
- isEnabled = false;
}
}
diff --git a/src/Duet/Network.h b/src/Duet/Network.h
index 045beb68..9cc177fa 100644
--- a/src/Duet/Network.h
+++ b/src/Duet/Network.h
@@ -79,6 +79,7 @@ public:
void Enable();
void Disable();
bool IsEnabled() const { return isEnabled; }
+ void Activate();
// Interfaces for the Webserver
@@ -116,6 +117,9 @@ private:
void PrependTransaction(NetworkTransaction* volatile * list, NetworkTransaction *r);
bool AcquireTransaction(ConnectionState *cs);
+ void Start();
+ void Stop();
+
void StartProtocol(size_t protocol)
pre(protocol < NumProtocols; state == NetworkActive);
@@ -134,6 +138,7 @@ private:
enum { NotStarted, NetworkInactive, NetworkEstablishingLink, NetworkObtainingIP, NetworkActive } state;
bool isEnabled;
+ bool activated;
volatile bool resetCallback;
char hostname[16]; // Limit DHCP hostname to 15 characters + terminating 0
diff --git a/src/DuetNG/DuetWiFi/Network.cpp b/src/DuetNG/DuetWiFi/Network.cpp
index e15d0ec0..0028cbc0 100644
--- a/src/DuetNG/DuetWiFi/Network.cpp
+++ b/src/DuetNG/DuetWiFi/Network.cpp
@@ -471,6 +471,18 @@ void Network::ProcessIncomingData(TransactionBuffer &buf)
// 16 chars of WiFi firmware version
// 64 chars of host name, null terminated
// 32 chars of ssid (either ssid we are connected to or our own AP name), null terminated
+
+ // Format 2:
+ // 4 bytes of IP address
+ // 4 bytes of free heap
+ // 4 bytes of reset reason
+ // 4 bytes of flash chip size
+ // 4 bytes of RSSI (added for info version 2)
+ // 2 bytes of operating state (1 = client, 2 = access point)
+ // 2 bytes of ESP8266 Vcc according to its ADC
+ // 16 chars of WiFi firmware version
+ // 64 chars of host name, null terminated
+ // 32 chars of ssid (either ssid we are connected to or our own AP name), null terminated
{
TransactionBufferReader reader(buf);
uint32_t infoVersion = reader.GetPrimitive<uint32_t>();
diff --git a/src/DuetNG/TMC2660.cpp b/src/DuetNG/TMC2660.cpp
index f9a5220c..fb0c9477 100644
--- a/src/DuetNG/TMC2660.cpp
+++ b/src/DuetNG/TMC2660.cpp
@@ -8,7 +8,7 @@
#include "RepRapFirmware.h"
#include "TMC2660.h"
-const float MaximumMotorCurrent = 2500.0;
+const float MaximumMotorCurrent = 2400.0;
static size_t numTmc2660Drivers;
@@ -20,6 +20,8 @@ const Pin DriversMosiPin = 22; // PA13
const Pin DriversMisoPin = 21; // PA22
const Pin DriversSclkPin = 23; // PA23
+const int ChopperControlRegisterMode = 999; // mode passed to get/set microstepping to indicate we want the chopper control register
+
#define USART_EXT_DRV USART1
#define ID_USART_EXT_DRV ID_USART1
#define TMC_CLOCK_TC TC0
@@ -105,15 +107,15 @@ const uint32_t TMC_SMARTEN_SEIMIN_QTR = 1 << 15;
const unsigned int NumWriteRegisters = 5;
// Chopper control register defaults
+// 0x901B4 as per datasheet example
+// CHM bit not set, so uses spread cycle mode
const uint32_t defaultChopConfReg =
TMC_REG_CHOPCONF
- | TMC_CHOPCONF_TBL(2)
- | TMC_CHOPCONF_HDEC(0)
- | TMC_CHOPCONF_HEND(3)
- | TMC_CHOPCONF_HSTRT(3)
- | TMC_CHOPCONF_TOFF(0); // 0x901B4 as per datasheet example except TOFF set to zero to disable driver
-
-const uint32_t defaultChopConfToff = 4; // default value for TOFF when drive is enabled
+ | TMC_CHOPCONF_TBL(2) // blanking time 36 clocks which is about 2.4us typical (should maybe use 16 or 24 instead?)
+ | TMC_CHOPCONF_HDEC(0) // no hysteresis decrement
+ | TMC_CHOPCONF_HEND(3) // HEND = 0
+ | TMC_CHOPCONF_HSTRT(3) // HSTRT = 4
+ | TMC_CHOPCONF_TOFF(4); // TOFF = 9.2us
// StallGuard configuration register
const uint32_t defaultSgscConfReg =
@@ -149,6 +151,7 @@ struct TmcDriverState
uint32_t drvConfReg;
uint32_t lastReadValue;
uint32_t pin;
+ uint32_t configuredChopConfReg;
void Init(uint32_t p_pin);
void WriteAll();
@@ -165,7 +168,8 @@ void TmcDriverState::Init(uint32_t p_pin)
pre(!driversPowered)
{
drvCtrlReg = defaultDrvCtrlReg;
- chopConfReg = defaultChopConfReg;
+ configuredChopConfReg = defaultChopConfReg;
+ chopConfReg = configuredChopConfReg & ~TMC_CHOPCONF_TOFF_MASK; // disable driver at startup
smartEnReg = defaultSmartEnReg;
sgcsConfReg = defaultSgscConfReg;
drvConfReg = defaultDrvConfReg;
@@ -216,8 +220,8 @@ void TmcDriverState::WriteAll()
// Set the chopper control register
void TmcDriverState::SetChopConf(uint32_t newVal)
{
- chopConfReg = (newVal & 0x0001FFFF) | TMC_REG_CHOPCONF;
- SpiSendWord(chopConfReg);
+ configuredChopConfReg = (newVal & 0x0001FFFF) | TMC_REG_CHOPCONF; // save the new value
+ Enable((chopConfReg & TMC_CHOPCONF_TOFF_MASK) != 0); // send the new value, keeping the current Enable status
}
// Set the microstepping and microstep interpolation
@@ -251,14 +255,10 @@ void TmcDriverState::SetCurrent(float current)
SpiSendWord(sgcsConfReg);
}
-// Enable or disable the driver
+// Enable or disable the driver. Also called from SetChopConf after the chopper control configuration has been changed.
void TmcDriverState::Enable(bool en)
{
- chopConfReg &= ~TMC_CHOPCONF_TOFF_MASK;
- if (en)
- {
- chopConfReg |= TMC_CHOPCONF_TOFF(defaultChopConfToff);
- }
+ chopConfReg = (en) ? configuredChopConfReg : (configuredChopConfReg & ~TMC_CHOPCONF_TOFF_MASK);
SpiSendWord(chopConfReg);
}
@@ -359,13 +359,15 @@ namespace TMC2660
return (drive < numTmc2660Drivers) ? driverStates[drive].ReadStatus() : 0;
}
+ // Set microstepping or chopper control register
bool SetMicrostepping(size_t drive, int microsteps, int mode)
{
if (drive < numTmc2660Drivers)
{
- if (mode == 999 && microsteps >= 0)
+ if (mode == ChopperControlRegisterMode && microsteps >= 0)
{
driverStates[drive].SetChopConf((uint32_t)microsteps); // set the chopper control register
+ return true;
}
else if (microsteps > 0 && (mode == 0 || mode == 1))
{
@@ -387,14 +389,22 @@ namespace TMC2660
return false;
}
- unsigned int GetMicrostepping(size_t drive, bool& interpolation)
+ // Get microstepping or chopper control register
+ unsigned int GetMicrostepping(size_t drive, int mode, bool& interpolation)
{
if (drive < numTmc2660Drivers)
{
const uint32_t drvCtrl = driverStates[drive].drvCtrlReg;
interpolation = (drvCtrl & TMC_DRVCTRL_INTPOL) != 0;
- const uint32_t mresBits = (drvCtrl & TMC_DRVCTRL_MRES_MASK) >> TMC_DRVCTRL_MRES_SHIFT;
- return 256 >> mresBits;
+ if (mode == ChopperControlRegisterMode)
+ {
+ return driverStates[drive].configuredChopConfReg & TMC_DATA_MASK;
+ }
+ else
+ {
+ const uint32_t mresBits = (drvCtrl & TMC_DRVCTRL_MRES_MASK) >> TMC_DRVCTRL_MRES_SHIFT;
+ return 256 >> mresBits;
+ }
}
return 1;
}
diff --git a/src/DuetNG/TMC2660.h b/src/DuetNG/TMC2660.h
index 8fcb267b..5284789b 100644
--- a/src/DuetNG/TMC2660.h
+++ b/src/DuetNG/TMC2660.h
@@ -27,7 +27,7 @@ namespace TMC2660
void EnableDrive(size_t drive, bool en);
uint32_t GetStatus(size_t drive);
bool SetMicrostepping(size_t drive, int microsteps, int mode);
- unsigned int GetMicrostepping(size_t drive, bool& interpolation);
+ unsigned int GetMicrostepping(size_t drive, int mode, bool& interpolation);
void SetDriversPowered(bool powered);
};
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp
index 3e12f83c..3fa3d468 100644
--- a/src/GCodes/GCodes.cpp
+++ b/src/GCodes/GCodes.cpp
@@ -1316,6 +1316,14 @@ int GCodes::SetUpMove(GCodeBuffer& gb, StringRef& reply)
moveBuffer.filePos = (&gb == fileGCode) ? gb.MachineState().fileState.GetPosition() - fileInput->BytesCached() : noFilePosition;
moveBuffer.canPauseAfter = (moveBuffer.endStopsToCheck == 0);
//debugPrintf("Queue move pos %u\n", moveFilePos);
+#if 0
+ //temporary code to use 0.5mm segments
+ if (moveBuffer.moveType == 0)
+ {
+ const float length = sqrtf(fsquare(moveBuffer.coords[X_AXIS] - moveBuffer.initialCoords[X_AXIS]) + fsquare(moveBuffer.coords[Y_AXIS] - moveBuffer.initialCoords[Y_AXIS]));
+ segmentsLeft = max<unsigned int>(segmentsLeft, length/0.5);
+ }
+#endif
}
}
return (moveBuffer.moveType != 0 || moveBuffer.endStopsToCheck != 0) ? 2 : 1;
@@ -2866,7 +2874,7 @@ void GCodes::SetMACAddress(GCodeBuffer& gb)
bool GCodes::ChangeMicrostepping(size_t drive, int microsteps, int mode) const
{
bool dummy;
- unsigned int oldSteps = platform->GetMicrostepping(drive, dummy);
+ unsigned int oldSteps = platform->GetMicrostepping(drive, mode, dummy);
bool success = platform->SetMicrostepping(drive, microsteps, mode);
if (success && mode <= 1) // modes higher than 1 are used for special functions
{
diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp
index d801de2b..0d35b7fe 100644
--- a/src/GCodes/GCodes2.cpp
+++ b/src/GCodes/GCodes2.cpp
@@ -1875,13 +1875,21 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
: heater == reprap.GetHeat()->GetChamberHeater() ? 50.0
: 200.0;
const float maxPwm = (gb.Seen('P')) ? gb.GetFValue() : 1.0;
- if (heater >= 0 && heater < HEATERS && maxPwm >= 0.1 && maxPwm <= 1.0 && temperature <= reprap.GetHeat()->GetTemperatureLimit(heater))
+ if (heater < 0 || heater >= HEATERS)
{
- reprap.GetHeat()->StartAutoTune(heater, temperature, maxPwm, reply);
+ reply.copy("Bad heater number in M303 command");
+ }
+ else if (temperature >= reprap.GetHeat()->GetTemperatureLimit(heater))
+ {
+ reply.copy("Target temperature must be below temperature limit for this heater");
+ }
+ else if (maxPwm < 0.1 || maxPwm > 1.0)
+ {
+ reply.copy("Invalid PWM in M303 command");
}
else
{
- reply.printf("Bad parameter in M303 command");
+ reprap.GetHeat()->StartAutoTune(heater, temperature, maxPwm, reply);
}
}
else
@@ -1958,9 +1966,9 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
case 350: // Set/report microstepping
{
// interp is currently an int not a bool, because we use special values of interp to set the chopper control register
- int32_t interp = 0;
+ int32_t mode = 0; // this is usually the interpolation rwquested (0 = off, 1 = on)
bool dummy;
- gb.TryGetIValue('I', interp, dummy);
+ gb.TryGetIValue('I', mode, dummy);
bool seen = false;
for (size_t axis = 0; axis < numAxes; axis++)
@@ -1973,14 +1981,14 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
}
seen = true;
const int microsteps = gb.GetIValue();
- if (ChangeMicrostepping(axis, microsteps, interp))
+ if (ChangeMicrostepping(axis, microsteps, mode))
{
SetAxisNotHomed(axis);
}
else
{
platform->MessageF(GENERIC_MESSAGE, "Drive %c does not support %dx microstepping%s\n",
- axisLetters[axis], microsteps, (interp) ? " with interpolation" : "");
+ axisLetters[axis], microsteps, (mode) ? " with interpolation" : "");
}
}
}
@@ -1997,10 +2005,10 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
gb.GetLongArray(eVals, eCount);
for (size_t e = 0; e < eCount; e++)
{
- if (!ChangeMicrostepping(numAxes + e, (int)eVals[e], interp))
+ if (!ChangeMicrostepping(numAxes + e, (int)eVals[e], mode))
{
platform->MessageF(GENERIC_MESSAGE, "Drive E%u does not support %dx microstepping%s\n",
- e, (int)eVals[e], (interp) ? " with interpolation" : "");
+ e, (int)eVals[e], (mode) ? " with interpolation" : "");
}
}
}
@@ -2011,14 +2019,14 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
for (size_t axis = 0; axis < numAxes; ++axis)
{
bool interp;
- const int microsteps = platform->GetMicrostepping(axis, interp);
+ const int microsteps = platform->GetMicrostepping(axis, mode, interp);
reply.catf("%c:%d%s, ", axisLetters[axis], microsteps, (interp) ? "(on)" : "");
}
reply.cat("E");
for (size_t extruder = 0; extruder < numExtruders; extruder++)
{
bool interp;
- const int microsteps = platform->GetMicrostepping(extruder + numAxes, interp);
+ const int microsteps = platform->GetMicrostepping(extruder + numAxes, mode, interp);
reply.catf(":%d%s", microsteps, (interp) ? "(on)" : "");
}
}
diff --git a/src/Platform.cpp b/src/Platform.cpp
index da7afa52..a64bd26a 100644
--- a/src/Platform.cpp
+++ b/src/Platform.cpp
@@ -2219,12 +2219,12 @@ bool Platform::SetMicrostepping(size_t drive, int microsteps, int mode)
}
// Get the microstepping for a driver
-unsigned int Platform::GetDriverMicrostepping(size_t driver, bool& interpolation) const
+unsigned int Platform::GetDriverMicrostepping(size_t driver, int mode, bool& interpolation) const
{
#if defined(DUET_NG)
if (driver < numTMC2660Drivers)
{
- return TMC2660::GetMicrostepping(driver, interpolation);
+ return TMC2660::GetMicrostepping(driver, mode, interpolation);
}
#endif
// On-board drivers only support x16 microstepping without interpolation
@@ -2233,16 +2233,16 @@ unsigned int Platform::GetDriverMicrostepping(size_t driver, bool& interpolation
}
// Get the microstepping for an axis or extruder
-unsigned int Platform::GetMicrostepping(size_t drive, bool& interpolation) const
+unsigned int Platform::GetMicrostepping(size_t drive, int mode, bool& interpolation) const
{
const size_t numAxes = reprap.GetGCodes()->GetNumAxes();
if (drive < numAxes)
{
- return GetDriverMicrostepping(axisDrivers[drive].driverNumbers[0], interpolation);
+ return GetDriverMicrostepping(axisDrivers[drive].driverNumbers[0], mode, interpolation);
}
else if (drive < DRIVES)
{
- return GetDriverMicrostepping(extruderDrivers[drive - numAxes], interpolation);
+ return GetDriverMicrostepping(extruderDrivers[drive - numAxes], mode, interpolation);
}
else
{
diff --git a/src/Platform.h b/src/Platform.h
index de7a4363..d8a21ff5 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -407,9 +407,9 @@ public:
float GetIdleCurrentFactor() const
{ return idleCurrentFactor; }
bool SetDriverMicrostepping(size_t driver, int microsteps, int mode);
- unsigned int GetDriverMicrostepping(size_t drive, bool& interpolation) const;
+ unsigned int GetDriverMicrostepping(size_t drive, int mode, bool& interpolation) const;
bool SetMicrostepping(size_t drive, int microsteps, int mode);
- unsigned int GetMicrostepping(size_t drive, bool& interpolation) const;
+ unsigned int GetMicrostepping(size_t drive, int mode, bool& interpolation) const;
void SetDriverStepTiming(size_t driver, float microseconds);
float GetDriverStepTiming(size_t driver) const;
float DriveStepsPerUnit(size_t drive) const;
diff --git a/src/RepRap.cpp b/src/RepRap.cpp
index 883d86fe..0c7f7cea 100644
--- a/src/RepRap.cpp
+++ b/src/RepRap.cpp
@@ -97,24 +97,11 @@ void RepRap::Init()
processingConfig = false;
// Enable network (unless it's disabled)
-#ifdef DUET_NG
network->Activate(); // Need to do this here, as the configuration GCodes may set IP address etc.
if (!network->IsEnabled())
{
platform->Message(HOST_MESSAGE, "Network disabled.\n");
}
-#else
- if (network->IsEnabled())
- {
- // Need to do this here, as the configuration GCodes may set IP address etc.
- platform->Message(HOST_MESSAGE, "Starting network...\n");
- network->Enable();
- }
- else
- {
- platform->Message(HOST_MESSAGE, "Network disabled.\n");
- }
-#endif
#ifndef __RADDS__
hsmci_set_idle_func(hsmciIdle);
diff --git a/src/Version.h b/src/Version.h
index 2da9876f..0bd1fcff 100644
--- a/src/Version.h
+++ b/src/Version.h
@@ -9,11 +9,11 @@
#define SRC_VERSION_H_
#ifndef VERSION
-# define VERSION "1.18RC2"
+# define VERSION "1.18"
#endif
#ifndef DATE
-# define DATE "2017-04-01"
+# define DATE "2017-04-07"
#endif
#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman"