• 大小: 126KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-13
  • 语言: 其他
  • 标签: 开源CNC  

资源简介

源代码

资源截图

代码片段和文件信息

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

  Copyright (c) 2012 Sungeun K. Jeon

  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 “coolant_control.h“
#include “settings.h“
#include “config.h“
#include “planner.h“

#include 

static uint8_t current_coolant_mode;

void coolant_init()
{
  current_coolant_mode = COOLANT_DISABLE;
  #if ENABLE_M7
    COOLANT_MIST_DDR |= (1 << COOLANT_MIST_BIT);
  #endif
  COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT);
  coolant_stop();
}

void coolant_stop()
{
  #ifdef ENABLE_M7
    COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT);
  #endif
  COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT);
}


void coolant_run(uint8_t mode)
{
  if (mode != current_coolant_mode)
  { 
    plan_synchronize(); // Ensure coolant turns on when specified in program.
    if (mode == COOLANT_FLOOD_ENABLE) { 
      COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT);
    #ifdef ENABLE_M7  
      } else if (mode == COOLANT_MIST_ENABLE) {
          COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT);
    #endif
    } else {
      coolant_stop();
    }
    current_coolant_mode = mode;
  }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-06-25 14:01  控制源码\
     文件       13879  2013-07-30 18:53  控制源码\config.h
     文件        1696  2013-04-05 17:32  控制源码\coolant_control.c
     文件         976  2013-04-05 17:32  控制源码\coolant_control.h
     文件        7638  2013-04-05 17:32  控制源码\COPYING
     目录           0  2013-09-29 12:57  控制源码\Debug\
     文件       83873  2013-07-30 18:53  控制源码\Debug\main.hex
     文件           0  2013-07-30 18:41  控制源码\debug_InProgress.tmp
     文件        7138  2013-04-05 17:32  控制源码\defaults.h
     文件        5599  2013-04-05 17:32  控制源码\eeprom.c
     文件         345  2013-04-05 17:32  控制源码\eeprom.h
     文件       28377  2013-04-05 17:32  控制源码\gcode.c
     文件        4521  2013-04-05 17:32  控制源码\gcode.h
     文件       11355  2013-04-05 17:32  控制源码\limits.c
     文件         905  2013-04-05 17:32  控制源码\limits.h
     文件         875  2012-03-27 08:25  控制源码\main.atsln
     文件       31744  2013-09-28 14:08  控制源码\main.atsuo
     文件        5300  2012-02-02 12:26  控制源码\main.avrgccproj
     文件        4192  2013-04-05 17:32  控制源码\main.c
     文件        7419  2013-07-30 18:53  控制源码\main.cproj
     文件        3328  2013-04-05 17:32  控制源码\Makefile
     文件       14085  2013-04-05 17:32  控制源码\motion_control.c
     文件        1987  2013-04-05 17:32  控制源码\motion_control.h
     文件        4411  2013-04-05 17:32  控制源码\nuts_bolts.c
     文件        4622  2013-04-05 17:32  控制源码\nuts_bolts.h
     文件       25251  2013-04-05 17:32  控制源码\planner.c
     文件        3948  2013-04-05 17:32  控制源码\planner.h
     文件        3682  2013-04-05 17:32  控制源码\print.c
     文件        1113  2013-04-05 17:32  控制源码\print.h
     文件       15181  2013-04-05 17:32  控制源码\protocol.c
     文件        1867  2013-04-05 17:32  控制源码\protocol.h
............此处省略10个文件信息

评论

共有 条评论

相关资源