ATTENTIION: Save your settings, will be overwritten with default

Added Tool Table functionality
Changed file structure
Added F446 to Makefile
Code cleaning
Added basics for lathe
Fixed spindle dir report
Fixed eeprom flasch checksum
Fixed eeprom bug
Many other small fixes/changes
pull/89/head
Patrick Felixberger 2020-12-01 13:29:12 +01:00
rodzic 69a3cb81a4
commit cc636dcdc9
99 zmienionych plików z 1086 dodań i 351 usunięć

Wyświetl plik

@ -89,6 +89,7 @@
<Add directory=".\SPL\src" />
</Compiler>
<Linker>
<Add option="-u _scanf_float" />
<Add option="-eb_lib=n" />
<Add option="-eb_start_files" />
<Add option="-flto" />
@ -99,12 +100,127 @@
<Mode before="0" />
<Mode after="1" />
</ExtraCommands>
<Unit filename="cmsis\arm_common_tables.h" />
<Unit filename="cmsis\arm_math.h" />
<Unit filename="cmsis\core_cm4.h" />
<Unit filename="cmsis\core_cm4_simd.h" />
<Unit filename="cmsis\core_cmFunc.h" />
<Unit filename="cmsis\core_cmInstr.h" />
<Unit filename="ARM\cmsis\arm_common_tables.h" />
<Unit filename="ARM\cmsis\arm_math.h" />
<Unit filename="ARM\cmsis\core_cm4.h" />
<Unit filename="ARM\cmsis\core_cm4_simd.h" />
<Unit filename="ARM\cmsis\core_cmFunc.h" />
<Unit filename="ARM\cmsis\core_cmInstr.h" />
<Unit filename="ARM\SPL\inc\misc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_adc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_can.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_crc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_cryp.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dac.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dbgmcu.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dcmi.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dma.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_exti.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_flash.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_gpio.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_hash.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_i2c.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_iwdg.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_pwr.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_rcc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_rng.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_rtc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_sdio.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_spi.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_syscfg.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_tim.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_usart.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_wwdg.h" />
<Unit filename="ARM\SPL\src\misc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_adc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_can.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_crc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp_aes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp_des.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp_tdes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dac.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dbgmcu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dcmi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dma.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_exti.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_flash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_gpio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_hash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_hash_md5.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_hash_sha1.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_i2c.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_iwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_pwr.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_rcc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_rng.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_rtc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_sdio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_spi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_syscfg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_tim.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_usart.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_wwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="grbl\Config.h" />
<Unit filename="grbl\CoolantControl.c">
<Option compilerVar="CC" />
@ -168,6 +284,10 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="grbl\ToolChange.h" />
<Unit filename="grbl\ToolTable.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="grbl\ToolTable.h" />
<Unit filename="grbl\util.c">
<Option compilerVar="CC" />
</Unit>
@ -254,121 +374,6 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="README.md" />
<Unit filename="SPL\inc\misc.h" />
<Unit filename="SPL\inc\stm32f4xx_adc.h" />
<Unit filename="SPL\inc\stm32f4xx_can.h" />
<Unit filename="SPL\inc\stm32f4xx_crc.h" />
<Unit filename="SPL\inc\stm32f4xx_cryp.h" />
<Unit filename="SPL\inc\stm32f4xx_dac.h" />
<Unit filename="SPL\inc\stm32f4xx_dbgmcu.h" />
<Unit filename="SPL\inc\stm32f4xx_dcmi.h" />
<Unit filename="SPL\inc\stm32f4xx_dma.h" />
<Unit filename="SPL\inc\stm32f4xx_exti.h" />
<Unit filename="SPL\inc\stm32f4xx_flash.h" />
<Unit filename="SPL\inc\stm32f4xx_gpio.h" />
<Unit filename="SPL\inc\stm32f4xx_hash.h" />
<Unit filename="SPL\inc\stm32f4xx_i2c.h" />
<Unit filename="SPL\inc\stm32f4xx_iwdg.h" />
<Unit filename="SPL\inc\stm32f4xx_pwr.h" />
<Unit filename="SPL\inc\stm32f4xx_rcc.h" />
<Unit filename="SPL\inc\stm32f4xx_rng.h" />
<Unit filename="SPL\inc\stm32f4xx_rtc.h" />
<Unit filename="SPL\inc\stm32f4xx_sdio.h" />
<Unit filename="SPL\inc\stm32f4xx_spi.h" />
<Unit filename="SPL\inc\stm32f4xx_syscfg.h" />
<Unit filename="SPL\inc\stm32f4xx_tim.h" />
<Unit filename="SPL\inc\stm32f4xx_usart.h" />
<Unit filename="SPL\inc\stm32f4xx_wwdg.h" />
<Unit filename="SPL\src\misc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_adc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_can.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_crc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp_aes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp_des.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp_tdes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dac.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dbgmcu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dcmi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dma.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_exti.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_flash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_gpio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_hash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_hash_md5.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_hash_sha1.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_i2c.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_iwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_pwr.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_rcc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_rng.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_rtc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_sdio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_spi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_syscfg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_tim.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_usart.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_wwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="Src\debug.h" />
<Unit filename="Src\M24C0X.c">
<Option compilerVar="CC" />

Wyświetl plik

@ -1,6 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<EmBitz_layout_file>
<ActiveTarget name="Release" />
<File name="grbl\Config.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1831" topLine="36" />
</Cursor>
</File>
<File name="grbl\Nvm.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1604" topLine="44" />
</Cursor>
</File>
<File name="grbl\Settings.c" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6104" topLine="204" />
</Cursor>
</File>
<File name="grbl\SpindleControl.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1446" topLine="18" />
@ -11,6 +26,21 @@
<Cursor1 position="1220" topLine="12" />
</Cursor>
</File>
<File name="HAL\FLASH\eeprom.c" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="821" topLine="14" />
</Cursor>
</File>
<File name="HAL\STM32\stm32f4xx.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="7911" topLine="129" />
</Cursor>
</File>
<File name="HAL\STM32\system_stm32f4xx.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="8208" topLine="150" />
</Cursor>
</File>
<File name="HAL\TIM\TIM.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1474" topLine="18" />
@ -23,7 +53,12 @@
</File>
<File name="main.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="900" topLine="0" />
<Cursor1 position="1190" topLine="0" />
</Cursor>
</File>
<File name="Src\Platform.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="719" topLine="9" />
</Cursor>
</File>
</EmBitz_layout_file>

Wyświetl plik

