PushToGo on STM32F429-Disco Board

Dependencies:   BSP_DISCO_F429ZI LCD_DISCO_F429ZI pushtogo usb

Revision:
1:64c1fd738059
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AdaptiveAxis.cpp	Sun Sep 09 19:03:27 2018 +0000
@@ -0,0 +1,45 @@
+/*
+ * AdaptiveAxis.cpp
+ *
+ *  Created on: 2018Äê2ÔÂ24ÈÕ
+ *      Author: caoyuan9642
+ */
+
+#include <AdaptiveAxis.h>
+
+void AdaptiveAxis::slew_mode()
+{
+	this->stepper->poweron();
+	this->stepper->setMicroStep(
+			TelescopeConfiguration::getInt("microstep_slew"));
+	this->stepper->setCurrent(
+			TelescopeConfiguration::getDouble("current_slew"));
+}
+
+void AdaptiveAxis::track_mode()
+{
+	this->stepper->poweron();
+	this->stepper->setMicroStep(
+			TelescopeConfiguration::getInt("microstep_track"));
+	this->stepper->setCurrent(
+			TelescopeConfiguration::getDouble("current_track"));
+}
+
+void AdaptiveAxis::correction_mode()
+{
+	this->stepper->poweron();
+	this->stepper->setMicroStep(
+			TelescopeConfiguration::getInt("microstep_correction"));
+	this->stepper->setCurrent(
+			TelescopeConfiguration::getDouble("current_correction"));
+}
+
+void AdaptiveAxis::idle_mode()
+{
+	double idle_current = TelescopeConfiguration::getDouble("current_idle");
+	if (idle_current != 0)
+		this->stepper->setCurrent(idle_current);
+	else
+		this->stepper->poweroff();
+}
+