Make position setable
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 13 May 2017 18:46:08 +0000 (11:46 -0700)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 13 May 2017 18:46:08 +0000 (11:46 -0700)
avr/Makefile
avr/src/varcb.c
avr/src/vars.def

index f9abce2a798f05ddf88e3650e3499d8733ecf90f..3a1ea999989a78084ff25286993ff52829cc3ac5 100644 (file)
@@ -55,7 +55,11 @@ BOOT_OBJ := $(patsubst src/%.S,build/%.o,$(BOOT_OBJ))
 BOOT_LDFLAGS = $(LDFLAGS) -Wl,--section-start=.text=0x030000
 
 # Build
-all: $(PROJECT).hex build/vars.json boot size
+all:
+       @$(MAKE) $(PROJECT).hex
+       @$(MAKE) build/vars.json
+       @$(MAKE) boot
+       @$(MAKE) size
 
 boot: boot.hex boot-size
 
index 81669033e50228e4244526a04b5a47fa42e3e8fd..cb3a076166fce8b1df29cc3b6975d34b0d2e36ee 100644 (file)
 #include "plan/state.h"
 
 // Axis
-float get_position(int index) {return mp_runtime_get_axis_position(index);}
+float get_position(int axis) {return mp_runtime_get_axis_position(axis);}
+
+
+void set_position(int axis, float position) {
+  mach_set_axis_position(axis, position);
+}
+
 
 // GCode
 int32_t get_line() {return mp_runtime_get_line();}
index f27eca74d1a293d5609aa301cfedf2c420830fcd..763d5d2746979abb325d10428f2797c61c1d4287 100644 (file)
@@ -68,7 +68,7 @@ VAR(latch_backoff,  lb, float,    MOTORS, 1, 1, "Homing latch backoff")
 VAR(zero_backoff,   zb, float,    MOTORS, 1, 1, "Homing zero backoff")
 
 // Axis
-VAR(position,        p, float,    AXES,   0, 1, "Current axis position")
+VAR(position,        p, float,    AXES,   1, 1, "Current axis position")
 
 // Spindle
 VAR(spindle_type,   st, uint8_t,  0,      1, 1, "PWM=0 or HUANYANG=1")