@ -89,6 +89,7 @@
<Add directory=".\SPL\src" />
</Compiler>
<Linker>
<Add option="-u _scanf_float" />
<Add option="-eb_lib=n" />
<Add option="-eb_start_files" />
<Add option="-flto" />
@ -99,12 +100,127 @@
<Mode before="0" />
<Mode after="1" />
</ExtraCommands>
<Unit filename="cmsis\arm_common_tables.h" />
<Unit filename="cmsis\arm_math.h" />
<Unit filename="cmsis\core_cm4.h" />
<Unit filename="cmsis\core_cm4_simd.h" />
<Unit filename="cmsis\core_cmFunc.h" />
<Unit filename="cmsis\core_cmInstr.h" />
<Unit filename="ARM\cmsis\arm_common_tables.h" />
<Unit filename="ARM\cmsis\arm_math.h" />
<Unit filename="ARM\cmsis\core_cm4.h" />
<Unit filename="ARM\cmsis\core_cm4_simd.h" />
<Unit filename="ARM\cmsis\core_cmFunc.h" />
<Unit filename="ARM\cmsis\core_cmInstr.h" />
<Unit filename="ARM\SPL\inc\misc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_adc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_can.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_crc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_cryp.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dac.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dbgmcu.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dcmi.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_dma.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_exti.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_flash.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_gpio.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_hash.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_i2c.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_iwdg.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_pwr.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_rcc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_rng.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_rtc.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_sdio.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_spi.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_syscfg.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_tim.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_usart.h" />
<Unit filename="ARM\SPL\inc\stm32f4xx_wwdg.h" />
<Unit filename="ARM\SPL\src\misc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_adc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_can.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_crc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp_aes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp_des.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_cryp_tdes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dac.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dbgmcu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dcmi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_dma.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_exti.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_flash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_gpio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_hash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_hash_md5.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_hash_sha1.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_i2c.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_iwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_pwr.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_rcc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_rng.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_rtc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_sdio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_spi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_syscfg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_tim.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_usart.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="ARM\SPL\src\stm32f4xx_wwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="grbl\Config.h" />
<Unit filename="grbl\CoolantControl.c">
<Option compilerVar="CC" />
@ -168,6 +284,10 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="grbl\ToolChange.h" />
<Unit filename="grbl\ToolTable.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="grbl\ToolTable.h" />
<Unit filename="grbl\util.c">
<Option compilerVar="CC" />
</Unit>
@ -254,121 +374,6 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="README.md" />
<Unit filename="SPL\inc\misc.h" />
<Unit filename="SPL\inc\stm32f4xx_adc.h" />
<Unit filename="SPL\inc\stm32f4xx_can.h" />
<Unit filename="SPL\inc\stm32f4xx_crc.h" />
<Unit filename="SPL\inc\stm32f4xx_cryp.h" />
<Unit filename="SPL\inc\stm32f4xx_dac.h" />
<Unit filename="SPL\inc\stm32f4xx_dbgmcu.h" />
<Unit filename="SPL\inc\stm32f4xx_dcmi.h" />
<Unit filename="SPL\inc\stm32f4xx_dma.h" />
<Unit filename="SPL\inc\stm32f4xx_exti.h" />
<Unit filename="SPL\inc\stm32f4xx_flash.h" />
<Unit filename="SPL\inc\stm32f4xx_gpio.h" />
<Unit filename="SPL\inc\stm32f4xx_hash.h" />
<Unit filename="SPL\inc\stm32f4xx_i2c.h" />
<Unit filename="SPL\inc\stm32f4xx_iwdg.h" />
<Unit filename="SPL\inc\stm32f4xx_pwr.h" />
<Unit filename="SPL\inc\stm32f4xx_rcc.h" />
<Unit filename="SPL\inc\stm32f4xx_rng.h" />
<Unit filename="SPL\inc\stm32f4xx_rtc.h" />
<Unit filename="SPL\inc\stm32f4xx_sdio.h" />
<Unit filename="SPL\inc\stm32f4xx_spi.h" />
<Unit filename="SPL\inc\stm32f4xx_syscfg.h" />
<Unit filename="SPL\inc\stm32f4xx_tim.h" />
<Unit filename="SPL\inc\stm32f4xx_usart.h" />
<Unit filename="SPL\inc\stm32f4xx_wwdg.h" />
<Unit filename="SPL\src\misc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_adc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_can.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_crc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp_aes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp_des.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_cryp_tdes.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dac.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dbgmcu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dcmi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_dma.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_exti.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_flash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_gpio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_hash.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_hash_md5.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_hash_sha1.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_i2c.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_iwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_pwr.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_rcc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_rng.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_rtc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_sdio.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_spi.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_syscfg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_tim.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_usart.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="SPL\src\stm32f4xx_wwdg.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="Src\debug.h" />
<Unit filename="Src\M24C0X.c">
<Option compilerVar="CC" />
@ -379,7 +384,7 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="Src\Print.h" />
<Unit filename="stm32f411re_flash.ld" />
<Unit filename="stm32f446re_flash.ld" />
<Extensions>
<code_completion />
<debugger>

Wyświetl plik

@ -26,7 +26,7 @@ uint8_t EE_ReadByteArray(uint8_t *DataOut, uint16_t VirtAddress, uint16_t size)
for(; size > 0; size--) {
data = EE_ReadByte(VirtAddress++);
checksum = (checksum << 1) || (checksum >> 7);
checksum = (checksum << 1) | (checksum >> 7);
checksum += data;
*(DataOut++) = data;
}
@ -44,7 +44,7 @@ void EE_WriteByteArray(uint16_t VirtAddress, uint8_t *DataIn, uint16_t size)
unsigned char checksum = 0;
for(; size > 0; size--) {
checksum = (checksum << 1) || (checksum >> 7);
checksum = (checksum << 1) | (checksum >> 7);
checksum += *DataIn;
EE_WriteByte(VirtAddress++, *(DataIn++));
}

Wyświetl plik

@ -184,7 +184,7 @@ static void GPIO_InitSystem(void)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;

Wyświetl plik

