• 大小: 408KB
    文件类型: .rar
    金币: 2
    下载: 3 次
    发布日期: 2021-06-15
  • 语言: 其他
  • 标签: grbl1.1f  stm32  

资源简介

grbl1.1f在stm32f103c8t6上的移植,参考了github上grbl0.9的移植,但将通讯方式改为usb虚拟串口,同时调整了端口设置。之前在csdn上传的版本有许多bug,已删除,此代码修复了很多问题。

资源截图

代码片段和文件信息

/*
  coolant_control.c - coolant control methods
  Part of Grbl

  Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC

  Grbl 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 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.  If not see .
*/

#include “grbl.h“


void coolant_init()

  HW_GPIO_Init_Out(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN);
  #ifdef ENABLE_M7
  HW_GPIO_Init_Out(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN);
  #endif
  coolant_stop();
}


// Returns current coolant output state. Overrides may alter it from programmed state.
uint8_t coolant_get_state()
{
    uint8_t cl_state = COOLANT_STATE_DISABLE;
  #ifdef INVERT_COOLANT_FLOOD_PIN
    if(0==HW_GPIO_ReadODR(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN))
  #else
    if(HW_GPIO_ReadODR(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN)) 
  #endif
    cl_state |= COOLANT_STATE_FLOOD;
    
  #ifdef ENABLE_M7
    #ifdef INVERT_COOLANT_MIST_PIN
      if(0==HW_GPIO_ReadODR(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN))
    #else
      if(HW_GPIO_ReadODR(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN))
    #endif
        cl_state |= COOLANT_STATE_MIST;
  #endif
  return(cl_state);
}


// Directly called by coolant_init() coolant_set_state() and mc_reset() which can be at
// an interrupt-level. No report flag set but only called by routines that don‘t need it.
void coolant_stop()
{
  #ifdef INVERT_COOLANT_FLOOD_PIN
    HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN1);
  #else
    HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN0);
  #endif
  #ifdef ENABLE_M7
    #ifdef INVERT_COOLANT_MIST_PIN
      HW_GPIO_Write(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN1);
    #else
      HW_GPIO_Write(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN0);
    #endif
  #endif
}


// Main program only. Immediately sets flood coolant running state and also mist coolant 
// if enabled. Also sets a flag to report an update to a coolant state.
// Called by coolant toggle override parking restore parking retract sleep mode g-code
// parser program end and g-code parser coolant_sync().
void coolant_set_state(uint8_t mode)
{
  if(sys.abort) return; // Block during abort.  
  if(mode == COOLANT_DISABLE) coolant_stop(); 
  else
  {
    if(mode & COOLANT_FLOOD_ENABLE) 
    {
      #ifdef INVERT_COOLANT_FLOOD_PIN
        HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN0);
      #else
        HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     103132  2017-09-08 21:05  GRBL1.1f.20170801-STM32-0909\Debug\Exe\GRBL1.1f.20170801-STM32.hex

     文件      45697  2017-09-03 14:03  GRBL1.1f.20170801-STM32-0909\GRBL\config.h

     文件       3752  2017-08-14 20:03  GRBL1.1f.20170801-STM32-0909\GRBL\coolant_control.c

     文件       1469  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\coolant_control.h

     文件       8421  2017-08-15 20:19  GRBL1.1f.20170801-STM32-0909\GRBL\cpu_map.h

     文件      25723  2017-09-08 21:05  GRBL1.1f.20170801-STM32-0909\GRBL\defaults.h

     文件       2361  2017-08-15 19:59  GRBL1.1f.20170801-STM32-0909\GRBL\eeprom.c

     文件       1059  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\eeprom.h

     文件      63915  2017-08-13 22:39  GRBL1.1f.20170801-STM32-0909\GRBL\gcode.c

     文件      10429  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\gcode.h

     文件       3502  2017-08-20 11:05  GRBL1.1f.20170801-STM32-0909\GRBL\grbl.h

     文件       1775  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\jog.c

     文件       1022  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\jog.h

     文件      16464  2017-08-20 10:54  GRBL1.1f.20170801-STM32-0909\GRBL\limits.c

     文件       1238  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\limits.h

     文件       5113  2017-08-26 13:42  GRBL1.1f.20170801-STM32-0909\GRBL\main.c

     文件      19122  2017-08-13 16:44  GRBL1.1f.20170801-STM32-0909\GRBL\motion_control.c

     文件       2674  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\motion_control.h

     文件       5581  2017-08-20 10:02  GRBL1.1f.20170801-STM32-0909\GRBL\nuts_bolts.c

     文件       3076  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\nuts_bolts.h

     文件      27094  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\planner.c

     文件       6893  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\planner.h

     文件       5202  2017-08-12 19:43  GRBL1.1f.20170801-STM32-0909\GRBL\print.c

     文件       1670  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\print.h

     文件       2419  2017-08-12 20:01  GRBL1.1f.20170801-STM32-0909\GRBL\probe.c

     文件       1610  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\probe.h

     文件      42139  2017-08-26 18:39  GRBL1.1f.20170801-STM32-0909\GRBL\protocol.c

     文件       1882  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\protocol.h

     文件      27629  2017-08-26 13:42  GRBL1.1f.20170801-STM32-0909\GRBL\report.c

     文件       4476  2017-08-01 09:27  GRBL1.1f.20170801-STM32-0909\GRBL\report.h

............此处省略106个文件信息

评论

共有 条评论