Merge branch 'master' of https://github.com/FarmBot/farmbot-arduino-firmware
commit
46aadd43c0
|
@ -3,6 +3,7 @@
|
|||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
*.d
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
|
@ -34,3 +35,5 @@
|
|||
# Setting files
|
||||
Debug.h
|
||||
/__vm
|
||||
_build
|
||||
bin
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)$(filter $(subst *,%,$2),$d))
|
||||
|
||||
BUILD_DIR ?= $(shell pwd)/_build
|
||||
BIN_DIR ?= $(shell pwd)/bin
|
||||
FBARDUINO_FIRMWARE_SRC_DIR ?= src
|
||||
FBARDUINO_FIRMWARE_BUILD_DIR ?= $(BUILD_DIR)/sketch
|
||||
FBARDUINO_FIRMWARE_LIB_BUILD_DIR ?= $(BUILD_DIR)/libraries
|
||||
|
||||
ARDUINO_INSTALL_DIR ?= $(HOME)/arduino-1.8.5
|
||||
|
||||
# Files to be tracked for make to know to rebuild.
|
||||
CXX_SRC := $(wildcard $(FBARDUINO_FIRMWARE_SRC_DIR)/*.cpp)
|
||||
SRC := $(CXX_SRC)
|
||||
SRC_DEPS := $(SRC) $(wildcard $(FBARDUINO_FIRMWARE_SRC_DIR)/*.h)
|
||||
|
||||
# Object files and Dependency files That will eventually be built.
|
||||
CXX_OBJ := $(CXX_SRC:.cpp=.o)
|
||||
|
||||
## Commands needed to compile and whatnot.
|
||||
CXX := $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/bin/avr-g++
|
||||
CC := $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/bin/avr-gcc
|
||||
AR := $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/bin/avr-gcc-ar
|
||||
OBJ_COPY := $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/bin/avr-objcopy
|
||||
MKDIR_P := mkdir -p
|
||||
|
||||
CXX_FLAGS := -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10600 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR
|
||||
CFLAGS := -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
## Dependencies
|
||||
include lib/core.Makefile
|
||||
include lib/SPI.Makefile
|
||||
include lib/Servo.Makefile
|
||||
include lib/EEPROM.Makefile
|
||||
|
||||
# Targets
|
||||
include lib/targets/ramps_v14.Makefile
|
||||
include lib/targets/farmduino_v10.Makefile
|
||||
include lib/targets/farmduino_k14.Makefile
|
||||
|
||||
.PHONY: all clean \
|
||||
dep_core dep_core_clean \
|
||||
dep_Servo dep_Servo_clean \
|
||||
dep_SPI dep_SPI_clean \
|
||||
dep_EEPROM dep_EEPROM_clean \
|
||||
target_ramps_v14 target_ramps_v14_clean \
|
||||
target_farmduino_v10 target_farmduino_v10_clean \
|
||||
target_farmduino_k14 target_farmduino_k14_clean
|
||||
|
||||
DEPS := $(DEP_CORE) $(DEP_SPI) $(DEP_Servo) $(DEP_EEPROM)
|
||||
DEPS_OBJ := $(DEP_SPI_OBJ) $(DEP_Servo_OBJ) $(DEP_EEPROM_OBJ)
|
||||
DEPS_CFLAGS := $(DEP_CORE_CFLAGS) $(DEP_SPI_CFLAGS) $(DEP_Servo_CFLAGS) $(DEP_EEPROM_CFLAGS)
|
||||
|
||||
all: $(BIN_DIR) $(DEPS) target_ramps_v14 target_farmduino_v10 target_farmduino_k14
|
||||
|
||||
clean: target_ramps_v14_clean target_farmduino_v10_clean target_farmduino_k14_clean
|
||||
|
||||
strings_test: all
|
||||
$(OBJ_COPY) -I ihex $(TARGET_ramps_v14_HEX) -O binary $(TARGET_ramps_v14_HEX).bin
|
||||
$(OBJ_COPY) -I ihex $(TARGET_farmduino_v10_HEX) -O binary $(TARGET_farmduino_v10_HEX).bin
|
||||
$(OBJ_COPY) -I ihex $(TARGET_farmduino_k14_HEX) -O binary $(TARGET_farmduino_k14_HEX).bin
|
||||
@strings $(TARGET_ramps_v14_HEX).bin | grep -q "6.4.0.R"
|
||||
@strings $(TARGET_farmduino_v10_HEX).bin | grep -q "6.4.0.F"
|
||||
@strings $(TARGET_farmduino_k14_HEX).bin | grep -q "6.4.0.G"
|
||||
|
||||
force_clean:
|
||||
$(RM) -r $(BUILD_DIR) $(BIN_DIR)
|
||||
|
||||
$(BIN_DIR):
|
||||
$(MKDIR_P) $(BIN_DIR)
|
|
@ -184,6 +184,9 @@ R |09 | |Command invalid
|
|||
R |11 | |X axis homing complete
|
||||
R |12 | |Y axis homing complete
|
||||
R |13 | |Z axis homing complete
|
||||
R |15 | X |Firmware used a different X coordinate than given in move command
|
||||
R |16 | Y |Firmware used a different Y coordinate than given in move command
|
||||
R |17 | Z |Firmware used a different Z coordinate than given in move command
|
||||
R |20 | |Report all paramaters complete
|
||||
R |21 |P V |Report parameter value
|
||||
R |23 |P V |Report updated parameter (during calibration)
|
||||
|
@ -304,6 +307,9 @@ ID | Name
|
|||
71 | MOVEMENT_MAX_SPD_X
|
||||
72 | MOVEMENT_MAX_SPD_Y
|
||||
73 | MOVEMENT_MAX_SPD_Z
|
||||
75 | MOVEMENT_INVERT_2_ENDPOINTS_X
|
||||
76 | MOVEMENT_INVERT_2_ENDPOINTS_Y
|
||||
77 | MOVEMENT_INVERT_2_ENDPOINTS_Z
|
||||
101 | ENCODER_ENABLED_X
|
||||
102 | ENCODER_ENABLED_Y
|
||||
103 | ENCODER_ENABLED_Z
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Please see our [official support policy](http://support-policy.farm.bot).
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please see our [guidlines for responsibly disclosing security vulnerabilities](http://vulnerabilities.farm.bot/).
|
|
@ -0,0 +1,40 @@
|
|||
DEP_EEPROM_BUILD_DIR := $(FBARDUINO_FIRMWARE_LIB_BUILD_DIR)/EEPROM
|
||||
DEP_EEPROM := $(DEP_EEPROM_BUILD_DIR)/EEPROM.a
|
||||
DEP_EEPROM_SRC_DIR := $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/EEPROM/src
|
||||
|
||||
DEP_EEPROM_CFLAGS := \
|
||||
-I$(DEP_EEPROM_SRC_DIR)
|
||||
|
||||
DEP_EEPROM_CFLAGS := -I$(DEP_EEPROM_SRC_DIR)
|
||||
DEP_EEPROM_LDFLAGS := $(DEP_EEPROM_BUILD_DIR)/EEPROM.a -L$(DEP_EEPROM_BUILD_DIR) -lm
|
||||
|
||||
DEP_EEPROM_ASM_SRC := $(call rwildcard, $(DEP_EEPROM_SRC_DIR), *.S)
|
||||
DEP_EEPROM_ASM_OBJ := $(DEP_EEPROM_ASM_SRC:.S=.o)
|
||||
|
||||
DEP_EEPROM_C_SRC := $(call rwildcard, $(DEP_EEPROM_SRC_DIR), *.c)
|
||||
DEP_EEPROM_C_OBJ := $(DEP_EEPROM_C_SRC:.c=.o)
|
||||
|
||||
DEP_EEPROM_CXX_SRC := $(call rwildcard, $(DEP_EEPROM_SRC_DIR), *.cpp)
|
||||
DEP_EEPROM_CXX_OBJ := $(DEP_EEPROM_CXX_SRC:.cpp=.o)
|
||||
|
||||
DEP_EEPROM_ALL_OBJ := $(DEP_EEPROM_ASM_OBJ) $(DEP_EEPROM_C_SRC) $(DEP_EEPROM_CXX_OBJ)
|
||||
|
||||
DEP_EEPROM_SRC := $(DEP_SERVO_ASM_SRC) $(DEP_SERVO_C_SRC) $(CXX_SRC)
|
||||
DEP_EEPROM_OBJ := $(patsubst $(DEP_EEPROM_SRC_DIR)/%,$(DEP_EEPROM_BUILD_DIR)/%,$(DEP_EEPROM_ALL_OBJ))
|
||||
|
||||
ARDUINO_DEP_EEPROM_CXX_FLAGS_P := $(DEP_CORE_CXX_FLAGS_P) $(DEP_EEPROM_CFLAGS)
|
||||
|
||||
$(DEP_EEPROM): $(DEP_CORE) $(DEP_EEPROM_BUILD_DIR) $(DEP_EEPROM_OBJ)
|
||||
$(AR) rcs $(DEP_EEPROM) $(DEP_EEPROM_OBJ)
|
||||
|
||||
$(DEP_EEPROM_BUILD_DIR)/%.o: $(DEP_EEPROM_SRC_DIR)/%.cpp
|
||||
$(CXX) $(ARDUINO_DEP_EEPROM_CXX_FLAGS_P) $< -o $@
|
||||
|
||||
$(DEP_EEPROM_BUILD_DIR):
|
||||
$(MKDIR_P) $(DEP_EEPROM_BUILD_DIR)
|
||||
|
||||
dep_EEPROM: $(DEP_EEPROM)
|
||||
|
||||
dep_EEPROM_clean:
|
||||
$(RM) $(DEP_EEPROM_OBJ)
|
||||
$(RM) $(DEP_EEPROM)
|
|
@ -0,0 +1,42 @@
|
|||
DEP_SPI_BUILD_DIR := $(FBARDUINO_FIRMWARE_LIB_BUILD_DIR)/SPI
|
||||
DEP_SPI := $(DEP_SPI_BUILD_DIR)/SPI.a
|
||||
DEP_SPI_SRC_DIR := $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
|
||||
|
||||
DEP_SPI_CFLAGS := \
|
||||
-I$(DEP_SPI_SRC_DIR)
|
||||
|
||||
DEP_SPI_CFLAGS := -I$(DEP_SPI_SRC_DIR)
|
||||
DEP_SPI_LDFLAGS := $(DEP_SPI_BUILD_DIR)/SPI.a -L$(DEP_SPI_BUILD_DIR) -lm
|
||||
|
||||
DEP_SPI_ASM_SRC := $(call rwildcard, $(DEP_SPI_SRC_DIR), *.S)
|
||||
DEP_SPI_ASM_OBJ := $(DEP_SPI_ASM_SRC:.S=.o)
|
||||
|
||||
DEP_SPI_C_SRC := $(call rwildcard, $(DEP_SPI_SRC_DIR), *.c)
|
||||
DEP_SPI_C_OBJ := $(DEP_SPI_C_SRC:.c=.o)
|
||||
|
||||
DEP_SPI_CXX_SRC := $(call rwildcard, $(DEP_SPI_SRC_DIR), *.cpp)
|
||||
DEP_SPI_CXX_OBJ := $(DEP_SPI_CXX_SRC:.cpp=.o)
|
||||
|
||||
DEP_SPI_ALL_OBJ := $(DEP_SPI_ASM_OBJ) $(DEP_SPI_C_SRC) $(DEP_SPI_CXX_OBJ)
|
||||
|
||||
DEP_SPI_SRC := $(DEP_SERVO_ASM_SRC) $(DEP_SERVO_C_SRC) $(CXX_SRC)
|
||||
DEP_SPI_OBJ := $(patsubst $(DEP_SPI_SRC_DIR)/%,$(DEP_SPI_BUILD_DIR)/%,$(DEP_SPI_ALL_OBJ))
|
||||
|
||||
DEP_SPI_DIRS := $(sort $(dir $(DEP_SPI_OBJ)))
|
||||
|
||||
ARDUINO_DEP_SPI_CXX_FLAGS_P := $(DEP_CORE_CXX_FLAGS_P) $(DEP_SPI_CFLAGS)
|
||||
|
||||
$(DEP_SPI): $(DEP_CORE) $(DEP_SPI_BUILD_DIR) $(DEP_SPI_OBJ)
|
||||
$(AR) rcs $(DEP_SPI) $(DEP_SPI_OBJ)
|
||||
|
||||
$(DEP_SPI_BUILD_DIR)/%.o: $(DEP_SPI_SRC_DIR)/%.cpp
|
||||
$(CXX) $(ARDUINO_DEP_SPI_CXX_FLAGS_P) $< -o $@
|
||||
|
||||
$(DEP_SPI_BUILD_DIR):
|
||||
$(MKDIR_P) $(DEP_SPI_DIRS)
|
||||
|
||||
dep_SPI: $(DEP_SPI)
|
||||
|
||||
dep_SPI_clean:
|
||||
$(RM) $(DEP_SPI_OBJ)
|
||||
$(RM) $(DEP_SPI)
|
|
@ -0,0 +1,42 @@
|
|||
DEP_Servo_BUILD_DIR := $(FBARDUINO_FIRMWARE_LIB_BUILD_DIR)/Servo
|
||||
DEP_Servo := $(DEP_Servo_BUILD_DIR)/Servo.a
|
||||
DEP_Servo_SRC_DIR := $(ARDUINO_INSTALL_DIR)/libraries/Servo/src
|
||||
|
||||
DEP_Servo_CFLAGS := \
|
||||
-I$(DEP_Servo_SRC_DIR)
|
||||
|
||||
DEP_Servo_CFLAGS := -I$(DEP_Servo_SRC_DIR)
|
||||
DEP_Servo_LDFLAGS := $(DEP_Servo_BUILD_DIR)/Servo.a -L$(DEP_Servo_BUILD_DIR) -lm
|
||||
|
||||
DEP_Servo_ASM_SRC := $(call rwildcard, $(DEP_Servo_SRC_DIR), *.S)
|
||||
DEP_Servo_ASM_OBJ := $(DEP_Servo_ASM_SRC:.S=.o)
|
||||
|
||||
DEP_Servo_C_SRC := $(call rwildcard, $(DEP_Servo_SRC_DIR), *.c)
|
||||
DEP_Servo_C_OBJ := $(DEP_Servo_C_SRC:.c=.o)
|
||||
|
||||
DEP_Servo_CXX_SRC := $(call rwildcard, $(DEP_Servo_SRC_DIR), *.cpp)
|
||||
DEP_Servo_CXX_OBJ := $(DEP_Servo_CXX_SRC:.cpp=.o)
|
||||
|
||||
DEP_Servo_ALL_OBJ := $(DEP_Servo_ASM_OBJ) $(DEP_Servo_C_SRC) $(DEP_Servo_CXX_OBJ)
|
||||
|
||||
DEP_Servo_SRC := $(DEP_SERVO_ASM_SRC) $(DEP_SERVO_C_SRC) $(CXX_SRC)
|
||||
DEP_Servo_OBJ := $(patsubst $(DEP_Servo_SRC_DIR)/%,$(DEP_Servo_BUILD_DIR)/%,$(DEP_Servo_ALL_OBJ))
|
||||
|
||||
DEP_Servo_DIRS := $(sort $(dir $(DEP_Servo_OBJ)))
|
||||
|
||||
ARDUINO_DEP_Servo_CXX_FLAGS_P := $(DEP_CORE_CXX_FLAGS_P) $(DEP_Servo_CFLAGS)
|
||||
|
||||
$(DEP_Servo): $(DEP_CORE) $(DEP_Servo_BUILD_DIR) $(DEP_Servo_OBJ)
|
||||
$(AR) rcs $(DEP_Servo) $(DEP_Servo_OBJ)
|
||||
|
||||
$(DEP_Servo_BUILD_DIR)/%.o: $(DEP_Servo_SRC_DIR)/%.cpp
|
||||
$(CXX) $(ARDUINO_DEP_Servo_CXX_FLAGS_P) $< -o $@
|
||||
|
||||
$(DEP_Servo_BUILD_DIR):
|
||||
$(MKDIR_P) $(DEP_Servo_DIRS)
|
||||
|
||||
dep_Servo: $(DEP_Servo)
|
||||
|
||||
dep_Servo_clean:
|
||||
$(RM) $(DEP_Servo_OBJ)
|
||||
$(RM) $(DEP_Servo)
|
|
@ -0,0 +1,100 @@
|
|||
DEP_CORE_BUILD_DIR := $(BUILD_DIR)/core
|
||||
DEP_CORE := $(DEP_CORE_BUILD_DIR)/core.a
|
||||
|
||||
DEP_CORE_CFLAGS := \
|
||||
-I$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino \
|
||||
-I$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/mega \
|
||||
|
||||
DEP_CORE_LDFLAGS := \
|
||||
$(DEP_CORE_BUILD_DIR)/core.a -L$(DEP_CORE_BUILD_DIR) -lm
|
||||
|
||||
DEP_CORE_ASM_SRC := $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/wiring_pulse.S
|
||||
|
||||
DEP_CORE_C_SRC := \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/WInterrupts.c \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/hooks.c \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/wiring.c \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/wiring_analog.c \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/wiring_digital.c \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/wiring_pulse.c \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/wiring_shift.c
|
||||
|
||||
DEP_CORE_CXX_SRC := \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/CDC.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/HardwareSerial0.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/HardwareSerial1.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/HardwareSerial2.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/HardwareSerial3.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/IPAddress.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/PluggableUSB.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/Print.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/Stream.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/Tone.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/USBCore.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/WMath.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/WString.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/abi.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/main.cpp \
|
||||
$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/new.cpp
|
||||
|
||||
DEP_CORE_OBJ := \
|
||||
$(DEP_CORE_BUILD_DIR)/wiring_pulse.S.o \
|
||||
$(DEP_CORE_BUILD_DIR)/WInterrupts.c.o \
|
||||
$(DEP_CORE_BUILD_DIR)/hooks.c.o \
|
||||
$(DEP_CORE_BUILD_DIR)/wiring.c.o \
|
||||
$(DEP_CORE_BUILD_DIR)/wiring_analog.c.o \
|
||||
$(DEP_CORE_BUILD_DIR)/wiring_digital.c.o \
|
||||
$(DEP_CORE_BUILD_DIR)/wiring_pulse.c.o \
|
||||
$(DEP_CORE_BUILD_DIR)/wiring_shift.c.o \
|
||||
$(DEP_CORE_BUILD_DIR)/CDC.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/HardwareSerial.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/HardwareSerial0.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/HardwareSerial1.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/HardwareSerial2.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/HardwareSerial3.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/IPAddress.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/PluggableUSB.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/Print.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/Stream.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/Tone.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/USBCore.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/WMath.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/WString.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/abi.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/main.cpp.o \
|
||||
$(DEP_CORE_BUILD_DIR)/new.cpp.o
|
||||
|
||||
DEP_CORE_D := $(DEP_CORE_OBJ:.cpp=.d)
|
||||
|
||||
DEP_CORE_CFLAGS_P := -c -g -Os -w -std=gnu11 -ffunction-sections \
|
||||
-fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 \
|
||||
-DF_CPU=16000000L -DARDUINO=10600 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR \
|
||||
$(DEP_CORE_CFLAGS)
|
||||
|
||||
DEP_CORE_CXX_FLAGS_P := -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections \
|
||||
-fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 \
|
||||
-DF_CPU=16000000L -DARDUINO=10600 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR \
|
||||
$(DEP_CORE_CFLAGS)
|
||||
|
||||
$(DEP_CORE): $(DEP_CORE_BUILD_DIR) $(DEP_CORE_OBJ)
|
||||
$(AR) rcs $(DEP_CORE) $(DEP_CORE_OBJ)
|
||||
|
||||
$(DEP_CORE_BUILD_DIR)/%.S.o: $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/%.S
|
||||
$(CC) -c -g -x assembler-with-cpp -flto -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10600 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AV \
|
||||
-I$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino -I$(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/mega \
|
||||
$< -o $@
|
||||
|
||||
$(DEP_CORE_BUILD_DIR)/%.c.o: $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/%.c
|
||||
$(CC) $(DEP_CORE_CFLAGS_P) $< -o $@
|
||||
|
||||
$(DEP_CORE_BUILD_DIR)/%.cpp.o: $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino/%.cpp
|
||||
$(CXX) $(DEP_CORE_CXX_FLAGS_P) $< -o $@
|
||||
|
||||
$(DEP_CORE_BUILD_DIR):
|
||||
$(MKDIR_P) $(DEP_CORE_BUILD_DIR)
|
||||
|
||||
dep_core_clean:
|
||||
$(RM) $(DEP_CORE_OBJ)
|
||||
$(RM) $(DEP_CORE_D)
|
||||
$(RM) $(DEP_CORE)
|
|
@ -0,0 +1,25 @@
|
|||
TARGET_farmduino_k14_BUILD_DIR := $(BUILD_DIR)/farmduino_k14
|
||||
TARGET_farmduino_k14_HEX := $(BIN_DIR)/farmduino_k14.hex
|
||||
|
||||
TARGET_farmduino_k14_OBJ := $(patsubst $(FBARDUINO_FIRMWARE_SRC_DIR)/%,$(TARGET_farmduino_k14_BUILD_DIR)/%,$(CXX_OBJ))
|
||||
|
||||
$(TARGET_farmduino_k14_HEX): $(TARGET_farmduino_k14_BUILD_DIR) $(TARGET_farmduino_k14_BUILD_DIR)/farmduino_k14.eep $(TARGET_farmduino_k14_BUILD_DIR)/farmduino_k14.elf
|
||||
$(OBJ_COPY) -O ihex -R .eeprom $(TARGET_farmduino_k14_BUILD_DIR)/farmduino_k14.elf $@
|
||||
|
||||
$(TARGET_farmduino_k14_BUILD_DIR)/farmduino_k14.eep: $(TARGET_farmduino_k14_BUILD_DIR)/farmduino_k14.elf
|
||||
$(OBJ_COPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $@
|
||||
|
||||
$(TARGET_farmduino_k14_BUILD_DIR)/farmduino_k14.elf: $(TARGET_farmduino_k14_OBJ)
|
||||
$(CC) -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o $@ $(TARGET_farmduino_k14_OBJ) $(DEPS_OBJ) $(DEP_CORE_LDFLAGS)
|
||||
|
||||
$(TARGET_farmduino_k14_BUILD_DIR)/%.o: $(FBARDUINO_FIRMWARE_SRC_DIR)/%.cpp
|
||||
$(CXX) $(CXX_FLAGS) -DFARMBOT_BOARD_ID=2 $(DEPS_CFLAGS) $< -o $@
|
||||
|
||||
$(TARGET_farmduino_k14_BUILD_DIR):
|
||||
$(MKDIR_P) $(TARGET_farmduino_k14_BUILD_DIR)
|
||||
|
||||
target_farmduino_k14: $(TARGET_farmduino_k14_HEX)
|
||||
|
||||
target_farmduino_k14_clean:
|
||||
$(RM) -r $(TARGET_farmduino_k14_BUILD_DIR)
|
||||
$(RM) $(TARGET_farmduino_k14_HEX)
|
|
@ -0,0 +1,25 @@
|
|||
TARGET_farmduino_v10_BUILD_DIR := $(BUILD_DIR)/farmduino_v10
|
||||
TARGET_farmduino_v10_HEX := $(BIN_DIR)/farmduino.hex
|
||||
|
||||
TARGET_farmduino_v10_OBJ := $(patsubst $(FBARDUINO_FIRMWARE_SRC_DIR)/%,$(TARGET_farmduino_v10_BUILD_DIR)/%,$(CXX_OBJ))
|
||||
|
||||
$(TARGET_farmduino_v10_HEX): $(TARGET_farmduino_v10_BUILD_DIR) $(TARGET_farmduino_v10_BUILD_DIR)/farmduino_v10.eep $(TARGET_farmduino_v10_BUILD_DIR)/farmduino_v10.elf
|
||||
$(OBJ_COPY) -O ihex -R .eeprom $(TARGET_farmduino_v10_BUILD_DIR)/farmduino_v10.elf $@
|
||||
|
||||
$(TARGET_farmduino_v10_BUILD_DIR)/farmduino_v10.eep: $(TARGET_farmduino_v10_BUILD_DIR)/farmduino_v10.elf
|
||||
$(OBJ_COPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $@
|
||||
|
||||
$(TARGET_farmduino_v10_BUILD_DIR)/farmduino_v10.elf: $(TARGET_farmduino_v10_OBJ)
|
||||
$(CC) -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o $@ $(TARGET_farmduino_v10_OBJ) $(DEPS_OBJ) $(DEP_CORE_LDFLAGS)
|
||||
|
||||
$(TARGET_farmduino_v10_BUILD_DIR)/%.o: $(FBARDUINO_FIRMWARE_SRC_DIR)/%.cpp
|
||||
$(CXX) $(CXX_FLAGS) -DFARMBOT_BOARD_ID=1 $(DEPS_CFLAGS) $< -o $@
|
||||
|
||||
$(TARGET_farmduino_v10_BUILD_DIR):
|
||||
$(MKDIR_P) $(TARGET_farmduino_v10_BUILD_DIR)
|
||||
|
||||
target_farmduino_v10: $(TARGET_farmduino_v10_HEX)
|
||||
|
||||
target_farmduino_v10_clean:
|
||||
$(RM) -r $(TARGET_farmduino_v10_OBJ)
|
||||
$(RM) $(TARGET_farmduino_v10_HEX)
|
|
@ -0,0 +1,25 @@
|
|||
TARGET_ramps_v14_BUILD_DIR := $(BUILD_DIR)/ramps_v14
|
||||
TARGET_ramps_v14_HEX := $(BIN_DIR)/arduino_firmware.hex
|
||||
|
||||
TARGET_ramps_v14_OBJ := $(patsubst $(FBARDUINO_FIRMWARE_SRC_DIR)/%,$(TARGET_ramps_v14_BUILD_DIR)/%,$(CXX_OBJ))
|
||||
|
||||
$(TARGET_ramps_v14_HEX): $(TARGET_ramps_v14_BUILD_DIR) $(TARGET_ramps_v14_BUILD_DIR)/arduino_firmware.eep $(TARGET_ramps_v14_BUILD_DIR)/arduino_firmware.elf
|
||||
$(OBJ_COPY) -O ihex -R .eeprom $(TARGET_ramps_v14_BUILD_DIR)/arduino_firmware.elf $@
|
||||
|
||||
$(TARGET_ramps_v14_BUILD_DIR)/arduino_firmware.eep: $(TARGET_ramps_v14_BUILD_DIR)/arduino_firmware.elf
|
||||
$(OBJ_COPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $@
|
||||
|
||||
$(TARGET_ramps_v14_BUILD_DIR)/arduino_firmware.elf: $(TARGET_ramps_v14_OBJ)
|
||||
$(CC) -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o $@ $(TARGET_ramps_v14_OBJ) $(DEPS_OBJ) $(DEP_CORE_LDFLAGS)
|
||||
|
||||
$(TARGET_ramps_v14_BUILD_DIR)/%.o: $(FBARDUINO_FIRMWARE_SRC_DIR)/%.cpp
|
||||
$(CXX) $(CXX_FLAGS) -DFARMBOT_BOARD_ID=0 $(DEPS_CFLAGS) $< -o $@
|
||||
|
||||
$(TARGET_ramps_v14_BUILD_DIR):
|
||||
$(MKDIR_P) $(TARGET_ramps_v14_BUILD_DIR)
|
||||
|
||||
target_ramps_v14: $(TARGET_ramps_v14_HEX)
|
||||
|
||||
target_ramps_v14_clean:
|
||||
$(RM) -r $(TARGET_ramps_v14_OBJ)
|
||||
$(RM) $(TARGET_ramps_v14_HEX)
|
|
@ -0,0 +1,45 @@
|
|||
# Someone will thank me later for this.
|
||||
# Find and replace DEP_NAME with the name of your dependency.
|
||||
|
||||
DEP_DEP_NAME_BUILD_DIR := $(FBARDUINO_FIRMWARE_LIB_BUILD_DIR)/DEP_NAME
|
||||
DEP_DEP_NAME := $(DEP_DEP_NAME_BUILD_DIR)/DEP_NAME.a
|
||||
DEP_DEP_NAME_SRC_DIR := $(ARDUINO_INSTALL_DIR)/libraries/DEP_NAME/src
|
||||
|
||||
DEP_DEP_NAME_CFLAGS := \
|
||||
-I$(DEP_DEP_NAME_SRC_DIR)
|
||||
|
||||
DEP_DEP_NAME_CFLAGS := -I$(DEP_DEP_NAME_SRC_DIR)
|
||||
DEP_DEP_NAME_LDFLAGS := $(DEP_DEP_NAME_BUILD_DIR)/DEP_NAME.a -L$(DEP_DEP_NAME_BUILD_DIR) -lm
|
||||
|
||||
DEP_DEP_NAME_ASM_SRC := $(call rwildcard, $(DEP_DEP_NAME_SRC_DIR), *.S)
|
||||
DEP_DEP_NAME_ASM_OBJ := $(DEP_DEP_NAME_ASM_SRC:.S=.o)
|
||||
|
||||
DEP_DEP_NAME_C_SRC := $(call rwildcard, $(DEP_DEP_NAME_SRC_DIR), *.c)
|
||||
DEP_DEP_NAME_C_OBJ := $(DEP_DEP_NAME_C_SRC:.c=.o)
|
||||
|
||||
DEP_DEP_NAME_CXX_SRC := $(call rwildcard, $(DEP_DEP_NAME_SRC_DIR), *.cpp)
|
||||
DEP_DEP_NAME_CXX_OBJ := $(DEP_DEP_NAME_CXX_SRC:.cpp=.o)
|
||||
|
||||
DEP_DEP_NAME_ALL_OBJ := $(DEP_DEP_NAME_ASM_OBJ) $(DEP_DEP_NAME_C_SRC) $(DEP_DEP_NAME_CXX_OBJ)
|
||||
|
||||
DEP_DEP_NAME_SRC := $(DEP_SERVO_ASM_SRC) $(DEP_SERVO_C_SRC) $(CXX_SRC)
|
||||
DEP_DEP_NAME_OBJ := $(patsubst $(DEP_DEP_NAME_SRC_DIR)/%,$(DEP_DEP_NAME_BUILD_DIR)/%,$(DEP_DEP_NAME_ALL_OBJ))
|
||||
|
||||
DEP_DEP_NAME_DIRS := $(sort $(dir $(DEP_DEP_NAME_OBJ)))
|
||||
|
||||
ARDUINO_DEP_DEP_NAME_CXX_FLAGS_P := $(DEP_CORE_CXX_FLAGS_P) $(DEP_DEP_NAME_CFLAGS)
|
||||
|
||||
$(DEP_DEP_NAME): $(DEP_CORE) $(DEP_DEP_NAME_BUILD_DIR) $(DEP_DEP_NAME_OBJ)
|
||||
$(AR) rcs $(DEP_DEP_NAME) $(DEP_DEP_NAME_OBJ)
|
||||
|
||||
$(DEP_DEP_NAME_BUILD_DIR)/%.o: $(DEP_DEP_NAME_SRC_DIR)/%.cpp
|
||||
$(CXX) $(ARDUINO_DEP_DEP_NAME_CXX_FLAGS_P) $< -o $@
|
||||
|
||||
$(DEP_DEP_NAME_BUILD_DIR):
|
||||
$(MKDIR_P) $(DEP_DEP_NAME_DIRS)
|
||||
|
||||
dep_DEP_NAME: $(DEP_DEP_NAME)
|
||||
|
||||
dep_DEP_NAME_clean:
|
||||
$(RM) $(DEP_DEP_NAME_OBJ)
|
||||
$(RM) $(DEP_DEP_NAME)
|
|
@ -10,6 +10,7 @@
|
|||
#undef RAMPS_V14
|
||||
#undef FARMDUINO_V10
|
||||
#undef FARMDUINO_V14
|
||||
#undef FARMDUINO_EXP_V20
|
||||
|
||||
#if FARMBOT_BOARD_ID == 0
|
||||
#define RAMPS_V14
|
||||
|
|
|
@ -621,6 +621,9 @@ bool ParameterList::validParam(int id)
|
|||
case MOVEMENT_INVERT_ENDPOINTS_X:
|
||||
case MOVEMENT_INVERT_ENDPOINTS_Y:
|
||||
case MOVEMENT_INVERT_ENDPOINTS_Z:
|
||||
case MOVEMENT_INVERT_2_ENDPOINTS_X:
|
||||
case MOVEMENT_INVERT_2_ENDPOINTS_Y:
|
||||
case MOVEMENT_INVERT_2_ENDPOINTS_Z:
|
||||
case MOVEMENT_INVERT_MOTOR_X:
|
||||
case MOVEMENT_INVERT_MOTOR_Y:
|
||||
case MOVEMENT_INVERT_MOTOR_Z:
|
||||
|
|
|
@ -9,7 +9,7 @@ D11 D6 D5 D4
|
|||
|
||||
static ServoControl *instance;
|
||||
|
||||
Servo servos[2];
|
||||
Servo servos[4];
|
||||
|
||||
ServoControl *ServoControl::getInstance()
|
||||
{
|
||||
|
@ -28,6 +28,16 @@ int ServoControl::attach()
|
|||
{
|
||||
servos[0].attach(SERVO_0_PIN);
|
||||
servos[1].attach(SERVO_1_PIN);
|
||||
servos[2].attach(SERVO_2_PIN);
|
||||
servos[3].attach(SERVO_3_PIN);
|
||||
}
|
||||
|
||||
void ServoControl::detachServos()
|
||||
{
|
||||
servos[0].detach();
|
||||
servos[1].detach();
|
||||
servos[2].detach();
|
||||
servos[3].detach();
|
||||
}
|
||||
|
||||
int ServoControl::setAngle(int pin, int angle)
|
||||
|
@ -52,11 +62,21 @@ int ServoControl::setAngle(int pin, int angle)
|
|||
switch (pin)
|
||||
{
|
||||
case 4:
|
||||
servos[0].attach(SERVO_0_PIN);
|
||||
servos[0].write(angle);
|
||||
break;
|
||||
case 5:
|
||||
servos[1].attach(SERVO_1_PIN);
|
||||
servos[1].write(angle);
|
||||
break;
|
||||
case 6:
|
||||
servos[2].attach(SERVO_2_PIN);
|
||||
servos[2].write(angle);
|
||||
break;
|
||||
case 11:
|
||||
servos[3].attach(SERVO_3_PIN);
|
||||
servos[3].write(angle);
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
static ServoControl *getInstance();
|
||||
|
||||
int attach();
|
||||
void detachServos();
|
||||
int setAngle(int pin, int angle);
|
||||
|
||||
private:
|
||||
|
|
|
@ -35,6 +35,28 @@ void StepperControl::reportEncoders()
|
|||
|
||||
}
|
||||
|
||||
void StepperControl::getEncoderReport()
|
||||
{
|
||||
serialBuffer += COMM_REPORT_ENCODER_SCALED;
|
||||
serialBuffer += " X";
|
||||
serialBuffer += (float)encoderX.currentPosition() / (float)stepsPerMm[0];
|
||||
serialBuffer += " Y";
|
||||
serialBuffer += (float)encoderY.currentPosition() / (float)stepsPerMm[1];
|
||||
serialBuffer += " Z";
|
||||
serialBuffer += (float)encoderZ.currentPosition() / (float)stepsPerMm[2];
|
||||
serialBuffer += CurrentState::getInstance()->getQAndNewLine();
|
||||
|
||||
serialBuffer += COMM_REPORT_ENCODER_RAW;
|
||||
serialBuffer += " X";
|
||||
serialBuffer += encoderX.currentPositionRaw();
|
||||
serialBuffer += " Y";
|
||||
serialBuffer += encoderY.currentPositionRaw();
|
||||
serialBuffer += " Z";
|
||||
serialBuffer += encoderZ.currentPositionRaw();
|
||||
serialBuffer += CurrentState::getInstance()->getQAndNewLine();
|
||||
|
||||
}
|
||||
|
||||
void StepperControl::reportStatus(StepperControlAxis *axis, int axisStatus)
|
||||
{
|
||||
serialBuffer += COMM_REPORT_CMD_STATUS;
|
||||
|
@ -634,6 +656,9 @@ int StepperControl::moveToCoords(double xDestScaled, double yDestScaled, double
|
|||
case 1:
|
||||
serialBuffer += CurrentState::getInstance()->getPosition();
|
||||
serialBuffer += CurrentState::getInstance()->getQAndNewLine();
|
||||
#if defined(FARMDUINO_V14)
|
||||
getEncoderReport();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -1275,11 +1300,11 @@ void StepperControl::checkAxisVsEncoder(StepperControlAxis *axis, StepperControl
|
|||
*lastPosition = axis->currentPosition();
|
||||
|
||||
//axis->resetStepDone();
|
||||
}
|
||||
|
||||
if (*encoderUseForPos)
|
||||
{
|
||||
axis->setCurrentPosition(encoder->currentPosition());
|
||||
if (*encoderUseForPos)
|
||||
{
|
||||
axis->setCurrentPosition(encoder->currentPosition());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1395,9 +1420,9 @@ void StepperControl::loadMotorSettings()
|
|||
|
||||
CurrentState::getInstance()->setStepsPerMm(stepsPerMm[0], stepsPerMm[1], stepsPerMm[2]);
|
||||
|
||||
axisX.loadMotorSettings(speedMax[0], speedMin[0], speedHome[0], stepsAcc[0], timeOut[0], homeIsUp[0], motorInv[0], endStInv[0], endStInv2[0], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[0], motor2Inv[0], endStEnbl[0], motorStopAtHome[0], motorMaxSize[0] *= stepsPerMm[0], motorStopAtMax[0]);
|
||||
axisY.loadMotorSettings(speedMax[1], speedMin[1], speedHome[1], stepsAcc[1], timeOut[1], homeIsUp[1], motorInv[1], endStInv[1], endStInv2[1], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[1], motor2Inv[1], endStEnbl[1], motorStopAtHome[1], motorMaxSize[1] *= stepsPerMm[1], motorStopAtMax[1]);
|
||||
axisZ.loadMotorSettings(speedMax[2], speedMin[2], speedHome[2], stepsAcc[2], timeOut[2], homeIsUp[2], motorInv[2], endStInv[2], endStInv2[2], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[2], motor2Inv[2], endStEnbl[2], motorStopAtHome[2], motorMaxSize[2] *= stepsPerMm[2], motorStopAtMax[2]);
|
||||
axisX.loadMotorSettings(speedMax[0], speedMin[0], speedHome[0], stepsAcc[0], timeOut[0], homeIsUp[0], motorInv[0], endStInv[0], endStInv2[0], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[0], motor2Inv[0], endStEnbl[0], motorStopAtHome[0], motorMaxSize[0], motorStopAtMax[0]);
|
||||
axisY.loadMotorSettings(speedMax[1], speedMin[1], speedHome[1], stepsAcc[1], timeOut[1], homeIsUp[1], motorInv[1], endStInv[1], endStInv2[1], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[1], motor2Inv[1], endStEnbl[1], motorStopAtHome[1], motorMaxSize[1], motorStopAtMax[1]);
|
||||
axisZ.loadMotorSettings(speedMax[2], speedMin[2], speedHome[2], stepsAcc[2], timeOut[2], homeIsUp[2], motorInv[2], endStInv[2], endStInv2[2], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[2], motor2Inv[2], endStEnbl[2], motorStopAtHome[2], motorMaxSize[2], motorStopAtMax[2]);
|
||||
|
||||
#if defined(FARMDUINO_EXP_V20)
|
||||
loadSettingsTMC2130();
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
void setPositionZ(long pos);
|
||||
|
||||
void reportEncoders();
|
||||
void getEncoderReport();
|
||||
|
||||
void test();
|
||||
void test2();
|
||||
|
@ -136,7 +137,7 @@ private:
|
|||
float motorConsMissedStepsDecay[3] = { 0, 0, 0 };
|
||||
bool motorConsEncoderEnabled[3] = { false, false, false };
|
||||
int motorConsEncoderType[3] = { 0, 0, 0 };
|
||||
int motorConsEncoderScaling[3] = { 0, 0, 0 };
|
||||
long motorConsEncoderScaling[3] = { 0, 0, 0 };
|
||||
int motorConsEncoderUseForPos[3] = { 0, 0, 0 };
|
||||
int motorConsEncoderInvert[3] = { 0, 0, 0 };
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ void StepperControlEncoder::loadPinNumbers(int channelA, int channelB, int chann
|
|||
shiftChannels();
|
||||
}
|
||||
|
||||
void StepperControlEncoder::loadSettings(int encType, int scaling, int invert)
|
||||
void StepperControlEncoder::loadSettings(int encType, long scaling, int invert)
|
||||
{
|
||||
encoderType = encType;
|
||||
scalingFactor = scaling;
|
||||
|
@ -105,6 +105,9 @@ long StepperControlEncoder::currentPosition()
|
|||
}
|
||||
else
|
||||
{
|
||||
#if defined(FARMDUINO_V14)
|
||||
return position * scalingFactor / 40000 * encoderInvert;
|
||||
#endif
|
||||
return position * scalingFactor / 10000 * encoderInvert;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
StepperControlEncoder();
|
||||
|
||||
void loadPinNumbers(int channelA, int channelB, int channelAQ, int channelBQ);
|
||||
void loadSettings(int encType, int scaling, int invert);
|
||||
void loadSettings(int encType, long scaling, int invert);
|
||||
|
||||
// Load the id for the motor dynamics lab encoder
|
||||
void loadMdlEncoderId(MdlSpiEncoders encoder);
|
||||
|
@ -60,7 +60,7 @@ private:
|
|||
|
||||
// encoder
|
||||
long position;
|
||||
int scalingFactor;
|
||||
long scalingFactor;
|
||||
int encoderType;
|
||||
int encoderInvert;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ bool stepperFlip = false;
|
|||
static char commandEndChar = 0x0A;
|
||||
static GCodeProcessor *gCodeProcessor = new GCodeProcessor();
|
||||
|
||||
int reportingPeriod = 5000;
|
||||
unsigned long lastAction;
|
||||
unsigned long currentTime;
|
||||
unsigned long cycleCounter = 0;
|
||||
|
@ -163,8 +164,11 @@ void setup()
|
|||
pinMode(AUX4_47, INPUT_PULLUP);
|
||||
pinMode(AUX4_32, INPUT_PULLUP);
|
||||
|
||||
//pinMode(SERVO_0_PIN , OUTPUT);
|
||||
//pinMode(SERVO_1_PIN , OUTPUT);
|
||||
pinMode(SERVO_0_PIN, OUTPUT);
|
||||
pinMode(SERVO_1_PIN, OUTPUT);
|
||||
pinMode(SERVO_2_PIN, OUTPUT);
|
||||
pinMode(SERVO_3_PIN, OUTPUT);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(FARMDUINO_V10) || defined(FARMDUINO_V14)
|
||||
|
@ -239,6 +243,8 @@ void setup()
|
|||
|
||||
#if defined(FARMDUINO_V14)
|
||||
|
||||
reportingPeriod = 500;
|
||||
|
||||
pinMode(READ_ENA_PIN, INPUT_PULLUP);
|
||||
pinMode(NSS_PIN, OUTPUT);
|
||||
digitalWrite(NSS_PIN, HIGH);
|
||||
|
@ -502,6 +508,7 @@ void loop()
|
|||
{
|
||||
StepperControl::getInstance()->disableMotorsEmergency();
|
||||
PinControl::getInstance()->resetPinsUsed();
|
||||
ServoControl::getInstance()->detachServos();
|
||||
if (debugMessages)
|
||||
{
|
||||
Serial.print(COMM_REPORT_COMMENT);
|
||||
|
@ -539,7 +546,7 @@ void loop()
|
|||
else
|
||||
{
|
||||
|
||||
if ((currentTime - lastAction) > 5000)
|
||||
if ((currentTime - lastAction) > reportingPeriod)
|
||||
{
|
||||
// After an idle time, send the idle message
|
||||
|
||||
|
|
Loading…
Reference in New Issue