@ -39,6 +39,8 @@
#include "Platform.h"
#define TIM3_RESET_VALUE 300
/** @addtogroup Template_Project
* @{
*/
@ -59,6 +61,13 @@ extern void System_PinChangeISR(void);
// Counter for milliseconds
static volatile uint32_t gMillis = 0;
// TIM3
uint16_t uhIC3ReadValue1 = 0;
uint16_t uhIC3ReadValue2 = 0;
uint16_t uhCaptureNumber = 0;
uint32_t uwCapture = 0;
uint32_t uwTIM3Freq = 0;
uint16_t TIM3_ResetCnt = TIM3_RESET_VALUE;
/******************************************************************************/
/* Cortex-M4 Processor Exceptions Handlers */
@ -234,7 +243,7 @@ void SysTick_Handler(void)
uint8_t limits = Limits_GetState();
if(limits) {
// X-Y-Z Limit
if((DebounceCounterLimits == 0) && settings.system_flags & BITFLAG_ENABLE_LIMITS) {
if((DebounceCounterLimits == 0) && settings.flags & BITFLAG_HARD_LIMIT_ENABLE) {
DebounceCounterLimits = 20;
Limit_PinChangeISR();
}
@ -257,6 +266,11 @@ void SysTick_Handler(void)
}
gMillis++;
if(--TIM3_ResetCnt == 0)
{
uwTIM3Freq = 0;
}
}
@ -290,6 +304,47 @@ void TIM1_BRK_TIM9_IRQHandler(void)
}
void TIM3_IRQHandler(void)
{
if(TIM_GetITStatus(TIM3, TIM_IT_CC4) == SET)
{
/* Clear TIM3 Capture compare interrupt pending bit */
TIM_ClearITPendingBit(TIM3, TIM_IT_CC4);
if(uhCaptureNumber == 0)
{
/* Get the Input Capture value */
uhIC3ReadValue1 = TIM_GetCapture4(TIM3);
uhCaptureNumber = 1;
}
else if(uhCaptureNumber == 1)
{
/* Get the Input Capture value */
uhIC3ReadValue2 = TIM_GetCapture4(TIM3);
/* Capture computation */
if (uhIC3ReadValue2 > uhIC3ReadValue1)
{
uwCapture = (uhIC3ReadValue2 - uhIC3ReadValue1);
}
else if (uhIC3ReadValue2 < uhIC3ReadValue1)
{
uwCapture = ((0xFFFF - uhIC3ReadValue1) + uhIC3ReadValue2);
}
else
{
uwCapture = 0;
}
/* Frequency computation */
uwTIM3Freq = (uint32_t) SystemCoreClock / uwCapture;
uhCaptureNumber = 0;
}
TIM3_ResetCnt = TIM3_RESET_VALUE;
}
}
/**
* @brief This function handles External lines 9 to 5 interrupt request.
* @param None

Wyświetl plik

@ -65,6 +65,69 @@ void TIM1_Init(void)
}
/**
* Timer 2
* Used for Encoder
**/
void TIM2_Init(void)
{
}
/**
* Timer 3
* Used for Input capture
**/
void TIM3_Init(void)
{
TIM_ICInitTypeDef TIM_ICInitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
/* TIM3 clock enable */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);
/* GPIOC clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
/* TIM1 channel 4 pin (PC.9) configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* Connect TIM pins to AF2 */
GPIO_PinAFConfig(GPIOC, GPIO_PinSource9, GPIO_AF_TIM3);
/* Enable the TIM1 global Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
TIM_ICInitStructure.TIM_Channel = TIM_Channel_4;
TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising;
TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI;
TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV2;
TIM_ICInitStructure.TIM_ICFilter = 0x02;
TIM_ICInit(TIM3, &TIM_ICInitStructure);
/* Enable the CC2 Interrupt Request */
TIM_ITConfig(TIM3, TIM_IT_CC4, ENABLE);
/* TIM enable counter */
TIM_Cmd(TIM3, ENABLE);
}
/**
* Timer 9
* Base clock: 24 MHz

Wyświetl plik

@ -28,6 +28,8 @@ extern "C" {
void TIM1_Init(void);
void TIM2_Init(void);
void TIM3_Init(void);
void TIM9_Init(void);

Wyświetl plik

@ -67,7 +67,7 @@ void Usart_Init(USART_TypeDef *usart, uint32_t baud)
/* Enable the USARTx Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
@ -104,7 +104,7 @@ void Usart_Init(USART_TypeDef *usart, uint32_t baud)
/* Enable the USARTx Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);

Wyświetl plik

@ -26,18 +26,24 @@ OBJDUMP = ${GCC_BASE}/arm-none-eabi-objdump
#---------------------------------------------------------------------------------
TARGET := GRBL_Advanced
BUILD := build
SOURCES := ./ cmsis/ grbl/ HAL/ HAL/EXTI HAL/FLASH HAL/GPIO HAL/I2C HAL/SPI HAL/STM32 HAL/TIM HAL/USART SPL/src Src/ Libraries/GrIP Libraries/CRC Libraries/Ethernet Libraries/Ethernet/utility
SOURCES := ./ ARM/cmsis/ grbl/ HAL/ HAL/EXTI HAL/FLASH HAL/GPIO HAL/I2C HAL/SPI HAL/STM32 HAL/TIM HAL/USART ARM/SPL/src Src/ Libraries/GrIP Libraries/CRC Libraries/Ethernet Libraries/Ethernet/utility
INCLUDES := $(SOURCES) SPL/inc
INCLUDES := $(SOURCES) ARM/SPL/inc
LD_FILE = stm32f411re_flash.ld
DEFINES = -DSTM32F411xE -DSTM32F411RE
#LD_FILE = stm32f446re_flash.ld
#DEFINES = -DSTM32F446xx -DSTM32F446RE
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
FLAGS := -mfloat-abi=hard -mcpu=cortex-m4 -gdwarf-2 -mfpu=fpv4-sp-d16 -mthumb -Wno-misleading-indentation
CFLAGS := -O2 -g1 -std=c11 -Wall -Wextra $(INCLUDE) -fno-common -fsingle-precision-constant -fdata-sections -ffunction-sections -fomit-frame-pointer -mlittle-endian -DUSE_STDPERIPH_DRIVER -DSTM32F411xE -DSTM32F411RE -D__FPU_USED -DARM_MATH_CM4 -Wimplicit-fallthrough=0
CFLAGS := -O2 -g1 -std=c11 -Wall -Wextra $(INCLUDE) -fno-common -fsingle-precision-constant -fdata-sections -ffunction-sections -fomit-frame-pointer -mlittle-endian -DUSE_STDPERIPH_DRIVER -D__FPU_USED -DARM_MATH_CM4 -Wimplicit-fallthrough=0
CXXFLAGS := $(CFLAGS)
LDFLAGS := -lm -flto -Wl,--gc-sections -T../stm32f411re_flash.ld -Wl,-M=$(OUTPUT).map --specs=nosys.specs -nostartfiles --specs=nano.specs
LDFLAGS := -lm -flto -Wl,--gc-sections -Wl,-M=$(OUTPUT).map --specs=nosys.specs -nostartfiles --specs=nano.specs -u _scanf_float
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
@ -102,7 +108,7 @@ export OUTPUT := $(CURDIR)/$(TARGET)
#---------------------------------------------------------------------------------
all:
@[ -d $(BUILD) ] || mkdir -p $(BUILD)
@make --no-print-directory -C $(BUILD) $(OUTPUT).elf $(OUTPUT).bin $(OUTPUT).hex $(OUTPUT).lst -f $(CURDIR)/Makefile -j2
@make --no-print-directory -C $(BUILD) $(OUTPUT).elf $(OUTPUT).bin $(OUTPUT).hex $(OUTPUT).lst -f $(CURDIR)/Makefile -j3
@$(SIZE) $(OUTPUT).elf
#---------------------------------------------------------------------------------
@ -123,7 +129,7 @@ DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
$(OUTPUT).elf: $(OFILES)
@echo Linking executable...
@$(LD) -o $@ $^ $(FLAGS) $(LDFLAGS)
@$(LD) -o $@ $^ $(FLAGS) -T../$(LD_FILE) $(LDFLAGS)
$(OUTPUT).bin: $(OUTPUT).elf
@echo Creating bin...
@ -142,7 +148,7 @@ $(OUTPUT).lst: $(OUTPUT).elf
%.c.o : %.c
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(CC) $(FLAGS) $(CFLAGS) -c $^ -o $@
@$(CC) $(FLAGS) $(CFLAGS) $(DEFINES) -c $^ -o $@
#---------------------------------------------------------------------------------
# This rule links in binary data with the .cpp extension
@ -150,7 +156,7 @@ $(OUTPUT).lst: $(OUTPUT).elf
%.cpp.o : %.cpp
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(CXX) $(FLAGS) $(CXXFLAGS) -c $^ -o $@
@$(CXX) $(FLAGS) $(CXXFLAGS) $(DEFINES) -c $^ -o $@
#---------------------------------------------------------------------------------
# This rule links in binary data with the .S extension

Wyświetl plik

@ -29,12 +29,15 @@ Added experimental support for rotary axis (5-axis). They are roughly tested amd
#### Hard Reset
0x19 (CTRL-Y): Perform a hard reset.
#### Tool change
* $14=(tool change mode): 0 = Ignore M6; 1 = Manual Tool Change; 2 = Manual Tool Change + TLS
#### Tools
* $14=(tool change mode): 0 = Ignore M6; 1 = Manual Tool Change; 2 = Manual Tool Change + TLS; 3 = Tool Table
* $P: Save TLS position
* $T: Confirm tool change
* $Tx: Print parameters of Tool Nr x (Supports Tool Nr 0-19)
* $Tx=[0.0:0.0:0.0:0.0] (Save new parameters of Tool x: X, Y, Z, Reserved)
* $RST=T: Reset all tool tables saved in EEPROM
Uses Dynamic TLO when $14=2
Uses Dynamic TLO when $14 = (2 or 3)
#### I2C EEPROM
Added support for external EEPROM (e.g. ST M24C08). Uncomment 'USE_EXT_EEPROM' in Config.h.

Wyświetl plik

@ -59,7 +59,7 @@ uint8_t M24C0X_ReadByte(uint16_t addr)
if(addr > UINT8_MAX)
{
// If address is bigger than 255 (8 Bit), upper address bits (A8, A9, A10) are coded into slave address (up to 2KB, bigger EEPROMs use 2 Bytes for addressing)
slave_adr |= 0x07 & (addr>>8);
slave_adr |= 0x0E & (addr>>7);
}
return I2C_ReadByte(M24C0X_I2C, slave_adr, addr);
@ -73,7 +73,7 @@ uint8_t M24C0X_WriteByte(uint16_t addr, uint8_t data)
if(addr > UINT8_MAX)
{
// If address is bigger than 255 (8 Bit), upper address bits (A8, A9, A10) are coded into slave address (up to 2KB, bigger EEPROMs use 2 Bytes for addressing)
slave_adr |= 0x07 & (addr>>8);
slave_adr |= 0x0E & (addr>>7);
}
M24C0X_WriteProtection(WP_DISABLE);
@ -93,10 +93,11 @@ uint8_t M24C0X_ReadByteArray(uint16_t addr, uint8_t *pData, uint16_t len)
if(addr > UINT8_MAX)
{
// If address is bigger than 255 (8 Bit), upper address bits (A8, A9, A10) are coded into slave address (up to 2KB, bigger EEPROMs use 2 Bytes for addressing)
slave_adr |= 0x07 & (addr>>8);
slave_adr |= 0x0E & (addr>>7);
}
I2C_ReadByteArray(M24C0X_I2C, slave_adr, addr, pData, len);
return 1;
}
@ -104,7 +105,7 @@ uint8_t M24C0X_ReadByteArray(uint16_t addr, uint8_t *pData, uint16_t len)
uint8_t M24C0X_WriteByteArray(uint16_t addr, uint8_t *pData, uint16_t len)
{
uint8_t ret = 0;
uint8_t bytes2write = len;
uint16_t bytes2write = len;
uint16_t remainingBytes = len;
uint16_t bytesWritten = 0;
uint8_t timeout = 0;
@ -122,7 +123,7 @@ uint8_t M24C0X_WriteByteArray(uint16_t addr, uint8_t *pData, uint16_t len)
if(addr > UINT8_MAX)
{
// If address is bigger than 255 (8 Bit), upper address bits (A8, A9, A10) are coded into slave address (up to 2KB, bigger EEPROMs use 2 Bytes for addressing)
slave_adr |= 0x07 & (addr>>8);
slave_adr |= 0x0E & (addr>>7);
}
// We can write max M24C0X_PAGE_SIZE bytes per write
@ -170,15 +171,15 @@ uint8_t M24C0X_WriteByteArray(uint16_t addr, uint8_t *pData, uint16_t len)
static void M24C0X_WriteProtection(uint8_t enable)
{
__ASM("nop");
__ASM("nop");
if(enable)
{
for(uint8_t i = 0; i < 110; i++) __ASM("nop");
for(volatile uint8_t i = 0; i < 110; i++) __ASM("nop");
GPIO_SetBits(GPIOB, GPIO_Pin_12);
}
else
{
for(volatile uint8_t i = 0; i < 20; i++) __ASM("nop");
GPIO_ResetBits(GPIOB, GPIO_Pin_12);
}
__ASM("nop");

Wyświetl plik

@ -73,6 +73,12 @@ int Putc(const char c)
void Print_Flush(void)
{
if(buf_idx == 0)
{
// No data to send
return;
}
#ifdef ETH_IF
Pdu_t data;

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -28,8 +28,8 @@
#define CONFIG_H
#define GRBL_VERSION "1.1"
#define GRBL_VERSION_BUILD __DATE__
#define GRBL_VERSION "1.1"
#define GRBL_VERSION_BUILD __DATE__
// Define CPU pin map and default settings.

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2018-2019 Patrick F.
Copyright (c) 2018-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -49,13 +49,13 @@
// NOTE: Max line number is defined by the g-code standard to be 99999. It seems to be an
// arbitrary value, and some GUIs may require more. So we increased it based on a max safe
// value when converting a float (7.2 digit precision)s to an integer.
#define MAX_LINE_NUMBER 10000000
#define MAX_TOOL_NUMBER 255 // Limited by max unsigned 8-bit value
#define MAX_LINE_NUMBER 10000000
#define MAX_TOOL_NUMBER 255 // Limited by max unsigned 8-bit value
#define AXIS_COMMAND_NONE 0
#define AXIS_COMMAND_NON_MODAL 1
#define AXIS_COMMAND_MOTION_MODE 2
#define AXIS_COMMAND_TOOL_LENGTH_OFFSET 3 // *Undefined but required
#define AXIS_COMMAND_NONE 0
#define AXIS_COMMAND_NON_MODAL 1
#define AXIS_COMMAND_MOTION_MODE 2
#define AXIS_COMMAND_TOOL_LENGTH_OFFSET 3 // *Undefined but required
// Declare gc extern struct
@ -129,7 +129,7 @@ uint8_t GC_ExecuteLine(char *line)
perform initial error-checks for command word modal group violations, for any repeated
words, and for negative values set for the value words F, N, P, T, and S. */
uint8_t word_bit = 0; // Bit-value for assigning tracking variables
uint16_t word_bit = 0; // Bit-value for assigning tracking variables
uint8_t char_counter = 0;
char letter = 0;
float value = 0.0;
@ -187,6 +187,32 @@ uint8_t GC_ExecuteLine(char *line)
// Determine 'G' command and its modal group
switch(int_value)
{
case 7:
// Lathe Diameter Mode
if(settings.flags2 & BITFLAG_LATHE_MODE)
{
word_bit = MODAL_GROUP_G12;
gc_block.modal.lathe_mode = LATHE_DIAMETER_MODE;
}
else
{
return STATUS_GCODE_UNSUPPORTED_COMMAND;
}
break;
case 8:
// Lathe Radius Mode (default)
if(settings.flags2 & BITFLAG_LATHE_MODE)
{
word_bit = MODAL_GROUP_G12;
gc_block.modal.lathe_mode = LATHE_RADIUS_MODE;
}
else
{
return STATUS_GCODE_UNSUPPORTED_COMMAND;
}
break;
case 10: case 28: case 30: case 92:
// Check for G10/28/30/92 being called with G0/1/2/3/38 on same block.
// * G43.1 is also an axis command but is not explicitly defined this way.
@ -216,6 +242,60 @@ uint8_t GC_ExecuteLine(char *line)
}
break;
case 33:
// Spindle Synchronized Motion
if(settings.flags2 & BITFLAG_LATHE_MODE)
{
word_bit = MODAL_GROUP_G1;
gc_block.modal.motion = int_value;
axis_command = AXIS_COMMAND_MOTION_MODE;
}
else
{
return STATUS_GCODE_UNSUPPORTED_COMMAND;
}
break;
case 76:
// Threading Cycle
if(settings.flags2 & BITFLAG_LATHE_MODE)
{
word_bit = MODAL_GROUP_G1;
gc_block.modal.motion = int_value;
axis_command = AXIS_COMMAND_MOTION_MODE;
}
else
{
return STATUS_GCODE_UNSUPPORTED_COMMAND;
}
break;
case 96:
// Constant Surface Speed
if(settings.flags2 & BITFLAG_LATHE_MODE)
{
word_bit = MODAL_GROUP_G14;
gc_state.modal.spindle_mode = SPINDLE_SURFACE_MODE;
}
else
{
return STATUS_GCODE_UNSUPPORTED_COMMAND;
}
break;
case 97:
// RPM Mode (default)
if(settings.flags2 & BITFLAG_LATHE_MODE)
{
word_bit = MODAL_GROUP_G14;
gc_state.modal.spindle_mode = SPINDLE_RPM_MODE;
}
else
{
return STATUS_GCODE_UNSUPPORTED_COMMAND;
}
break;
case 0: case 1: case 2: case 3: case 38:
// Check for G0/1/2/3/38 being called with G10/28/30/92 on same block.
// * G43.1 is also an axis command but is not explicitly defined this way.
@ -244,9 +324,8 @@ uint8_t GC_ExecuteLine(char *line)
case 81: case 82: case 83: // Canned drilling cycles
word_bit = MODAL_GROUP_G1;
//gc_block.modal.motion = MOTION_MODE_DRILL;
gc_block.modal.motion = int_value;
axis_command = AXIS_COMMAND_MOTION_MODE;
break;
// Set retract mode
@ -466,9 +545,10 @@ uint8_t GC_ExecuteLine(char *line)
case 'B': word_bit = WORD_B; gc_block.values.xyz[B_AXIS] = value; axis_words |= (1<<B_AXIS); break;
#endif
// case 'C': // Not supported
// case 'D': // Not supported
case 'D': word_bit = WORD_D; gc_block.values.d = int_value; break; // Maybe float?
case 'F': word_bit = WORD_F; gc_block.values.f = value; break;
// case 'H': // Not supported
case 'H': word_bit = WORD_H; gc_block.values.h = int_value; break;
case 'E': word_bit = WORD_E; gc_block.values.e = value; break;
case 'I': word_bit = WORD_I; gc_block.values.ijk[X_AXIS] = value; ijk_words |= (1<<X_AXIS); break;
case 'J': word_bit = WORD_J; gc_block.values.ijk[Y_AXIS] = value; ijk_words |= (1<<Y_AXIS); break;
case 'K': word_bit = WORD_K; gc_block.values.ijk[Z_AXIS] = value; ijk_words |= (1<<Z_AXIS); break;
@ -502,7 +582,7 @@ uint8_t GC_ExecuteLine(char *line)
// Check for invalid negative values for words F, N, P, T, and S.
// NOTE: Negative value check is done here simply for code-efficiency.
if(BIT(word_bit) & (BIT(WORD_F)|BIT(WORD_N)|BIT(WORD_P)|BIT(WORD_T)|BIT(WORD_S)))
if(BIT(word_bit) & (BIT(WORD_D)|BIT(WORD_F)|BIT(WORD_N)|BIT(WORD_P)|BIT(WORD_T)|BIT(WORD_S)))
{
if(value < 0.0)
{
@ -650,7 +730,26 @@ uint8_t GC_ExecuteLine(char *line)
// bit_false(value_words,bit(WORD_T)); // NOTE: Single-meaning value word. Set at end of error-checking.
// [6. Change tool ]: N/A
// [7. Spindle control ]: N/A
// [7. Spindle control ]:
if(BIT_IS_TRUE(command_words, BIT(MODAL_GROUP_G14)) && (gc_block.modal.motion == SPINDLE_SURFACE_MODE))
{
if(BIT_IS_FALSE(value_words, BIT(WORD_S)))
{
// [S word missing]
return STATUS_GCODE_VALUE_WORD_MISSING;
}
BIT_FALSE(value_words, BIT(WORD_S));
if(BIT_IS_TRUE(value_words, BIT(WORD_D)))
{
if(gc_block.values.d == 0)
{
return STATUS_INVALID_STATEMENT;
}
}
BIT_FALSE(value_words, BIT(WORD_D));
}
// [8. Coolant control ]: N/A
// [9. Override control ]: Not supported except for a Grbl-only parking motion override control.
#ifdef ENABLE_PARKING_OVERRIDE_CONTROL
@ -789,7 +888,7 @@ uint8_t GC_ExecuteLine(char *line)
// [16. Set path control mode ]: N/A. Only G61. G61.1 and G64 NOT SUPPORTED.
// [17. Set distance mode ]: N/A. Only G91.1. G90.1 NOT SUPPORTED.
// [18. Set retract mode ]: NOT SUPPORTED.
// [18. Set retract mode ]:
// [19. Remaining non-modal actions ]: Check go to predefined position, set G10, or set axis offsets.
// NOTE: We need to separate the non-modal commands that are axis word-using (G10/G28/G30/G92), as these
@ -1263,6 +1362,63 @@ uint8_t GC_ExecuteLine(char *line)
{
}
BIT_FALSE(value_words, BIT(WORD_L));
break;
case MOTION_MODE_SPINDLE_SYNC:
if(BIT_IS_FALSE(value_words, BIT(WORD_K)))
{
// [K word missing]
return STATUS_GCODE_VALUE_WORD_MISSING;
}
BIT_FALSE(value_words, BIT(WORD_K));
if(BIT_IS_FALSE(value_words, (BIT(WORD_X) | BIT(WORD_Y) | BIT(WORD_Z))))
{
// [axis word missing]
return STATUS_GCODE_NO_AXIS_WORDS;
}
break;
case MOTION_MODE_THREADING:
if(BIT_IS_FALSE(value_words, BIT(WORD_P)))
{
// [P word missing]
return STATUS_GCODE_VALUE_WORD_MISSING;
}
BIT_FALSE(value_words, BIT(WORD_P));
if(BIT_IS_FALSE(value_words, BIT(WORD_Z)))
{
// [axis word missing]
return STATUS_GCODE_NO_AXIS_WORDS;
}
if(BIT_IS_FALSE(value_words, (BIT(WORD_I) | BIT(WORD_J) | BIT(WORD_K))))
{
// [IJK word missing]
return STATUS_GCODE_VALUE_WORD_MISSING;
}
BIT_FALSE(value_words, (BIT(WORD_I) | BIT(WORD_J) | BIT(WORD_K)));
// [Optional]
if(BIT_IS_TRUE(value_words, BIT(WORD_R)))
{
if(gc_block.values.r < 1.0)
{
return STATUS_BAD_NUMBER_FORMAT;
}
}
if(BIT_IS_TRUE(value_words, BIT(WORD_L)))
{
if(gc_block.values.l > 3)
{
return STATUS_BAD_NUMBER_FORMAT;
}
}
BIT_FALSE(value_words, (BIT(WORD_R) | BIT(WORD_Q) | BIT(WORD_H) | BIT(WORD_E) | BIT(WORD_L)));
break;
}
}
@ -1305,6 +1461,11 @@ uint8_t GC_ExecuteLine(char *line)
Planner_LineData_t *pl_data = &plan_data;
memset(pl_data, 0, sizeof(Planner_LineData_t)); // Zero pl_data struct
if((settings.flags2 & BITFLAG_LATHE_MODE) && gc_block.modal.lathe_mode == LATHE_DIAMETER_MODE)
{
gc_block.values.xyz[X_AXIS] /= 2;
}
// Intercept jog commands and complete error checking for valid jog commands and execute.
// NOTE: G-code parser state is not updated, except the position to ensure sequential jog
// targets are computed correctly. The final parser position after a jog is updated in
@ -1718,6 +1879,14 @@ uint8_t GC_ExecuteLine(char *line)
}
// Update position
memcpy(gc_block.values.xyz, xyz, N_AXIS*sizeof(float));
}
else if(gc_state.modal.motion == MOTION_MODE_SPINDLE_SYNC)
{
}
else if(gc_state.modal.motion == MOTION_MODE_THREADING)
{
}
else
{

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017-2019 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -34,7 +34,7 @@
// and are similar/identical to other g-code interpreters by manufacturers (Haas,Fanuc,Mazak,etc).
// NOTE: Modal group define values must be sequential and starting from zero.
#define MODAL_GROUP_G0 0 // [G4,G10,G28,G28.1,G30,G30.1,G53,G92,G92.1] Non-modal
#define MODAL_GROUP_G1 1 // [G0,G1,G2,G3,G38.2,G38.3,G38.4,G38.5,G80] Motion
#define MODAL_GROUP_G1 1 // [G0,G1,G2,G3,G33,G38.2,G38.3,G38.4,G38.5,G76,G80,G81,G82,G83] Motion
#define MODAL_GROUP_G2 2 // [G17,G18,G19] Plane selection
#define MODAL_GROUP_G3 3 // [G90,G91] Distance mode
#define MODAL_GROUP_G4 4 // [G91.1] Arc IJK distance mode
@ -46,6 +46,8 @@
#define MODAL_GROUP_G13 10 // [G61] Control mode
#define MODAL_GROUP_G10 11 // [G98, G99] Canned Cycles Return Mode
#define MODAL_GROUP_G14 12 // [G96, G97] Spindle Speed Mode
#define MODAL_GROUP_G15 13 // [G7, G8] Lathe Diameter Mode
#define MODAL_GROUP_M4 11 // [M0,M1,M2,M30] Stopping
#define MODAL_GROUP_M7 12 // [M3,M4,M5] Spindle turning
@ -86,6 +88,8 @@
#define MOTION_MODE_DRILL 81 // G81
#define MOTION_MODE_DRILL_DWELL 82 // G82
#define MOTION_MODE_DRILL_PECK 83 // G83
#define MOTION_MODE_SPINDLE_SYNC 33 // G33
#define MOTION_MODE_THREADING 76 // G76
// Modal Group G2: Plane select
#define PLANE_SELECT_XY 0 // G17 (Default: Must be zero)
@ -138,10 +142,18 @@
#define TOOL_LENGTH_OFFSET_CANCEL 0 // G49 (Default: Must be zero)
#define TOOL_LENGTH_OFFSET_ENABLE_DYNAMIC 1 // G43.1
// Modal Group G12: Active work coordinate system
// N/A: Stores coordinate system value (54-59) to change to.
// Modal Group G12: Lathe Mode
#define LATHE_RADIUS_MODE 0
#define LATHE_DIAMETER_MODE 1
// Modal Group G14: Spindle Control Mode
#define SPINDLE_RPM_MODE 0
#define SPINDLE_SURFACE_MODE 1
// Define parameter word mapping.
#define WORD_F 0
#define WORD_I 1
@ -159,6 +171,9 @@
#define WORD_Q 13
#define WORD_A 14
#define WORD_B 15
#define WORD_D 16
#define WORD_H 17
#define WORD_E 18
// Define g-code parser position updating flags
#define GC_UPDATE_POS_TARGET 0 // Must be zero
@ -191,7 +206,8 @@
// NOTE: When this struct is zeroed, the above defines set the defaults for the system.
typedef struct {
typedef struct
{
uint8_t motion; // {G0,G1,G2,G3,G38.2,G80}
uint8_t feed_rate; // {G93,G94}
uint8_t units; // {G20,G21}
@ -207,9 +223,16 @@ typedef struct {
uint8_t coolant; // {M7,M8,M9}
uint8_t spindle; // {M3,M4,M5}
uint8_t override; // {M56}
uint8_t lathe_mode; // {G7,G8}
uint8_t spindle_mode; // {G96,G97}
} GC_Modal_t;
typedef struct {
typedef struct
{
uint16_t d;
uint8_t h;
float e;
float f; // Feed
float ijk[N_AXIS]; // I,J,K Axis arc offsets
uint8_t l; // G10 or canned cycles parameters
@ -222,13 +245,16 @@ typedef struct {
float xyz[N_AXIS]; // X,Y,Z Translational axes
} GC_Values_t;
typedef struct {
typedef struct
{
GC_Modal_t modal;
float spindle_speed; // RPM
float feed_rate; // Millimeters/min
uint8_t tool; // Tracks tool number. NOT USED.
uint8_t tool; // Tracks tool number.
int32_t line_number; // Last line number sent
float spindle_limit;
float position[N_AXIS]; // Where the interpreter considers the tool to be at this point in the code
float coord_system[N_AXIS]; // Current work coordinate system (G54+). Stores offset from absolute machine
@ -238,7 +264,9 @@ typedef struct {
float tool_length_offset; // Tracks tool length offset value when enabled.
} Parser_State_t;
typedef struct {
typedef struct
{
uint8_t non_modal_command;
GC_Modal_t modal;
GC_Values_t values;

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -127,7 +127,8 @@ void Limit_PinChangeISR(void) // DEFAULT: Limit pin change interrupt process.
// TODO: Move limit pin-specific calls to a general function for portability.
void Limits_GoHome(uint8_t cycle_mask)
{
if(sys.abort) {
if(sys.abort)
{
// Block if system reset has been issued.
return;
}

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2019 Patrick F.
Copyright (c) 2019-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2019 Patrick F.
Copyright (c) 2019-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -510,7 +510,7 @@ void Protocol_ExecRtSystem(void)
if(rt_exec) {
System_ClearExecMotionOverride(); // Clear all motion override flags.
uint8_t new_f_override = sys.f_override;
uint8_t new_f_override = sys.f_override;
if(rt_exec & EXEC_FEED_OVR_RESET) {
new_f_override = DEFAULT_FEED_OVERRIDE;

Wyświetl plik

@ -3,7 +3,7 @@
Part of Grbl-Advanced
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2017-2019 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -133,7 +133,6 @@ void Report_StatusMessage(uint8_t status_code)
default:
Printf("error:");
Printf("%d\r\n", status_code);
//Report_LineFeed();
Print_Flush();
}
}
@ -204,6 +203,10 @@ void Report_FeedbackMessage(uint8_t message_code)
case MESSAGE_SLEEP_MODE:
Printf("Sleeping");
break;
case MESSAGE_INVALID_TOOL:
Printf("Invalid Tool Number");
break;
}
report_util_feedback_line_feed();
@ -214,7 +217,7 @@ void Report_FeedbackMessage(uint8_t message_code)
void Report_InitMessage(void)
{
//Printf("\r\nGRBL-Advanced %s ['$' for help]\r\n", GRBL_VERSION);
Printf("\r\nGrbl 1.1f ['$' for help]\r\n");
Printf("\r\nGrbl 1.1f [Advanced Edition | '$' for help]\r\n");
Print_Flush();
}
@ -222,6 +225,7 @@ void Report_InitMessage(void)
// Grbl help message
void Report_GrblHelp(void) {
Printf("[HLP:$$ $# $G $I $N $x=val $Nx=line $J=line $SLP $C $X $H ~ ! ? ctrl-x]\r\n");
Printf("[GRBL-Advanced by Schildkroet]\r\n");
Print_Flush();
}
@ -254,6 +258,7 @@ void Report_GrblSettings(void) {
report_util_float_setting(31, settings.rpm_min, N_DECIMAL_RPMVALUE);
report_util_uint8_setting(32, BIT_IS_TRUE(settings.flags,BITFLAG_LASER_MODE));
report_util_uint8_setting(33, BIT_IS_TRUE(settings.flags2,BITFLAG_LATHE_MODE));
Delay_ms(5);
@ -338,12 +343,27 @@ void Report_TLSParams(void)
}
void Report_ToolParams(uint8_t tool_nr)
{
Printf("[TOOL%d:", tool_nr);
ToolParams_t params = {};
TT_GetToolParams(tool_nr, &params);
PrintFloat_CoordValue(params.x_offset);Putc(':');
PrintFloat_CoordValue(params.y_offset);Putc(':');
PrintFloat_CoordValue(params.z_offset);Putc(':');
PrintFloat_CoordValue(params.reserved);
report_util_feedback_line_feed();
}
// Prints Grbl NGC parameters (coordinate offsets, probing)
void Report_NgcParams(void)
{
float coord_data[N_AXIS];
uint8_t coord_select;
for(coord_select = 0; coord_select <= SETTING_INDEX_NCOORD; coord_select++) {
if(!(Settings_ReadCoordData(coord_select,coord_data))) {
Report_StatusMessage(STATUS_SETTING_READ_FAIL);

Wyświetl plik

@ -3,7 +3,7 @@
Part of Grbl-Advanced
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -89,6 +89,7 @@
#define MESSAGE_RESTORE_DEFAULTS 9
#define MESSAGE_SPINDLE_RESTORE 10
#define MESSAGE_SLEEP_MODE 11
#define MESSAGE_INVALID_TOOL 12
// Prints system status messages.
@ -121,6 +122,9 @@ void Report_ProbeParams(void);
// Prints tls position
void Report_TLSParams(void);
// Print tool table
void Report_ToolParams(uint8_t tool_nr);
// Prints Grbl NGC parameters (coordinate offsets, probe)
void Report_NgcParams(void);

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -90,6 +90,7 @@ void WriteGlobalSettings(void)
void Settings_Restore(uint8_t restore_flag) {
if(restore_flag & SETTINGS_RESTORE_DEFAULTS) {
settings.system_flags = DEFAULT_SYSTEM_INVERT_MASK;
settings.flags2 = DEFAULT_LATHE_MODE;
settings.stepper_idle_lock_time = DEFAULT_STEPPER_IDLE_LOCK_TIME;
settings.step_invert_mask = DEFAULT_STEPPING_INVERT_MASK;
settings.dir_invert_mask = DEFAULT_DIRECTION_INVERT_MASK;
@ -181,6 +182,11 @@ void Settings_Restore(uint8_t restore_flag) {
Nvm_WriteByte(EEPROM_ADDR_BUILD_INFO+1 , 0); // Checksum
Nvm_Update();
}
if(restore_flag & SETTINGS_RESTORE_TOOLS)
{
TT_Reset();
}
}
@ -200,6 +206,28 @@ uint8_t Settings_ReadStartupLine(uint8_t n, char *line)
}
void Settings_StoreToolTable(ToolTable_t *table)
{
Nvm_Write(EEPROM_ADDR_TOOLTABLE, (uint8_t*)table, sizeof(ToolTable_t));
}
void Settings_StoreToolParams(uint8_t tool_nr, ToolParams_t *params)
{
Nvm_Write(EEPROM_ADDR_TOOLTABLE+(tool_nr*sizeof(ToolParams_t)), (uint8_t*)params, sizeof(ToolParams_t));
}
uint8_t Settings_ReadToolTable(ToolTable_t *table)
{
if(!(Nvm_Read((uint8_t*)table, EEPROM_ADDR_TOOLTABLE, sizeof(ToolTable_t)))) {
return false;
}
return true;
}
// Reads startup line from EEPROM. Updated pointed line string data.
uint8_t Settings_ReadBuildInfo(char *line)
{
@ -301,7 +329,7 @@ uint8_t Settings_StoreGlobalSetting(uint8_t parameter, float value) {
switch(parameter)
{
case 0:
settings.system_flags = int_value;
//settings.system_flags = int_value;
break;
case 1:
@ -374,10 +402,15 @@ uint8_t Settings_StoreGlobalSetting(uint8_t parameter, float value) {
case 30: settings.rpm_max = value; Spindle_Init(); break; // Re-initialize spindle rpm calibration
case 31: settings.rpm_min = value; Spindle_Init(); break; // Re-initialize spindle rpm calibration
case 32:
if (int_value) { settings.flags |= BITFLAG_LASER_MODE; }
else { settings.flags &= ~BITFLAG_LASER_MODE; }
if (int_value) { settings.flags |= BITFLAG_LASER_MODE; }
else { settings.flags &= ~BITFLAG_LASER_MODE; }
break;
case 33:
if (int_value) { settings.flags2 |= BITFLAG_LATHE_MODE; }
else { settings.flags2 &= ~BITFLAG_LATHE_MODE; }
break;
default:
return(STATUS_INVALID_STATEMENT);
}
@ -408,6 +441,9 @@ void Settings_Init(void)
Settings_Restore(SETTINGS_RESTORE_ALL); // Force restore all EEPROM data.
Report_GrblSettings();
}
// Read tool table
TT_Init();
}

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -24,11 +24,12 @@
#include <stdint.h>
#include "util.h"
#include "ToolTable.h"
// Version of the EEPROM data. Will be used to migrate existing data from older versions of Grbl
// when firmware is upgraded. Always stored in byte 0 of eeprom
#define SETTINGS_VERSION 5 // NOTE: Check settings_reset() when moving to next version.
#define SETTINGS_VERSION 7 // NOTE: Check settings_reset() when moving to next version.
// Define bit flag masks for the boolean settings in settings.system_flags
@ -49,6 +50,9 @@
#define BITFLAG_INVERT_LIMIT_PINS BIT(6)
#define BITFLAG_INVERT_PROBE_PIN BIT(7)
// Define bit flag masks for the boolean settings in settings.flag2.
#define BITFLAG_LATHE_MODE BIT(0)
// Define status reporting boolean enable bit flags in settings.status_report_mask
#define BITFLAG_RT_STATUS_POSITION_TYPE BIT(0)
#define BITFLAG_RT_STATUS_BUFFER_STATE BIT(1)
@ -58,12 +62,14 @@
#define SETTINGS_RESTORE_PARAMETERS BIT(1)
#define SETTINGS_RESTORE_STARTUP_LINES BIT(2)
#define SETTINGS_RESTORE_BUILD_INFO BIT(3)
#define SETTINGS_RESTORE_TOOLS BIT(4)
// Define EEPROM memory address location values for Grbl settings and parameters
// NOTE: The Atmega328p has 1KB EEPROM. The upper half is reserved for parameters and
// the startup script. The lower half contains the global settings and space for future
// developments.
#define EEPROM_ADDR_GLOBAL 1U
#define EEPROM_ADDR_TOOLTABLE 180U
#define EEPROM_ADDR_PARAMETERS 512U
#define EEPROM_ADDR_STARTUP_BLOCK 768U
#define EEPROM_ADDR_BUILD_INFO 942U
@ -89,7 +95,8 @@
#pragma pack(push, 1) // exact fit - no padding
// Global persistent settings (Stored from byte EEPROM_ADDR_GLOBAL onwards); 111 Bytes
typedef struct {
typedef struct
{
// Axis settings
float steps_per_mm[N_AXIS];
float max_rate[N_AXIS];
@ -119,6 +126,7 @@ typedef struct {
float rpm_min;
uint8_t flags; // Contains default boolean settings
uint8_t flags2;
uint8_t homing_dir_mask;
float homing_feed_rate;
@ -147,6 +155,14 @@ void Settings_StoreTlsPosition(void);
// Stores the protocol line variable as a startup line in EEPROM
void Settings_StoreStartupLine(uint8_t n, char *line);
// Stores tool table in EEPROM
void Settings_StoreToolTable(ToolTable_t *table);
void Settings_StoreToolParams(uint8_t tool_nr, ToolParams_t *params);
// Read tool table
uint8_t Settings_ReadToolTable(ToolTable_t *table);
// Reads an EEPROM startup line to the protocol line variable
uint8_t Settings_ReadStartupLine(uint8_t n, char *line);

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -31,6 +31,7 @@
static float pwm_gradient; // Precalulated value to speed up rpm to PWM conversions.
static uint8_t spindle_enabled = 0;
static uint8_t spindle_dir_cw = 1;
void Spindle_Init(void)
@ -42,6 +43,7 @@ void Spindle_Init(void)
TIM1_Init();
pwm_gradient = SPINDLE_PWM_RANGE/(settings.rpm_max-settings.rpm_min);
spindle_dir_cw = 1;
Spindle_Stop();
}
@ -68,13 +70,14 @@ uint8_t Spindle_GetState(void)
// Check if PWM is enabled.
if(spindle_enabled)
{
/*if(SPINDLE_DIRECTION_PORT & (1<<SPINDLE_DIRECTION_BIT)) {
if(spindle_dir_cw == 0)
{
return SPINDLE_STATE_CCW;
}
else {
else
{
return SPINDLE_STATE_CW;
}*/
return SPINDLE_STATE_CW;
}
}
return SPINDLE_STATE_DISABLE;
@ -168,9 +171,11 @@ void Spindle_SetState(uint8_t state, float rpm)
else {
if(state == SPINDLE_ENABLE_CW) {
GPIO_ResetBits(GPIO_SPINDLE_DIR_PORT, GPIO_SPINDLE_DIR_PIN);
spindle_dir_cw = 1;
}
else {
GPIO_SetBits(GPIO_SPINDLE_DIR_PORT, GPIO_SPINDLE_DIR_PIN);
spindle_dir_cw = 0;
}
#ifdef INVERT_SPINDLE_ENABLE_PIN

Wyświetl plik

@ -4,7 +4,7 @@
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -401,7 +401,7 @@ void Stepper_MainISR(void)
}
TIM9->ARR = st.exec_segment->cycles_per_tick;
TIM9->CCR1 = (uint16_t)(st.exec_segment->cycles_per_tick * 0.75);
TIM9->CCR1 = (uint16_t)(st.exec_segment->cycles_per_tick * 0.6);
st.step_count = st.exec_segment->n_step; // NOTE: Can sometimes be zero when moving slow.
// If the new segment starts a new planner block, initialize stepper variables and counters.

Wyświetl plik

@ -3,7 +3,7 @@
Part of Grbl-Advanced
Copyright (c) 2014-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -18,7 +18,10 @@
You should have received a copy of the GNU General Public License
along with Grbl-Advanced. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "Config.h"
#include "GCode.h"
#include "GPIO.h"
@ -235,22 +238,37 @@ uint8_t System_ExecuteLine(char *line)
break;
case 'T':
// Tool change finished. Continue execution
System_ClearExecStateFlag(EXEC_TOOL_CHANGE);
sys.state = STATE_IDLE;
// Check if machine is homed and tls enabled
if(settings.tool_change == 2)
if(line[++char_counter] == 0)
{
// Tool change finished. Continue execution
System_ClearExecStateFlag(EXEC_TOOL_CHANGE);
sys.state = STATE_IDLE;
// Check if machine is homed
if(sys.is_homed)
{
if(settings.tls_valid)
// Change tool with probing
if(settings.tool_change == 2)
{
TC_ProbeTLS();
// Check if TLS is valid
if(settings.tls_valid)
{
// Probe new tool
TC_ProbeTLS();
}
else
{
return STATUS_TLS_NOT_SET;
}
}
else if(settings.tool_change == 3)
{
// Change tool with tool table
TC_ApplyToolOffset();
}
else
{
return STATUS_TLS_NOT_SET;
return STATUS_SETTING_DISABLED;
}
}
else
@ -260,7 +278,57 @@ uint8_t System_ExecuteLine(char *line)
}
else
{
return STATUS_SETTING_DISABLED;
// Print tool params
char c;
ToolParams_t params = {};
char num[4] = {};
uint8_t idx = 0;
do
{
c = line[char_counter++];
num[idx++] = c;
} while(isdigit(c) && idx < 3);
num[idx] = '\0';
if(c == '=')
{
// Save params of new tool
char tmp_float[10];
int t = 0;
float value_f[4] = {};
// Read floats [x.x:x.x:x.x:x.x]
for(int i = 0; i < 4; i++)
{
t = ExtractFloat(&line[char_counter], t, tmp_float);
// Check if float was found
if(strlen(tmp_float) > 0)
{
// Convert string to float
sscanf(tmp_float, "%f", &value_f[i]);
tmp_float[0] = '\0';
}
else
{
// Couldn't find a float value
break;
}
}
params.x_offset = value_f[0];
params.y_offset = value_f[1];
params.z_offset = value_f[2];
params.reserved = value_f[3];
// Store tool params
TT_SaveToolParams(atoi(num), &params);
}
else
{
Report_ToolParams(atoi(num));
}
}
break;
@ -393,13 +461,17 @@ uint8_t System_ExecuteLine(char *line)
#ifdef ENABLE_RESTORE_EEPROM_CLEAR_PARAMETERS
case '#':
Settings_Restore(SETTINGS_RESTORE_PARAMETERS);
break;
break;
#endif
#ifdef ENABLE_RESTORE_EEPROM_WIPE_ALL
case '*':
Settings_Restore(SETTINGS_RESTORE_ALL);
break;
break;
#endif
case 'T':
TT_Reset();
break;
default:
return STATUS_INVALID_STATEMENT;
}

Wyświetl plik

@ -3,7 +3,7 @@
Part of Grbl-Advanced
Copyright (c) 2014-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Wyświetl plik

@ -2,7 +2,7 @@
ToolChange.c - Changing tool
Part of Grbl-Advanced
Copyright (c) 2018-2019 Patrick F.
Copyright (c) 2018-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -26,6 +26,8 @@
#include "System32.h"
#include "SpindleControl.h"
#include "Settings.h"
#include "Config.h"
#include "ToolTable.h"
#include "defaults.h"
@ -65,9 +67,9 @@ void TC_ChangeCurrentTool(void)
// Wait until queue is processed
Protocol_BufferSynchronize();
// Don't move XY. Go to Z 0
// Move TOOL_LENGTH_OFFSET_AXIS to 0
System_ConvertArraySteps2Mpos(position, sys_position);
position[Z_AXIS] = 0.0;
position[TOOL_LENGTH_OFFSET_AXIS] = 0.0;
memcpy(tc_pos, position, sizeof(float)*N_AXIS);
//System_SetExecStateFlag(EXEC_TOOL_CHANGE);
@ -109,7 +111,7 @@ void TC_ProbeTLS(void)
// Move to XY position of TLS
System_ConvertArraySteps2Mpos(position, settings.tls_position);
position[Z_AXIS] = 0.0;
position[TOOL_LENGTH_OFFSET_AXIS] = 0.0;
// Set-up planer
pl_data.feed_rate = 0.0;
@ -122,7 +124,7 @@ void TC_ProbeTLS(void)
MC_Line(position, &pl_data);
// Move down with offset (for tool)
position[Z_AXIS] = (settings.tls_position[Z_AXIS] / settings.steps_per_mm[Z_AXIS]) + TOOL_SENSOR_OFFSET;
position[TOOL_LENGTH_OFFSET_AXIS] = (settings.tls_position[TOOL_LENGTH_OFFSET_AXIS] / settings.steps_per_mm[TOOL_LENGTH_OFFSET_AXIS]) + TOOL_SENSOR_OFFSET;
MC_Line(position, &pl_data);
// Wait until queue is processed
@ -133,7 +135,7 @@ void TC_ProbeTLS(void)
pl_data.condition = 0; // Reset rapid motion condition flag.
// Probe TLS fast
position[Z_AXIS] -= 200.0;
position[TOOL_LENGTH_OFFSET_AXIS] -= 200.0;
uint8_t ret = MC_ProbeCycle(position, &pl_data, flags);
if(ret != GC_PROBE_FOUND)
{
@ -143,7 +145,7 @@ void TC_ProbeTLS(void)
// Get current position
System_ConvertArraySteps2Mpos(position, sys_position);
position[Z_AXIS] += 1.8;
position[TOOL_LENGTH_OFFSET_AXIS] += 1.8;
// Move up a little bit for slow probing
pl_data.feed_rate = 200.0;
@ -151,7 +153,7 @@ void TC_ProbeTLS(void)
// Probe TLS slow
pl_data.feed_rate = 12.0;
position[Z_AXIS] -= 200;
position[TOOL_LENGTH_OFFSET_AXIS] -= 200;
ret = MC_ProbeCycle(position, &pl_data, flags);
if(ret != GC_PROBE_FOUND)
{
@ -163,22 +165,22 @@ void TC_ProbeTLS(void)
{
// Save first tool as reference
isFirstTC = 0;
toolReferenz = sys_probe_position[Z_AXIS];
toolReferenz = sys_probe_position[TOOL_LENGTH_OFFSET_AXIS];
}
else
{
// Calculate tool offset
toolOffset = sys_probe_position[Z_AXIS] - toolReferenz;
toolOffset = sys_probe_position[TOOL_LENGTH_OFFSET_AXIS] - toolReferenz;
// Apply offset as dynamic tool length offset
gc_state.modal.tool_length = TOOL_LENGTH_OFFSET_ENABLE_DYNAMIC;
gc_state.tool_length_offset = toolOffset / settings.steps_per_mm[Z_AXIS];
gc_state.tool_length_offset = toolOffset / settings.steps_per_mm[TOOL_LENGTH_OFFSET_AXIS];
}
Delay_ms(5);
// Move Z up
position[Z_AXIS] = 0.0;
position[TOOL_LENGTH_OFFSET_AXIS] = 0.0;
pl_data.condition |= PL_COND_FLAG_RAPID_MOTION; // Set rapid motion condition flag.
MC_Line(position, &pl_data);
@ -191,3 +193,34 @@ void TC_ProbeTLS(void)
GC_SyncPosition();
}
void TC_ApplyToolOffset(void)
{
ToolParams_t params = {};
TT_GetToolParams(gc_state.tool, &params);
// Apply offset as dynamic tool length offset
gc_state.modal.tool_length = TOOL_LENGTH_OFFSET_ENABLE_DYNAMIC;
switch(TOOL_LENGTH_OFFSET_AXIS)
{
case X_AXIS:
gc_state.tool_length_offset = params.x_offset;
break;
case Y_AXIS:
gc_state.tool_length_offset = params.y_offset;
break;
case Z_AXIS:
gc_state.tool_length_offset = params.z_offset;
break;
default:
// Axis not valid
gc_state.modal.tool_length = TOOL_LENGTH_OFFSET_CANCEL;
break;
}
}

Wyświetl plik

@ -2,7 +2,7 @@
ToolChange.h - Changing tool
Part of Grbl-Advanced
Copyright (c) 2018-2019 Patrick F.
Copyright (c) 2018-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -28,6 +28,7 @@
void TC_Init(void);
void TC_ChangeCurrentTool(void);
void TC_ProbeTLS(void);
void TC_ApplyToolOffset(void);
#endif /* TOOLCHANGE_H_INCLUDED */

81
grbl/ToolTable.c 100644
Wyświetl plik

@ -0,0 +1,81 @@
/*
ToolTable.c - Tool Table Library
Part of Grbl-Advanced
Copyright (c) 2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grbl-Advanced is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grbl-Advanced. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ToolTable.h"
#include "Settings.h"
#include "Report.h"
#include <string.h>
static ToolTable_t tool_table = {0};
void TT_Init(void)
{
for(uint8_t i = 0; i < MAX_TOOL_NR; i++)
{
tool_table.tools[i].x_offset = 0.0;
tool_table.tools[i].y_offset = 0.0;
tool_table.tools[i].z_offset = 0.0;
tool_table.tools[i].reserved = 0.0;
}
Settings_ReadToolTable(&tool_table);
}
void TT_Reset(void)
{
for(uint8_t i = 0; i < MAX_TOOL_NR; i++)
{
tool_table.tools[i].x_offset = 0.0;
tool_table.tools[i].y_offset = 0.0;
tool_table.tools[i].z_offset = 0.0;
tool_table.tools[i].reserved = 0.0;
}
Settings_StoreToolTable(&tool_table);
}
void TT_GetToolParams(uint8_t tool_nr, ToolParams_t *params)
{
if(tool_nr < MAX_TOOL_NR)
{
memcpy(params, &tool_table.tools[tool_nr], sizeof(ToolParams_t));
}
else
{
Report_FeedbackMessage(MESSAGE_INVALID_TOOL);
}
}
void TT_SaveToolParams(uint8_t tool_nr, ToolParams_t *params)
{
if(tool_nr < MAX_TOOL_NR)
{
memcpy(&tool_table.tools[tool_nr], params, sizeof(ToolParams_t));
Settings_StoreToolParams(tool_nr, params);
}
else
{
Report_FeedbackMessage(MESSAGE_INVALID_TOOL);
}
}

53
grbl/ToolTable.h 100644
Wyświetl plik

@ -0,0 +1,53 @@
/*
ToolTable.h - Tool Table Library
Part of Grbl-Advanced
Copyright (c) 2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grbl-Advanced is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grbl-Advanced. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOOLTABLE_H_INCLUDED
#define TOOLTABLE_H_INCLUDED
#include <stdint.h>
#define MAX_TOOL_NR 20
#pragma pack(push, 1) // exact fit - no padding
typedef struct
{
float x_offset;
float y_offset;
float z_offset;
float reserved;
} ToolParams_t;
typedef struct
{
ToolParams_t tools[MAX_TOOL_NR];
} ToolTable_t;
#pragma pack(pop)
void TT_Init(void);
void TT_Reset(void);
void TT_GetToolParams(uint8_t tool_nr, ToolParams_t *params);
void TT_SaveToolParams(uint8_t tool_nr, ToolParams_t *params);
#endif /* TOOLTABLE_H_INCLUDED */

Wyświetl plik

@ -71,6 +71,7 @@
#define DEFAULT_HARD_LIMIT_ENABLE 1 // false
#define DEFAULT_INVERT_PROBE_PIN 0 // false
#define DEFAULT_LASER_MODE 0 // false
#define DEFAULT_LATHE_MODE 0 // false
#define DEFAULT_HOMING_ENABLE 1 // false
#define DEFAULT_HOMING_DIR_MASK 0 // move positive dir
#define DEFAULT_HOMING_FEED_RATE 50.0 // mm/min

Wyświetl plik

@ -3,7 +3,7 @@
Part of Grbl-Advanced
Copyright (c) 2014-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -18,6 +18,8 @@
You should have received a copy of the GNU General Public License
along with Grbl-Advanced. If not, see <http://www.gnu.org/licenses/>.
*/
#include <ctype.h>
#include <string.h>
#include "Config.h"
#include "Protocol.h"
#include "System.h"
@ -119,6 +121,38 @@ uint8_t Read_Float(char *line, uint8_t *char_counter, float *float_ptr)
return(true);
}
// Search a float in a string and return it as string
uint8_t ExtractFloat(char *line, int start_idx, char *float_char)
{
unsigned int i = 0;
for(i = start_idx; i < strlen(line); i++)
{
// Search for start of float (digit or '-')
if(!isdigit((unsigned char)line[i]) && (line[i] != '-'))
{
continue;
}
else
{
// Start of float found
int j = 0;
do
{
float_char[j++] = line[i++];
} while(isdigit((unsigned char)line[i]) || line[i] == '.'); // Read float
float_char[j] = '\0';
break;
}
}
// Return position after float in string
return i;
}
// Non-blocking delay function used for general operation and suspend features.
void Delay_sec(float seconds, uint8_t mode)
{

Wyświetl plik

@ -3,7 +3,7 @@
Part of Grbl-Advanced
Copyright (c) 2014-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2017 Patrick F.
Copyright (c) 2017-2020 Patrick F.
Grbl-Advanced is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -121,6 +121,8 @@
// a pointer to the result variable. Returns true when it succeeds
uint8_t Read_Float(char *line, uint8_t *char_counter, float *float_ptr);
uint8_t ExtractFloat(char *line, int start_idx, char *float_char);
// Non-blocking delay function used for general operation and suspend features.
void Delay_sec(float seconds, uint8_t mode);

2
main.c
Wyświetl plik

@ -59,7 +59,6 @@ int main(void)
{
// Init formatted output
Print_Init();
System_Init();
Stepper_Init();
Settings_Init();
@ -80,7 +79,6 @@ int main(void)
// Init SysTick 1ms
SysTick_Init();
if(BIT_IS_TRUE(settings.flags, BITFLAG_HOMING_ENABLE))
{
sys.state = STATE_ALARM;