mirror of
https://github.com/synthetos/g2.git
synced 2026-09-20 17:55:43 +08:00
Merge branch 'edge' into 4c-recovery
This commit is contained in:
Executable → Regular
+2
-1
@@ -24,6 +24,7 @@ xcuserdata
|
||||
*.elf
|
||||
*.hex
|
||||
*.eep
|
||||
*.log
|
||||
*.lss
|
||||
*.map
|
||||
*.srec
|
||||
@@ -55,6 +56,6 @@ g2core/g2core.componentinfo.xml
|
||||
.tags
|
||||
|
||||
g2core/compile_commands.json
|
||||
.vscode/.cortex-debug.peripherals.state.json
|
||||
.vscode/.cortex-debug.registers.state.json
|
||||
.vscode/.cortex-debug.peripherals.state.json
|
||||
.vscode/ipch
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ deploy:
|
||||
# OR, when we move to Master, we remove this setting.
|
||||
prerelease: true
|
||||
api_key:
|
||||
secure: hBB3dHzLM97onnpneoxpewDFYfmcDmeE6FPFRxplaGYROO7SjML8orFCGMLX1cEIlvn4lwzAB+NlE2kreujxiB/gEdZy5DNk8ts+QrbfRXax/VmCNgZYp0tOVn037UFi39rKzx8olbFTImdQypMVf5mdbusY64hTpWrrsZ4uBoU=
|
||||
secure: SFQe2M+qWfu4Lm4Q4W6v+JkSv0d8u5/K6MpEBPT6KUvFcIJb0fm7aHzFcZ03Ul8cx9yjmuGbNGId1hNUXCWxM+MeaIWqnx1cvJAEIQpjZV0nQ6yHeO//jX5PRmEBykNmq/GLqILbHkRAFRxBC4TwtBcRFlS/p7kEC9q3tNac5gg=
|
||||
skip_cleanup: true
|
||||
file:
|
||||
- ${TRAVIS_BUILD_DIR}/g2core/bin/g2core-Othermill-g2v9k-${TRAVIS_TAG}.elf
|
||||
|
||||
Vendored
+15
-1
@@ -31,7 +31,21 @@
|
||||
"string_view": "cpp",
|
||||
"tuple": "cpp",
|
||||
"utility": "cpp",
|
||||
"cmath": "cpp"
|
||||
"cmath": "cpp",
|
||||
"chrono": "cpp",
|
||||
"__bit_reference": "cpp",
|
||||
"__node_handle": "cpp",
|
||||
"bitset": "cpp",
|
||||
"deque": "cpp",
|
||||
"__memory": "cpp",
|
||||
"filesystem": "cpp",
|
||||
"optional": "cpp",
|
||||
"ratio": "cpp",
|
||||
"system_error": "cpp",
|
||||
"vector": "cpp",
|
||||
"array": "cpp",
|
||||
"istream": "cpp",
|
||||
"ostream": "cpp"
|
||||
},
|
||||
"C_Cpp.dimInactiveRegions": true,
|
||||
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 120 }",
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
## Intent
|
||||
|
||||
The g2core **project** is a motion control **application** built on a set of underlying **components**. We want the licensing to reflect this, and to treat using the application as a whole somewhat differently than using the components as a library. The intent of the g2core licensing is summarized as:
|
||||
* Ensure that the g2core project remains open source
|
||||
* Encourage contribution to the project and ensure that most changes and enhancements are returned to the community
|
||||
* Make it easy to use g2core components in free and commercial projects/products- i.e. encourage use of g2core components as a library
|
||||
* Notwithstanding the above, make the application when used as a whole retain GPLv2 provisions
|
||||
|
||||
G2core licensing is based on GPLv2 with the [BeRTOS extension](http://www.bertos.org/discover/license) to enable using component files without invoking GPL copyleft. To this end, all files in the project are licensed under GPLv2. Those files that are considered "components" carry the BeRTOS exception, that allows their use without opening source code that they come in contact with.
|
||||
|
||||
G2core also includes [Motate](https://github.com/synthetos/Motate) hardware abstraction components that are licensed under the same scheme.
|
||||
|
||||
Most of what follows is shamelessly cribbed from the BeRTOS site.
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
### You are free to...
|
||||
|
||||
- Include g2core components within any product, distributed under any license, including commercial licenses and/or closed-source licenses
|
||||
- Modify g2core components as you want under the following conditions:
|
||||
- Attribution - You must declare in a written statement in documentation and source code that you are using g2core components in your application and offer to provide the (possibly modified) g2core source code
|
||||
- Share-alike - If you modify g2core components, you may distribute them only under the original license
|
||||
- Contribution - If you modify g2core components, you must contribute the modifications back to the g2core project
|
||||
|
||||
|
||||
### What you can do with g2core components...
|
||||
|
||||
If you are a company or individual doing commercial embedded products, you can:
|
||||
- Download and use g2core components as you want
|
||||
- Sell products based on g2core components without paying royalties or other fees
|
||||
- Sell products based on g2core components without opening or giving away your other application source code
|
||||
|
||||
|
||||
### What you must do with g2core components...
|
||||
|
||||
If you sell or otherwise distribute code/products that use g2core components you must:
|
||||
* Provide attribution that you are using g2core components in the documentation and source code. Text like this is sufficient:
|
||||
<pre>
|
||||
"This product uses g2core components (http://www.synthetos.com), Copyright 2018"
|
||||
</pre>
|
||||
* If you modified g2core components offer the modified versions for download from your website. Alternately, you can contribute your modifications to the g2core project, where they may be integrated in whole or in part, and/or hosted independently under the project if not integrated.
|
||||
|
||||
|
||||
## Example Text That Includes the BeRTOS Exception
|
||||
|
||||
<pre>
|
||||
/*
|
||||
* gpio.h - Digital IO handling functions
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2015 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2015 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
* Free Software Foundation. You should have received a copy of the GNU General Public
|
||||
* License, version 2 along with the software. If not, see http://www.gnu.org/licenses.
|
||||
*
|
||||
* As a special exception, you may use this file as part of a software library without
|
||||
* restriction. Specifically, if other files instantiate templates or use macros or
|
||||
* inline functions from this file, or you compile this file and link it with other
|
||||
* files to produce an executable, this file does not by itself cause the resulting
|
||||
* executable to be covered by the GNU General Public License. This exception does not
|
||||
* however invalidate any other reasons why the executable file might be covered by the
|
||||
* GNU General Public License.
|
||||
*
|
||||
* THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY
|
||||
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
</pre>
|
||||
@@ -2,15 +2,63 @@
|
||||
|
||||
[](https://travis-ci.org/synthetos/g2) [](http://waffle.io/synthetos/g2) [](http://waffle.io/synthetos/g2)
|
||||
|
||||
# What it is
|
||||
|
||||
g2core is a 9 axes (XYZABC+UVW) motion control system designed for high-performance on small to mid-sized machines.
|
||||
|
||||
* CNC
|
||||
* 3D printing
|
||||
* Laser cutting
|
||||
* Robotics
|
||||
|
||||
Our default target is the [Arduino Due](https://store.arduino.cc/arduino-due), though it can also be used with other boards.
|
||||
|
||||
Some features:
|
||||
|
||||
* 9 axis motion (XYZABC+UVW).
|
||||
* **Note** - UVW is only in the `edge` branch for now.
|
||||
* Jerk controlled motion for acceleration planning (3rd order motion planning)
|
||||
* Status displays ('?' character)
|
||||
* XON/XOFF and RTS/CTS protocol over USB serial
|
||||
* RESTful interface using JSON
|
||||
|
||||
# Mailing List
|
||||
|
||||
For both user and developer discussions of g2core, we recently created a mailing list:
|
||||
|
||||
* https://lists.links.org/mailman/listinfo/g2core
|
||||
|
||||
Please feel welcome to join in. :smile:
|
||||
|
||||
# g2core - Edge Branch
|
||||
|
||||
G2 [Edge](https://github.com/synthetos/g2/tree/edge) is the branch for beta testing new features under development. New features are developed in feature branches and merged into the edge branch. Periodically edge is promoted to master.
|
||||
|
||||
That said, Edge is for the adventurous. It is not guaranteed to be stable, but we do our best to achieve this. For production uses we recommend using the [Master branch](https://github.com/synthetos/g2/tree/master).
|
||||
G2 [Edge](https://github.com/synthetos/g2/tree/edge) is the branch for beta testing new features under development. New features are developed in feature branches and merged into the edge branch. Periodically edge is promoted to (stable) master.
|
||||
|
||||
Edge is for the adventurous. It is not guaranteed to be stable, but we do our best to achieve this. For production uses we recommend using the [Master branch](https://github.com/synthetos/g2/tree/master).
|
||||
|
||||
## Firmware Build 101 `{fb:101.xx}`
|
||||
### Feature Enhancements
|
||||
New features added. See linked issues and pull requests for details
|
||||
- Added [UVW axes](https://github.com/synthetos/g2/wiki/9-Axis-UVW-Operation) for 9 axis control. [See also: Issue 304](https://github.com/synthetos/g2/issues/304)
|
||||
- Added [Enhanced Feedhold Functions](https://github.com/synthetos/g2/wiki/Feedhold,-Resume,-and-Other-Simple-Commands)
|
||||
- Added explicit [Job Kill ^d](https://github.com/synthetos/g2/wiki/Feedhold,-Resume,-and-Other-Simple-Commands#job-kill) - has the effect of an M30 (program end)
|
||||
- Documented [Communications Startup Tests](https://github.com/synthetos/g2/wiki/g2core-Communications#enqack---checking-for-clean-startup)
|
||||
|
||||
|
||||
### Internal Changes and Bug Fixes
|
||||
Many things have changed in the internals for this very large pull request. The following list highlights some of these changes but is not meant to be comprehensive.
|
||||
- Added explicit typing and type testing to JSON variables.
|
||||
- As part of the above, 32bit integers are not float casts, and therefore retain full accuracy. Line numbers may now reliably go to 2,000,000,000
|
||||
- Movement towards getters and setters as initial stage of refactoring the Big Table :)
|
||||
- Bugfix: Fixed root finding problem in feedhold exit velocity calculation
|
||||
- Bugfix: fixed bug in B and C axis assignment in coordinate rotation code
|
||||
- PR #334 A, B, C axes radius defaults to use motors 4, 5, & 6
|
||||
- PR #336, Issue #336 partial solution to coolant initialization
|
||||
- PR #299, Issue #298 fix for reading nested JSON value errors
|
||||
|
||||
## Feature Enhancements
|
||||
|
||||
### Firmware Build 101 `{fb:101.xx}`
|
||||
|
||||
The fb:101 release is a mostly internal change from the fb:100 branches. Here are the highlights, more detailed on each item are further below:
|
||||
- Updated motion execution at the segment (smallest) level to be linear velocity instead of constant velocity, resulting in notably smoother motion and more faithful execution of the jerk limitations. (Incidentally, the sound of the motors is also slightly quieter and more "natural.")
|
||||
@@ -26,14 +74,47 @@ The fb:101 release is a mostly internal change from the fb:100 branches. Here ar
|
||||
- Experimental setting to have traverse (G0) use the 'high jerk' axis settings.
|
||||
- Outputs are now configured at board initialization (and later) to honor the settings more faithfully. This includes setting the pin high or low as soon as possible.
|
||||
|
||||
### Firmware Build 100 `{fb:100.xx}`
|
||||
|
||||
The fb:100 release is a major change from the fb:089 and earlier branches. It represents about a year of development and has many major feature enhancements summarized below. These are described in more detail in the rest of this readme and the linked wiki pages.
|
||||
- New Gcode and CNC features
|
||||
- 3d printing support, including [Marlin Compatibility](https://github.com/synthetos/g2/wiki/Marlin-Compatibility)
|
||||
- GPIO system enhancements
|
||||
- Planner enhancements and other operating improvements for high-speed operation
|
||||
- Initial support for new processors, including the ARM M7
|
||||
|
||||
### Project Changes
|
||||
|
||||
The project is now called g2core (even if the repo remains g2). As of this release the g2core code base is split from the TinyG code base. TinyG will continue to be supported for the Xmega 8-bit platform, and new features will be added, specifically as related to continued support for CNC milling applications. The g2core project will focus on various ARM platforms, as it currently does, and add functions that are not possible in the 8-bit platform.
|
||||
|
||||
In this release the Motate hardware abstraction layer has been split into a separate project and is included in g2core as a git submodule. This release also provides better support for cross platform / cross target compilation. A summary of project changes is provided below, with details in this readme and linked wiki pages.
|
||||
- Motate submodule
|
||||
- Cross platform / cross target support
|
||||
- Multiple processor support - ARM M3, M4, M7 cores
|
||||
- Device tree / multiple motor types
|
||||
- Simplified host-to-board communication protocol (line mode)
|
||||
- NodeJS host module for host-to-board communications
|
||||
|
||||
### More To Come
|
||||
The fb:100 release is the base for number of other enhancements in the works and planned, including:
|
||||
- Further enhancements to GPIO system
|
||||
- Additional JSON processing and UI support
|
||||
- Enhancements to 3d printer support, including a simplified g2 printer dialect
|
||||
|
||||
## Changelog for Edge Branch
|
||||
|
||||
### Edge branch, Build 101.xx
|
||||
|
||||
This build is primarily focused on support for the new boards based on the Atmel SamS70 family, as well as refining the motion control and long awaited feature enhancements. This list will be added to as development proceed.s
|
||||
|
||||
### Edge branch, Build 100.xx
|
||||
|
||||
Build 100.xx has a number of changes, mostly related to extending Gcode support and supporting 3D printing using g2core. These include temperature controls, auto-bed leveling, planner performance improvements and active JSON comments in Gcode.
|
||||
|
||||
Communications has advanced to support a linemode protocol to greatly simplify host communications and flow control for very rapid Gcode streams. Please read the Communications pages for details. Also see the NodeJS communications module docs if you are building a UI or host controller.
|
||||
|
||||
Build 100.xx also significantly advances the project structure to support multiple processor architectures, hardware configurations and machine configurations in the same code base. Motate has been cleaved off into its own subproject. We recommend carefully reading the Dev pages if you are coding or compiling.
|
||||
|
||||
#### Functional Changes:
|
||||
|
||||
*Note: Click the header next to the arrow to expand and display the details.*
|
||||
@@ -112,8 +193,8 @@ This build is primarily focused on support for the new boards based on the Atmel
|
||||
|
||||
<details><summary><strong>Planner settings control from board files</strong></summary>
|
||||
|
||||
- The defines `PLANNER_BUFFER_POOL_SIZE` and `MIN_SEGMENT_MS` are now set in the `board/*/hardware.h` files.
|
||||
- `PLANNER_BUFFER_POOL_SIZE` sets the size of the planner buffer array.
|
||||
- The defines `PLANNER_QUEUE_SIZE` and `MIN_SEGMENT_MS` are now set in the `board/*/hardware.h` files.
|
||||
- `PLANNER_QUEUE_SIZE` sets the size of the planner buffer array.
|
||||
- Default value if not defined: `48`
|
||||
- `MIN_SEGMENT_MS` sets the minimum segment time (in milliseconds) and several other settings that are comuted based on it.
|
||||
- Default values if not defined: `0.75`
|
||||
|
||||
Binary file not shown.
@@ -2,7 +2,7 @@ PROGRAMMING THE DUE FROM OS X
|
||||
=============================
|
||||
|
||||
These notes are also available here and may be more up-to-date:
|
||||
https://github.com/synthetos/g2/wiki/Programming-TinyG2
|
||||
https://github.com/synthetos/g2/wiki/Flashing-g2core-with-OSX
|
||||
|
||||
Download the Arduino 1.5.2 BETA (not the 1.0.5 release at the top of the page) from http://arduino.cc/en/Main/Software for OS X.
|
||||
|
||||
@@ -37,4 +37,4 @@ The output should look something like this (the numbers after cu.usbmodem will b
|
||||
|
||||
Now disconnect the Due and plug the USB cable into the other port. You now have a Due/TinyG2.
|
||||
|
||||
-Synthetos Team
|
||||
-Synthetos Team
|
||||
|
||||
@@ -5,34 +5,36 @@
|
||||
for (n=1; n<=6; n++) {
|
||||
console.log(`
|
||||
#if (MOTORS >= ${n})
|
||||
{ "${n}","${n}ma", _fip, 0, st_print_ma, get_ui8, st_set_ma, (float *)&st_cfg.mot[MOTOR_${n}].motor_map, M${n}_MOTOR_MAP },
|
||||
{ "${n}","${n}sa", _fip, 3, st_print_sa, get_flt, st_set_sa, (float *)&st_cfg.mot[MOTOR_${n}].step_angle, M${n}_STEP_ANGLE },
|
||||
{ "${n}","${n}tr", _fipc, 4, st_print_tr, get_flt, st_set_tr, (float *)&st_cfg.mot[MOTOR_${n}].travel_rev, M${n}_TRAVEL_PER_REV },
|
||||
{ "${n}","${n}mi", _fip, 0, st_print_mi, get_int, st_set_mi, (float *)&st_cfg.mot[MOTOR_${n}].microsteps, M${n}_MICROSTEPS },
|
||||
{ "${n}","${n}su", _fipi, 5, st_print_su, st_get_su,st_set_su, (float *)&st_cfg.mot[MOTOR_${n}].steps_per_unit, M${n}_STEPS_PER_UNIT },
|
||||
{ "${n}","${n}po", _fip, 0, st_print_po, get_ui8, set_01, (float *)&st_cfg.mot[MOTOR_${n}].polarity, M${n}_POLARITY },
|
||||
{ "${n}","${n}pm", _fip, 0, st_print_pm, st_get_pm,st_set_pm, (float *)&cs.null, M${n}_POWER_MODE },
|
||||
{ "${n}","${n}pl", _fip, 3, st_print_pl, get_flt, st_set_pl, (float *)&st_cfg.mot[MOTOR_${n}].power_level, M${n}_POWER_LEVEL },
|
||||
// { "${n}","${n}pi", _fip, 3, st_print_pi, get_flt, st_set_pi, (float *)&st_cfg.mot[MOTOR_${n}].power_idle, M${n}_POWER_IDLE },
|
||||
// { "${n}","${n}mt", _fip, 2, st_print_mt, get_flt, st_set_mt, (float *)&st_cfg.mot[MOTOR_${n}].motor_timeout, M${n}_MOTOR_TIMEOUT },
|
||||
{ "${n}","${n}ma", _fip, 0, st_print_ma, st_get_ma, st_set_ma, &st_cfg.mot[MOTOR_${n}].motor_map, M${n}_MOTOR_MAP },
|
||||
{ "${n}","${n}sa", _fip, 3, st_print_sa, st_get_sa, st_set_sa, &st_cfg.mot[MOTOR_${n}].step_angle, M${n}_STEP_ANGLE },
|
||||
{ "${n}","${n}tr", _fipc, 4, st_print_tr, st_get_tr, st_set_tr, &st_cfg.mot[MOTOR_${n}].travel_rev, M${n}_TRAVEL_PER_REV },
|
||||
{ "${n}","${n}su", _fipi, 5, st_print_su, st_get_su, st_set_su, &st_cfg.mot[MOTOR_${n}].steps_per_unit, M${n}_STEPS_PER_UNIT },
|
||||
{ "${n}","${n}mi", _fip, 0, st_print_mi, st_get_mi, st_set_mi, &st_cfg.mot[MOTOR_${n}].microsteps, M${n}_MICROSTEPS },
|
||||
{ "${n}","${n}po", _fip, 0, st_print_po, st_get_po, st_set_po, &st_cfg.mot[MOTOR_${n}].polarity, M${n}_POLARITY },
|
||||
{ "${n}","${n}pm", _fip, 0, st_print_pm, st_get_pm, st_set_pm, &cs.null, M${n}_POWER_MODE },
|
||||
{ "${n}","${n}pl", _fip, 3, st_print_pl, st_get_pl, st_set_pl, &st_cfg.mot[MOTOR_${n}].power_level, M${n}_POWER_LEVEL },
|
||||
{ "${n}","${n}ep", _iip, 0, st_print_ep, st_get_ep, st_set_ep, nullptr, M${n}_ENABLE_POLARITY },
|
||||
{ "${n}","${n}sp", _iip, 0, st_print_sp, st_get_sp, st_set_sp, nullptr, M${n}_STEP_POLARITY },
|
||||
// { "${n}","${n}pi", _fip, 3, st_print_pi, st_get_pi, st_set_pi, &st_cfg.mot[MOTOR_${n}].power_idle, M${n}_POWER_IDLE },
|
||||
// { "${n}","${n}mt", _fip, 2, st_print_mt, st_get_mt, st_set_mt, &st_cfg.mot[MOTOR_${n}].motor_timeout, M${n}_MOTOR_TIMEOUT },
|
||||
#ifdef MOTOR_${n}_IS_TRINAMIC
|
||||
{ "${n}","${n}ts", _f0, 0, tx_print_nul, motor_${n}.get_ts_fn, set_ro, (float *)&motor_${n}, 0 },
|
||||
{ "${n}","${n}pth", _fip, 0, tx_print_nul, motor_${n}.get_pth_fn, motor_${n}.set_pth_fn, (float *)&motor_${n}, M${n}_TMC2130_TPWMTHRS },
|
||||
{ "${n}","${n}cth", _fip, 0, tx_print_nul, motor_${n}.get_cth_fn, motor_${n}.set_cth_fn, (float *)&motor_${n}, M${n}_TMC2130_TCOOLTHRS },
|
||||
{ "${n}","${n}hth", _fip, 0, tx_print_nul, motor_${n}.get_hth_fn, motor_${n}.set_hth_fn, (float *)&motor_${n}, M${n}_TMC2130_THIGH },
|
||||
{ "${n}","${n}sgt", _fip, 0, tx_print_nul, motor_${n}.get_sgt_fn, motor_${n}.set_sgt_fn, (float *)&motor_${n}, M${n}_TMC2130_SGT },
|
||||
{ "${n}","${n}sgr", _f0, 0, tx_print_nul, motor_${n}.get_sgr_fn, set_ro, (float *)&motor_${n}, 0 },
|
||||
{ "${n}","${n}csa", _f0, 0, tx_print_nul, motor_${n}.get_csa_fn, set_ro, (float *)&motor_${n}, 0 },
|
||||
{ "${n}","${n}sgs", _f0, 0, tx_print_nul, motor_${n}.get_sgs_fn, set_ro, (float *)&motor_${n}, 0 },
|
||||
{ "${n}","${n}tbl", _fip, 0, tx_print_nul, motor_${n}.get_tbl_fn, motor_${n}.set_tbl_fn, (float *)&motor_${n}, M${n}_TMC2130_TBL },
|
||||
{ "${n}","${n}pgrd",_fip, 0, tx_print_nul, motor_${n}.get_pgrd_fn,motor_${n}.set_pgrd_fn, (float *)&motor_${n}, M${n}_TMC2130_PWM_GRAD },
|
||||
{ "${n}","${n}pamp",_fip, 0, tx_print_nul, motor_${n}.get_pamp_fn,motor_${n}.set_pamp_fn, (float *)&motor_${n}, M${n}_TMC2130_PWM_AMPL },
|
||||
{ "${n}","${n}hend",_fip, 0, tx_print_nul, motor_${n}.get_hend_fn,motor_${n}.set_hend_fn, (float *)&motor_${n}, M${n}_TMC2130_HEND },
|
||||
{ "${n}","${n}hsrt",_fip, 0, tx_print_nul, motor_${n}.get_hsrt_fn,motor_${n}.set_hsrt_fn, (float *)&motor_${n}, M${n}_TMC2130_HSTRT },
|
||||
{ "${n}","${n}smin",_fip, 0, tx_print_nul, motor_${n}.get_smin_fn,motor_${n}.set_smin_fn, (float *)&motor_${n}, M${n}_TMC2130_SMIN },
|
||||
{ "${n}","${n}smax",_fip, 0, tx_print_nul, motor_${n}.get_smax_fn,motor_${n}.set_smax_fn, (float *)&motor_${n}, M${n}_TMC2130_SMAX },
|
||||
{ "${n}","${n}sup", _fip, 0, tx_print_nul, motor_${n}.get_sup_fn, motor_${n}.set_sup_fn, (float *)&motor_${n}, M${n}_TMC2130_SUP },
|
||||
{ "${n}","${n}sdn", _fip, 0, tx_print_nul, motor_${n}.get_sdn_fn, motor_${n}.set_sdn_fn, (float *)&motor_${n}, M${n}_TMC2130_SDN },
|
||||
{ "${n}","${n}ts", _f0, 0, tx_print_nul, motor_${n}.get_ts_fn, set_ro, &motor_${n}, 0 },
|
||||
{ "${n}","${n}pth", _fip, 0, tx_print_nul, motor_${n}.get_pth_fn, motor_${n}.set_pth_fn, &motor_${n}, M${n}_TMC2130_TPWMTHRS },
|
||||
{ "${n}","${n}cth", _fip, 0, tx_print_nul, motor_${n}.get_cth_fn, motor_${n}.set_cth_fn, &motor_${n}, M${n}_TMC2130_TCOOLTHRS },
|
||||
{ "${n}","${n}hth", _fip, 0, tx_print_nul, motor_${n}.get_hth_fn, motor_${n}.set_hth_fn, &motor_${n}, M${n}_TMC2130_THIGH },
|
||||
{ "${n}","${n}sgt", _fip, 0, tx_print_nul, motor_${n}.get_sgt_fn, motor_${n}.set_sgt_fn, &motor_${n}, M${n}_TMC2130_SGT },
|
||||
{ "${n}","${n}sgr", _f0, 0, tx_print_nul, motor_${n}.get_sgr_fn, set_ro, &motor_${n}, 0 },
|
||||
{ "${n}","${n}csa", _f0, 0, tx_print_nul, motor_${n}.get_csa_fn, set_ro, &motor_${n}, 0 },
|
||||
{ "${n}","${n}sgs", _f0, 0, tx_print_nul, motor_${n}.get_sgs_fn, set_ro, &motor_${n}, 0 },
|
||||
{ "${n}","${n}tbl", _fip, 0, tx_print_nul, motor_${n}.get_tbl_fn, motor_${n}.set_tbl_fn, &motor_${n}, M${n}_TMC2130_TBL },
|
||||
{ "${n}","${n}pgrd",_fip, 0, tx_print_nul, motor_${n}.get_pgrd_fn,motor_${n}.set_pgrd_fn, &motor_${n}, M${n}_TMC2130_PWM_GRAD },
|
||||
{ "${n}","${n}pamp",_fip, 0, tx_print_nul, motor_${n}.get_pamp_fn,motor_${n}.set_pamp_fn, &motor_${n}, M${n}_TMC2130_PWM_AMPL },
|
||||
{ "${n}","${n}hend",_fip, 0, tx_print_nul, motor_${n}.get_hend_fn,motor_${n}.set_hend_fn, &motor_${n}, M${n}_TMC2130_HEND },
|
||||
{ "${n}","${n}hsrt",_fip, 0, tx_print_nul, motor_${n}.get_hsrt_fn,motor_${n}.set_hsrt_fn, &motor_${n}, M${n}_TMC2130_HSTRT },
|
||||
{ "${n}","${n}smin",_fip, 0, tx_print_nul, motor_${n}.get_smin_fn,motor_${n}.set_smin_fn, &motor_${n}, M${n}_TMC2130_SMIN },
|
||||
{ "${n}","${n}smax",_fip, 0, tx_print_nul, motor_${n}.get_smax_fn,motor_${n}.set_smax_fn, &motor_${n}, M${n}_TMC2130_SMAX },
|
||||
{ "${n}","${n}sup", _fip, 0, tx_print_nul, motor_${n}.get_sup_fn, motor_${n}.set_sup_fn, &motor_${n}, M${n}_TMC2130_SUP },
|
||||
{ "${n}","${n}sdn", _fip, 0, tx_print_nul, motor_${n}.get_sdn_fn, motor_${n}.set_sdn_fn, &motor_${n}, M${n}_TMC2130_SDN },
|
||||
#endif
|
||||
#endif`);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ Global
|
||||
sbv300|ARM = sbv300|ARM
|
||||
Shapeoko2|ARM = Shapeoko2|ARM
|
||||
shopbotShield|ARM = shopbotShield|ARM
|
||||
ShopbotTestV9|ARM = ShopbotTestV9|ARM
|
||||
Stub|ARM = Stub|ARM
|
||||
TestQuadratic|ARM = TestQuadratic|ARM
|
||||
TestQuintic|ARM = TestQuintic|ARM
|
||||
@@ -57,6 +58,8 @@ Global
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.Shapeoko2|ARM.Build.0 = Shapeoko2|ARM
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.shopbotShield|ARM.ActiveCfg = shopbotShield|ARM
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.shopbotShield|ARM.Build.0 = shopbotShield|ARM
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.ShopbotTestV9|ARM.ActiveCfg = G2v9k|ARM
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.ShopbotTestV9|ARM.Build.0 = G2v9k|ARM
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.Stub|ARM.ActiveCfg = Shapeoko2|ARM
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.TestQuadratic|ARM.ActiveCfg = TestQuadratic|ARM
|
||||
{44EA8FEC-55D7-4149-8A78-A574FC26BF51}.TestQuadratic|ARM.Build.0 = TestQuadratic|ARM
|
||||
@@ -83,6 +86,7 @@ Global
|
||||
{D7779B24-5CD6-4A1B-893C-2CAE8CF7A3A0}.sbv300|ARM.ActiveCfg = Stub|ARM
|
||||
{D7779B24-5CD6-4A1B-893C-2CAE8CF7A3A0}.Shapeoko2|ARM.ActiveCfg = Stub|ARM
|
||||
{D7779B24-5CD6-4A1B-893C-2CAE8CF7A3A0}.shopbotShield|ARM.ActiveCfg = Stub|ARM
|
||||
{D7779B24-5CD6-4A1B-893C-2CAE8CF7A3A0}.ShopbotTestV9|ARM.ActiveCfg = Stub|ARM
|
||||
{D7779B24-5CD6-4A1B-893C-2CAE8CF7A3A0}.Stub|ARM.ActiveCfg = Stub|ARM
|
||||
{D7779B24-5CD6-4A1B-893C-2CAE8CF7A3A0}.TestQuadratic|ARM.ActiveCfg = Stub|ARM
|
||||
{D7779B24-5CD6-4A1B-893C-2CAE8CF7A3A0}.TestQuintic|ARM.ActiveCfg = Stub|ARM
|
||||
|
||||
+5
-2
@@ -1,8 +1,8 @@
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
# Copyright (c) 2012 - 2016 Robert Giseburt
|
||||
# Copyright (c) 2013 - 2016 Alden S. Hart Jr.
|
||||
# Copyright (c) 2012 - 2018 Robert Giseburt
|
||||
# Copyright (c) 2013 - 2018 Alden S. Hart Jr.
|
||||
#
|
||||
# This file is part of the g2core project.
|
||||
#
|
||||
@@ -61,6 +61,9 @@ endif
|
||||
ifeq ($(DEBUG),3)
|
||||
DEVICE_DEFINES += DEBUG=1 IN_DEBUGGER=1 DEBUG_SEMIHOSTING=1
|
||||
endif
|
||||
#ifeq ($(DEBUG),3)
|
||||
# DEVICE_DEFINES += DEBUG=1 IN_DEBUGGER=1 DEBUG_SEMIHOSTING=1
|
||||
#endif
|
||||
|
||||
# TOOLS_VERSION = 6.2u1
|
||||
TOOLS_VERSION = 7u2
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
/*
|
||||
* alarm.cpp - canonical machine alarm handlers
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2018 Alden S Hart, Jr.
|
||||
* Copyright (c) 2014 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
* Free Software Foundation. You should have received a copy of the GNU General Public
|
||||
* License, version 2 along with the software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* As a special exception, you may use this file as part of a software library without
|
||||
* restriction. Specifically, if other files instantiate templates or use macros or
|
||||
* inline functions from this file, or you compile this file and link it with other
|
||||
* files to produce an executable, this file does not by itself cause the resulting
|
||||
* executable to be covered by the GNU General Public License. This exception does not
|
||||
* however invalidate any other reasons why the executable file might be covered by the
|
||||
* GNU General Public License.
|
||||
*
|
||||
* THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY
|
||||
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "g2core.h" // #1
|
||||
#include "config.h" // #2
|
||||
#include "gcode.h" // #3
|
||||
#include "canonical_machine.h"
|
||||
#include "planner.h"
|
||||
#include "report.h"
|
||||
#include "spindle.h"
|
||||
#include "coolant.h"
|
||||
#include "temperature.h"
|
||||
#include "util.h"
|
||||
|
||||
/****************************************************************************************
|
||||
* ALARM, SHUTDOWN, and PANIC are nested dolls.
|
||||
*
|
||||
* cm_alrm() - invoke alarm from command
|
||||
* cm_shutd() - invoke shutdown from command
|
||||
* cm_pnic() - invoke panic from command
|
||||
* cm_clr() - clear alarm or shutdown from command
|
||||
*
|
||||
* The alarm states can be invoked from the above commands for testing and clearing
|
||||
*/
|
||||
stat_t cm_alrm(nvObj_t *nv) // invoke alarm from command
|
||||
{
|
||||
cm_alarm(STAT_ALARM, "sent by host");
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
stat_t cm_shutd(nvObj_t *nv) // invoke shutdown from command
|
||||
{
|
||||
cm_shutdown(STAT_SHUTDOWN, "sent by host");
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
stat_t cm_pnic(nvObj_t *nv) // invoke panic from command
|
||||
{
|
||||
cm_panic(STAT_PANIC, "sent by host");
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
stat_t cm_clr(nvObj_t *nv) // clear alarm or shutdown from command line
|
||||
{
|
||||
cm_clear();
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* cm_clear() - clear ALARM and SHUTDOWN states
|
||||
* cm_parse_clear() - parse incoming gcode for M30 or M2 clears if in ALARM state
|
||||
*
|
||||
* Parse clear interprets an M30 or M2 PROGRAM_END as a $clear condition and clear ALARM
|
||||
* but not SHUTDOWN or PANIC. Assumes Gcode string has no leading or embedded whitespace
|
||||
*/
|
||||
|
||||
void cm_clear()
|
||||
{
|
||||
if (cm->machine_state == MACHINE_ALARM) {
|
||||
cm->machine_state = MACHINE_PROGRAM_STOP;
|
||||
} else if (cm->machine_state == MACHINE_SHUTDOWN) {
|
||||
cm->machine_state = MACHINE_READY;
|
||||
}
|
||||
}
|
||||
|
||||
void cm_parse_clear(const char *s)
|
||||
{
|
||||
if (cm->machine_state == MACHINE_ALARM) {
|
||||
if (toupper(s[0]) == 'M') {
|
||||
if (( (s[1]=='3') && (s[2]=='0') && (s[3]==0)) || ((s[1]=='2') && (s[2]==0) )) {
|
||||
cm_clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* cm_is_alarmed() - return alarm status code or OK if no alarms
|
||||
*/
|
||||
|
||||
stat_t cm_is_alarmed()
|
||||
{
|
||||
if (cm->machine_state == MACHINE_ALARM) { return (STAT_COMMAND_REJECTED_BY_ALARM); }
|
||||
if (cm->machine_state == MACHINE_SHUTDOWN) { return (STAT_COMMAND_REJECTED_BY_SHUTDOWN); }
|
||||
if (cm->machine_state == MACHINE_PANIC) { return (STAT_COMMAND_REJECTED_BY_PANIC); }
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* cm_halt() - stop motion, spindle, coolant and heaters immediately
|
||||
* cm_halt_motion() - stop motion immediately. Does not affect spindle, coolant, or other IO
|
||||
*
|
||||
* Stop motors and reset all system states accordingly.
|
||||
* Does not de-energize motors as in some cases the motors must remain energized
|
||||
* in order to prevent an axis from crashing.
|
||||
*/
|
||||
|
||||
void cm_halt(void)
|
||||
{
|
||||
cm_halt_motion();
|
||||
spindle_control_immediate(SPINDLE_OFF);
|
||||
coolant_control_immediate(COOLANT_OFF, COOLANT_BOTH);
|
||||
temperature_init();
|
||||
}
|
||||
|
||||
void cm_halt_motion(void)
|
||||
{
|
||||
mp_halt_runtime(); // stop the runtime. Do this immediately. (Reset is in cm_clear)
|
||||
canonical_machine_reset(cm); // halt the currently active machine
|
||||
cm->cycle_type = CYCLE_NONE; // Note: leaves machine_state alone
|
||||
cm->motion_state = MOTION_STOP;
|
||||
cm->hold_state = FEEDHOLD_OFF;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* cm_alarm() - enter ALARM state
|
||||
*
|
||||
* An ALARM sets the ALARM machine state, starts a feedhold to stop motion, stops the
|
||||
* spindle, turns off coolant, clears out queued planner moves and serial input,
|
||||
* and rejects new action commands (gcode blocks, SET commands, and other actions)
|
||||
* until the alarm is cleared.
|
||||
*
|
||||
* ALARM is typically entered by a soft limit or a limit switch being hit. In the
|
||||
* limit switch case the INPUT_ACTION will override the feedhold - i.e. if the
|
||||
* input action is "FAST_STOP" or "HALT" that setting will take precedence over
|
||||
* the feedhold native to the alarm function.
|
||||
*
|
||||
* Gcode and machine state is preserved. It may be possible to recover the job from
|
||||
* an alarm, but in many cases this is not possible. Since ALARM attempts to preserve
|
||||
* Gcode and machine state it does not END the job.
|
||||
*
|
||||
* ALARM may also be invoked from the command line using {alarm:n} or $alarm
|
||||
* ALARM can be manually cleared by entering: {clear:n}, {clr:n}, $clear, or $clr
|
||||
* ALARMs will also clear on receipt of an M30 or M2 command if one is received
|
||||
* while draining the host command queue.
|
||||
*/
|
||||
|
||||
stat_t cm_alarm(const stat_t status, const char *msg)
|
||||
{
|
||||
if ((cm->machine_state == MACHINE_ALARM) || (cm->machine_state == MACHINE_SHUTDOWN) ||
|
||||
(cm->machine_state == MACHINE_PANIC)) {
|
||||
return (STAT_OK); // don't alarm if already in an alarm state
|
||||
}
|
||||
cm_request_feedhold(FEEDHOLD_TYPE_SCRAM, FEEDHOLD_EXIT_ALARM); // fast stop and alarm
|
||||
rpt_exception(status, msg); // send alarm message
|
||||
sr_request_status_report(SR_REQUEST_TIMED);
|
||||
return (status);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* cm_shutdown() - enter shutdown state
|
||||
*
|
||||
* SHUTDOWN stops all motion, spindle and coolant immediately, sets a SHUTDOWN machine
|
||||
* state, clears out queued moves and serial input, and rejects new action commands
|
||||
* (gcode blocks, SET commands, and some others).
|
||||
*
|
||||
* Shutdown is typically invoked as an electrical input signal sent to the board as
|
||||
* part of an external emergency stop (Estop). Shutdown is meant to augment but not
|
||||
* replace the external Estop functions that shut down power to motors, spindles and
|
||||
* other moving parts.
|
||||
*
|
||||
* Shutdown may also be invoked from the command line using {shutd:n} or $shutd
|
||||
* Shutdown must be manually cleared by entering: {clear:n}, {clr:n}, $clear, or $clr
|
||||
* Shutdown does not clear on M30 or M2 Gcode commands
|
||||
*/
|
||||
|
||||
stat_t cm_shutdown(const stat_t status, const char *msg)
|
||||
{
|
||||
if ((cm->machine_state == MACHINE_SHUTDOWN) || (cm->machine_state == MACHINE_PANIC)) {
|
||||
return (STAT_OK); // don't shutdown if shutdown or panic'd
|
||||
}
|
||||
cm_request_feedhold(FEEDHOLD_TYPE_SCRAM, FEEDHOLD_EXIT_SHUTDOWN); // fast stop and shutdown
|
||||
|
||||
// spindle_reset(); // stop spindle immediately and set speed to 0 RPM
|
||||
// coolant_reset(); // stop coolant immediately
|
||||
// temperature_reset(); // turn off heaters and fans
|
||||
// cm_queue_flush(&cm1); // flush all queues and reset positions
|
||||
|
||||
for (uint8_t i = 0; i < HOMING_AXES; i++) { // unhome axes and the machine
|
||||
cm->homed[i] = false;
|
||||
}
|
||||
cm->homing_state = HOMING_NOT_HOMED;
|
||||
|
||||
// cm1.machine_state = MACHINE_SHUTDOWN; // shut down both machines...
|
||||
// cm2.machine_state = MACHINE_SHUTDOWN; //...do this after all other activity
|
||||
rpt_exception(status, msg); // send exception report
|
||||
sr_request_status_report(SR_REQUEST_TIMED);
|
||||
return (status);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* cm_panic() - enter panic state
|
||||
*
|
||||
* PANIC occurs if the firmware has detected an unrecoverable internal error
|
||||
* such as an assertion failure or a code condition that should never occur.
|
||||
* It sets PANIC machine state, and leaves the system inspect able (if possible).
|
||||
*
|
||||
* PANIC can only be exited by a hardware reset or soft reset (^x)
|
||||
*/
|
||||
|
||||
stat_t cm_panic(const stat_t status, const char *msg)
|
||||
{
|
||||
debug_trap(msg);
|
||||
|
||||
if (cm->machine_state == MACHINE_PANIC) { // only do this once
|
||||
return (STAT_OK);
|
||||
}
|
||||
cm_halt_motion(); // halt motors (may have already been done from GPIO)
|
||||
spindle_reset(); // stop spindle immediately and set speed to 0 RPM
|
||||
coolant_reset(); // stop coolant immediately
|
||||
temperature_reset(); // turn off heaters and fans
|
||||
|
||||
cm1.machine_state = MACHINE_PANIC; // don't reset anything. Panics are not recoverable
|
||||
cm2.machine_state = MACHINE_PANIC; // don't reset anything. Panics are not recoverable
|
||||
rpt_exception(status, msg); // send panic report
|
||||
return (status);
|
||||
}
|
||||
Executable → Regular
+24
-31
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* hardware.cpp - general hardware support functions
|
||||
* For: /board/Archim
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2015 Alden S. Hart, Jr.
|
||||
@@ -93,15 +94,18 @@ void _get_id(char *id)
|
||||
***********************************************************************************/
|
||||
|
||||
/*
|
||||
* hw_get_fb() - get firmware build number
|
||||
* hw_get_fv() - get firmware version number
|
||||
* hw_get_hp() - get hardware platform string
|
||||
* hw_get_hv() - get hardware version string
|
||||
* hw_get_fbs() - get firmware build string
|
||||
*/
|
||||
|
||||
stat_t hw_get_fbs(nvObj_t *nv)
|
||||
{
|
||||
nv->valuetype = TYPE_STRING;
|
||||
ritorno(nv_copy_string(nv, G2CORE_FIRMWARE_BUILD_STRING));
|
||||
return (STAT_OK);
|
||||
}
|
||||
stat_t hw_get_fb(nvObj_t *nv) { return (get_float(nv, cs.fw_build)); }
|
||||
stat_t hw_get_fv(nvObj_t *nv) { return (get_float(nv, cs.fw_version)); }
|
||||
stat_t hw_get_hp(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_PLATFORM)); }
|
||||
stat_t hw_get_hv(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_VERSION)); }
|
||||
stat_t hw_get_fbs(nvObj_t *nv) { return (get_string(nv, G2CORE_FIRMWARE_BUILD_STRING)); }
|
||||
|
||||
/*
|
||||
* hw_get_fbc() - get configuration settings file
|
||||
@@ -145,15 +149,6 @@ stat_t hw_flash(nvObj_t *nv)
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* hw_set_hv() - set hardware version number
|
||||
*/
|
||||
stat_t hw_set_hv(nvObj_t *nv)
|
||||
{
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
* TEXT MODE SUPPORT
|
||||
* Functions to print variables from the cfgArray table
|
||||
@@ -161,22 +156,20 @@ stat_t hw_set_hv(nvObj_t *nv)
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
static const char fmt_fb[] = "[fb] firmware build %18.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build \"%s\"\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config \"%s\"\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_cv[] = "[cv] configuration version%11.2f\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15.2f\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%16.2f\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%21s\n";
|
||||
static const char fmt_fb[] = "[fb] firmware build%18.2f\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build%34s\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config%33s\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15s\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%13s\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%37s\n";
|
||||
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_cv(nvObj_t *nv) { text_print(nv, fmt_cv);} // TYPE_FLOAT
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_FLOAT
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_FLOAT
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_STRING
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_STRING
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
|
||||
#endif //__TEXT_MODE
|
||||
|
||||
Executable → Regular
+4
-3
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* motate_pin_assignments.h - pin assignments for the Archim boards
|
||||
* motate_pin_assignments.h - pin assignments
|
||||
* For: /board/Archim
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart Jr.
|
||||
*
|
||||
* This file is part of the Motate Library.
|
||||
*
|
||||
|
||||
Executable → Regular
+12
-8
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* For: /board/Archim
|
||||
* This file is part of g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -36,7 +37,7 @@ StepDirStepper<Motate::kSocket1_StepPinNumber,
|
||||
Motate::kSocket1_Microstep_1PinNumber,
|
||||
Motate::kSocket1_Microstep_2PinNumber,
|
||||
Motate::kSocket1_VrefPinNumber>
|
||||
motor_1{};
|
||||
motor_1{M1_STEP_POLARITY, M1_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket2_StepPinNumber,
|
||||
Motate::kSocket2_DirPinNumber,
|
||||
@@ -45,7 +46,7 @@ StepDirStepper<Motate::kSocket2_StepPinNumber,
|
||||
Motate::kSocket2_Microstep_1PinNumber,
|
||||
Motate::kSocket2_Microstep_2PinNumber,
|
||||
Motate::kSocket2_VrefPinNumber>
|
||||
motor_2{};
|
||||
motor_2{M2_STEP_POLARITY, M2_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket3_StepPinNumber,
|
||||
Motate::kSocket3_DirPinNumber,
|
||||
@@ -54,7 +55,7 @@ StepDirStepper<Motate::kSocket3_StepPinNumber,
|
||||
Motate::kSocket3_Microstep_1PinNumber,
|
||||
Motate::kSocket3_Microstep_2PinNumber,
|
||||
Motate::kSocket3_VrefPinNumber>
|
||||
motor_3{};
|
||||
motor_3{M3_STEP_POLARITY, M3_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
Motate::kSocket4_DirPinNumber,
|
||||
@@ -63,7 +64,7 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
Motate::kSocket4_Microstep_1PinNumber,
|
||||
Motate::kSocket4_Microstep_2PinNumber,
|
||||
Motate::kSocket4_VrefPinNumber>
|
||||
motor_4{};
|
||||
motor_4{M4_STEP_POLARITY, M4_ENABLE_POLARITY};
|
||||
|
||||
// StepDirStepper<
|
||||
// Motate::kSocket5_StepPinNumber,
|
||||
@@ -72,7 +73,8 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket5_Microstep_0PinNumber,
|
||||
// Motate::kSocket5_Microstep_1PinNumber,
|
||||
// Motate::kSocket5_Microstep_2PinNumber,
|
||||
// Motate::kSocket5_VrefPinNumber> motor_5 {};
|
||||
// Motate::kSocket5_VrefPinNumber>
|
||||
// motor_5 {M5_STEP_POLARITY, M5_ENABLE_POLARITY};
|
||||
|
||||
// StepDirStepper<
|
||||
// Motate::kSocket6_StepPinNumber,
|
||||
@@ -81,7 +83,9 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket6_Microstep_0PinNumber,
|
||||
// Motate::kSocket6_Microstep_1PinNumber,
|
||||
// Motate::kSocket6_Microstep_2PinNumber,
|
||||
// Motate::kSocket6_VrefPinNumber> motor_6 {};
|
||||
// Motate::kSocket6_VrefPinNumber>
|
||||
// motor_6 {M6_STEP_POLARITY, M6_ENABLE_POLARITY};
|
||||
|
||||
|
||||
Stepper* Motors[MOTORS] = {&motor_1, &motor_2, &motor_3, &motor_4};
|
||||
|
||||
|
||||
Executable → Regular
+7
-4
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.h - board-specific code for stepper.h
|
||||
* For: /board/Archim
|
||||
* This file is part of g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -74,7 +75,8 @@ extern StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket5_Microstep_0PinNumber,
|
||||
// Motate::kSocket5_Microstep_1PinNumber,
|
||||
// Motate::kSocket5_Microstep_2PinNumber,
|
||||
// Motate::kSocket5_VrefPinNumber> motor_5;
|
||||
// Motate::kSocket5_VrefPinNumber>
|
||||
// motor_5;
|
||||
|
||||
// extern StepDirStepper<
|
||||
// Motate::kSocket6_StepPinNumber,
|
||||
@@ -83,7 +85,8 @@ extern StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket6_Microstep_0PinNumber,
|
||||
// Motate::kSocket6_Microstep_1PinNumber,
|
||||
// Motate::kSocket6_Microstep_2PinNumber,
|
||||
// Motate::kSocket6_VrefPinNumber> motor_6 {};
|
||||
// Motate::kSocket6_VrefPinNumber>
|
||||
// motor_6;
|
||||
|
||||
extern Stepper* Motors[MOTORS];
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.cpp - extended IO functions that are board-specific
|
||||
* For: /board/Archim
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.h - extended IO functions that are board-specific
|
||||
* For: /board/Archim
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* hardware.h - system hardware configuration
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
* For: /board/Archim
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
*
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -36,40 +37,31 @@
|
||||
|
||||
/*--- Hardware platform enumerations ---*/
|
||||
|
||||
enum hwPlatform {
|
||||
HM_PLATFORM_NONE = 0,
|
||||
HW_PLATFORM_TINYG_XMEGA, // TinyG code base on Xmega boards.
|
||||
HW_PLATFORM_G2_DUE, // G2 code base on native Arduino Due
|
||||
HW_PLATFORM_V9 // G2 code base on v9 boards
|
||||
};
|
||||
#define G2CORE_HARDWARE_PLATFORM "Archim"
|
||||
#define G2CORE_HARDWARE_VERSION "na"
|
||||
|
||||
#define HW_VERSION_TINYGV6 6
|
||||
#define HW_VERSION_TINYGV7 7
|
||||
#define HW_VERSION_TINYGV8 8
|
||||
|
||||
#define HW_VERSION_TINYGV9I 4
|
||||
#define HW_VERSION_TINYGV9K 5
|
||||
|
||||
|
||||
/***** Axes, motors & PWM channels used by the application *****/
|
||||
// Axes, motors & PWM channels must be defines (not enums) so expressions like this:
|
||||
/***** Motors & PWM channels supported by this hardware *****/
|
||||
// These must be defines (not enums) so expressions like this:
|
||||
// #if (MOTORS >= 6) will work
|
||||
|
||||
#define AXES 6 // number of axes supported in this version
|
||||
#define HOMING_AXES 4 // number of axes that can be homed (assumes Zxyabc sequence)
|
||||
#define MOTORS 4 // number of motors on the board
|
||||
#define COORDS 6 // number of supported coordinate systems (index starts at 1)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#define TOOLS 32 // number of entries in tool table (index starts at 1)
|
||||
#define MOTORS 4 // number of motors supported the hardware
|
||||
#define PWMS 2 // number of PWM channels supported the hardware
|
||||
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
////////////////////////////
|
||||
/////// ARM VERSION ////////
|
||||
////////////////////////////
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
*************************/
|
||||
|
||||
#include "MotatePins.h"
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
|
||||
using Motate::TimerChannel;
|
||||
using Motate::ServiceCall;
|
||||
@@ -79,14 +71,6 @@ using Motate::Pin;
|
||||
using Motate::PWMOutputPin;
|
||||
using Motate::OutputPin;
|
||||
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
|
||||
/************************************************************************************
|
||||
**** ARM SAM3X8E SPECIFIC HARDWARE *************************************************
|
||||
************************************************************************************/
|
||||
@@ -174,32 +158,33 @@ stat_t hardware_periodic(); // callback from the main loop (time sensitive)
|
||||
void hw_hard_reset(void);
|
||||
stat_t hw_flash(nvObj_t* nv);
|
||||
|
||||
stat_t hw_get_fbs(nvObj_t* nv);
|
||||
stat_t hw_get_fbc(nvObj_t* nv);
|
||||
stat_t hw_set_hv(nvObj_t* nv);
|
||||
stat_t hw_get_id(nvObj_t* nv);
|
||||
stat_t hw_get_fb(nvObj_t *nv);
|
||||
stat_t hw_get_fv(nvObj_t *nv);
|
||||
stat_t hw_get_hp(nvObj_t *nv);
|
||||
stat_t hw_get_hv(nvObj_t *nv);
|
||||
stat_t hw_get_fbs(nvObj_t *nv);
|
||||
stat_t hw_get_fbc(nvObj_t *nv);
|
||||
stat_t hw_get_id(nvObj_t *nv);
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
void hw_print_fb(nvObj_t* nv);
|
||||
void hw_print_fbs(nvObj_t* nv);
|
||||
void hw_print_fbc(nvObj_t* nv);
|
||||
void hw_print_fv(nvObj_t* nv);
|
||||
void hw_print_cv(nvObj_t* nv);
|
||||
void hw_print_hp(nvObj_t* nv);
|
||||
void hw_print_hv(nvObj_t* nv);
|
||||
void hw_print_id(nvObj_t* nv);
|
||||
void hw_print_fb(nvObj_t *nv);
|
||||
void hw_print_fv(nvObj_t *nv);
|
||||
void hw_print_fbs(nvObj_t *nv);
|
||||
void hw_print_fbc(nvObj_t *nv);
|
||||
void hw_print_hp(nvObj_t *nv);
|
||||
void hw_print_hv(nvObj_t *nv);
|
||||
void hw_print_id(nvObj_t *nv);
|
||||
|
||||
#else
|
||||
|
||||
#define hw_print_fb tx_print_stub
|
||||
#define hw_print_fbs tx_print_stub
|
||||
#define hw_print_fbc tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_cv tx_print_stub
|
||||
#define hw_print_hp tx_print_stub
|
||||
#define hw_print_hv tx_print_stub
|
||||
#define hw_print_id tx_print_stub
|
||||
#define hw_print_fb tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_fbs tx_print_stub
|
||||
#define hw_print_fbc tx_print_stub
|
||||
#define hw_print_hp tx_print_stub
|
||||
#define hw_print_hv tx_print_stub
|
||||
#define hw_print_id tx_print_stub
|
||||
|
||||
#endif // __TEXT_MODE
|
||||
|
||||
|
||||
Executable → Regular
+2
-1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* motate_pin_assignments.h - pin assignments for the g2core Archim boards
|
||||
* motate_pin_assignments.h
|
||||
* For: /board/Archim
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013-2016 Robert Giseburt
|
||||
|
||||
Executable → Regular
+33
-40
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* hardware.cpp - general hardware support functions
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2010 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -95,15 +96,18 @@ void _get_id(char *id)
|
||||
***********************************************************************************/
|
||||
|
||||
/*
|
||||
* hw_get_fb() - get firmware build number
|
||||
* hw_get_fv() - get firmware version number
|
||||
* hw_get_hp() - get hardware platform string
|
||||
* hw_get_hv() - get hardware version string
|
||||
* hw_get_fbs() - get firmware build string
|
||||
*/
|
||||
|
||||
stat_t hw_get_fbs(nvObj_t *nv)
|
||||
{
|
||||
nv->valuetype = TYPE_STRING;
|
||||
ritorno(nv_copy_string(nv, G2CORE_FIRMWARE_BUILD_STRING));
|
||||
return (STAT_OK);
|
||||
}
|
||||
stat_t hw_get_fb(nvObj_t *nv) { return (get_float(nv, cs.fw_build)); }
|
||||
stat_t hw_get_fv(nvObj_t *nv) { return (get_float(nv, cs.fw_version)); }
|
||||
stat_t hw_get_hp(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_PLATFORM)); }
|
||||
stat_t hw_get_hv(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_VERSION)); }
|
||||
stat_t hw_get_fbs(nvObj_t *nv) { return (get_string(nv, G2CORE_FIRMWARE_BUILD_STRING)); }
|
||||
|
||||
/*
|
||||
* hw_get_fbc() - get configuration settings file
|
||||
@@ -112,15 +116,15 @@ stat_t hw_get_fbs(nvObj_t *nv)
|
||||
stat_t hw_get_fbc(nvObj_t *nv)
|
||||
{
|
||||
nv->valuetype = TYPE_STRING;
|
||||
#ifdef SETTINGS_FILE
|
||||
#define settings_file_string1(s) #s
|
||||
#define settings_file_string2(s) settings_file_string1(s)
|
||||
#ifdef SETTINGS_FILE
|
||||
#define settings_file_string1(s) #s
|
||||
#define settings_file_string2(s) settings_file_string1(s)
|
||||
ritorno(nv_copy_string(nv, settings_file_string2(SETTINGS_FILE)));
|
||||
#undef settings_file_string1
|
||||
#undef settings_file_string2
|
||||
#else
|
||||
#undef settings_file_string1
|
||||
#undef settings_file_string2
|
||||
#else
|
||||
ritorno(nv_copy_string(nv, "<default-settings>"));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (STAT_OK);
|
||||
}
|
||||
@@ -147,15 +151,6 @@ stat_t hw_flash(nvObj_t *nv)
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* hw_set_hv() - set hardware version number
|
||||
*/
|
||||
stat_t hw_set_hv(nvObj_t *nv)
|
||||
{
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
* TEXT MODE SUPPORT
|
||||
* Functions to print variables from the cfgArray table
|
||||
@@ -163,22 +158,20 @@ stat_t hw_set_hv(nvObj_t *nv)
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
static const char fmt_fb[] = "[fb] firmware build %18.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build \"%s\"\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config \"%s\"\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_cv[] = "[cv] configuration version%11.2f\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15.2f\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%16.2f\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%21s\n";
|
||||
static const char fmt_fb[] = "[fb] firmware build%18.2f\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build%34s\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config%33s\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15s\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%13s\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%37s\n";
|
||||
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_cv(nvObj_t *nv) { text_print(nv, fmt_cv);} // TYPE_FLOAT
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_FLOAT
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_FLOAT
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_STRING
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_STRING
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
|
||||
#endif //__TEXT_MODE
|
||||
|
||||
Executable → Regular
+12
-9
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* For: /board/ArduinoDue
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -28,7 +29,7 @@
|
||||
|
||||
#include "board_stepper.h"
|
||||
|
||||
// These are identical to board_stepper.h, except for the word "extern"
|
||||
// These are identical to board_stepper.h, except for the word "extern", and they have the initialization parameters
|
||||
StepDirStepper<Motate::kSocket1_StepPinNumber,
|
||||
Motate::kSocket1_DirPinNumber,
|
||||
Motate::kSocket1_EnablePinNumber,
|
||||
@@ -36,7 +37,7 @@ StepDirStepper<Motate::kSocket1_StepPinNumber,
|
||||
Motate::kSocket1_Microstep_1PinNumber,
|
||||
Motate::kSocket1_Microstep_2PinNumber,
|
||||
Motate::kSocket1_VrefPinNumber>
|
||||
motor_1{};
|
||||
motor_1{M1_STEP_POLARITY, M1_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket2_StepPinNumber,
|
||||
Motate::kSocket2_DirPinNumber,
|
||||
@@ -45,7 +46,7 @@ StepDirStepper<Motate::kSocket2_StepPinNumber,
|
||||
Motate::kSocket2_Microstep_1PinNumber,
|
||||
Motate::kSocket2_Microstep_2PinNumber,
|
||||
Motate::kSocket2_VrefPinNumber>
|
||||
motor_2{};
|
||||
motor_2{M2_STEP_POLARITY, M2_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket3_StepPinNumber,
|
||||
Motate::kSocket3_DirPinNumber,
|
||||
@@ -54,7 +55,7 @@ StepDirStepper<Motate::kSocket3_StepPinNumber,
|
||||
Motate::kSocket3_Microstep_1PinNumber,
|
||||
Motate::kSocket3_Microstep_2PinNumber,
|
||||
Motate::kSocket3_VrefPinNumber>
|
||||
motor_3{};
|
||||
motor_3{M3_STEP_POLARITY, M3_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
Motate::kSocket4_DirPinNumber,
|
||||
@@ -63,7 +64,7 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
Motate::kSocket4_Microstep_1PinNumber,
|
||||
Motate::kSocket4_Microstep_2PinNumber,
|
||||
Motate::kSocket4_VrefPinNumber>
|
||||
motor_4{};
|
||||
motor_4{M4_STEP_POLARITY, M4_ENABLE_POLARITY};
|
||||
|
||||
// StepDirStepper<
|
||||
// Motate::kSocket5_StepPinNumber,
|
||||
@@ -72,7 +73,8 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket5_Microstep_0PinNumber,
|
||||
// Motate::kSocket5_Microstep_1PinNumber,
|
||||
// Motate::kSocket5_Microstep_2PinNumber,
|
||||
// Motate::kSocket5_VrefPinNumber> motor_5 {};
|
||||
// Motate::kSocket5_VrefPinNumber>
|
||||
// motor_5 {M5_STEP_POLARITY, M5_ENABLE_POLARITY};
|
||||
|
||||
// StepDirStepper<
|
||||
// Motate::kSocket6_StepPinNumber,
|
||||
@@ -81,7 +83,8 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket6_Microstep_0PinNumber,
|
||||
// Motate::kSocket6_Microstep_1PinNumber,
|
||||
// Motate::kSocket6_Microstep_2PinNumber,
|
||||
// Motate::kSocket6_VrefPinNumber> motor_6 {};
|
||||
// Motate::kSocket6_VrefPinNumber>
|
||||
// motor_6 {M6_STEP_POLARITY, M6_ENABLE_POLARITY};
|
||||
|
||||
Stepper* Motors[MOTORS] = {&motor_1, &motor_2, &motor_3, &motor_4};
|
||||
|
||||
|
||||
Executable → Regular
+3
-2
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.h - board-specific code for stepper.h
|
||||
* For: /board/ArduinoDue
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.cpp - extended IO functions that are board-specific
|
||||
* For: /board/ArduinoDue
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.h - extended IO functions that are board-specific
|
||||
* For: /board/ArduinoDue
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* motate_pin_assignments.h - pin assignments for g2 v9 boards
|
||||
* motate_pin_assignments.h - pin assignments
|
||||
* For: /board/ArduinoDue
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart Jr.
|
||||
*
|
||||
* This file is part of the Motate Library.
|
||||
*
|
||||
@@ -267,4 +268,4 @@ pin_number kGRBL_CommonEnablePinNumber = 8;
|
||||
|
||||
} // namespace Motate
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* hardware.h - system hardware configuration
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
* For: /board/ArduinoDue
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
*
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -36,42 +37,31 @@
|
||||
|
||||
/*--- Hardware platform enumerations ---*/
|
||||
|
||||
enum hwPlatform {
|
||||
HM_PLATFORM_NONE = 0,
|
||||
HW_PLATFORM_TINYG_XMEGA, // TinyG code base on Xmega boards.
|
||||
HW_PLATFORM_G2_DUE, // G2 code base on native Arduino Due
|
||||
HW_PLATFORM_V9 // G2 code base on v9 boards
|
||||
};
|
||||
#define G2CORE_HARDWARE_PLATFORM "ArduinoDue"
|
||||
#define G2CORE_HARDWARE_VERSION "na"
|
||||
|
||||
#define HW_VERSION_TINYGV6 6
|
||||
#define HW_VERSION_TINYGV7 7
|
||||
#define HW_VERSION_TINYGV8 8
|
||||
|
||||
#define HW_VERSION_TINYGV9I 4
|
||||
#define HW_VERSION_TINYGV9K 5
|
||||
|
||||
|
||||
/***** Axes, motors & PWM channels used by the application *****/
|
||||
// Axes, motors & PWM channels must be defines (not enums) so expressions like this:
|
||||
/***** Motors & PWM channels supported by this hardware *****/
|
||||
// These must be defines (not enums) so expressions like this:
|
||||
// #if (MOTORS >= 6) will work
|
||||
|
||||
#define AXES 6 // number of axes supported in this version
|
||||
#define HOMING_AXES 4 // number of axes that can be homed (assumes Zxyabc sequence)
|
||||
#define MOTORS 4 // number of motors on the board
|
||||
#define COORDS 6 // number of supported coordinate systems (index starts at 1)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#define TOOLS 32 // number of entries in tool table (index starts at 1)
|
||||
#define MOTORS 4 // number of motors supported the hardware
|
||||
#define PWMS 2 // number of PWM channels supported the hardware
|
||||
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
////////////////////////////
|
||||
/////// ARM VERSION ////////
|
||||
////////////////////////////
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
|
||||
// ARM specific code start here
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
*************************/
|
||||
|
||||
#include "MotatePins.h"
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
|
||||
using Motate::TimerChannel;
|
||||
using Motate::ServiceCall;
|
||||
@@ -81,14 +71,6 @@ using Motate::Pin;
|
||||
using Motate::PWMOutputPin;
|
||||
using Motate::OutputPin;
|
||||
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
|
||||
/************************************************************************************
|
||||
**** ARM SAM3X8E SPECIFIC HARDWARE *************************************************
|
||||
************************************************************************************/
|
||||
@@ -175,18 +157,20 @@ stat_t hardware_periodic(); // callback from the main loop (time sensitive)
|
||||
void hw_hard_reset(void);
|
||||
stat_t hw_flash(nvObj_t *nv);
|
||||
|
||||
stat_t hw_get_fb(nvObj_t *nv);
|
||||
stat_t hw_get_fv(nvObj_t *nv);
|
||||
stat_t hw_get_hp(nvObj_t *nv);
|
||||
stat_t hw_get_hv(nvObj_t *nv);
|
||||
stat_t hw_get_fbs(nvObj_t *nv);
|
||||
stat_t hw_get_fbc(nvObj_t *nv);
|
||||
stat_t hw_set_hv(nvObj_t *nv);
|
||||
stat_t hw_get_id(nvObj_t *nv);
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
void hw_print_fb(nvObj_t *nv);
|
||||
void hw_print_fv(nvObj_t *nv);
|
||||
void hw_print_fbs(nvObj_t *nv);
|
||||
void hw_print_fbc(nvObj_t *nv);
|
||||
void hw_print_fv(nvObj_t *nv);
|
||||
void hw_print_cv(nvObj_t *nv);
|
||||
void hw_print_hp(nvObj_t *nv);
|
||||
void hw_print_hv(nvObj_t *nv);
|
||||
void hw_print_id(nvObj_t *nv);
|
||||
@@ -194,10 +178,9 @@ stat_t hw_get_id(nvObj_t *nv);
|
||||
#else
|
||||
|
||||
#define hw_print_fb tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_fbs tx_print_stub
|
||||
#define hw_print_fbc tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_cv tx_print_stub
|
||||
#define hw_print_hp tx_print_stub
|
||||
#define hw_print_hv tx_print_stub
|
||||
#define hw_print_id tx_print_stub
|
||||
|
||||
Executable → Regular
+2
-1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* motate_pin_assignments.h - pin assignments for the g2core shopbotShield boards
|
||||
* motate_pin_assignments.h - pin assignments
|
||||
* For: /board/ArduinoDue
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013-2016 Robert Giseburt
|
||||
|
||||
Executable → Regular
+3
-2
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* shopbotShield-pinout.h - board pinout specification
|
||||
* For: /board/ArduinoDue
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart Jr.
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
|
||||
Executable → Regular
+36
-41
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* hardware.cpp - general hardware support functions
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2010 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -63,12 +64,12 @@ stat_t hardware_periodic()
|
||||
|
||||
void hw_hard_reset(void)
|
||||
{
|
||||
Motate::System::reset(/*boootloader: */ false); // arg=0 resets the system
|
||||
Motate::System::reset(/*bootloader: */ false); // arg=0 resets the system
|
||||
}
|
||||
|
||||
void hw_flash_loader(void)
|
||||
{
|
||||
Motate::System::reset(/*boootloader: */ true); // arg=1 erases FLASH and enters FLASH loader
|
||||
Motate::System::reset(/*bootloader: */ true); // arg=1 erases FLASH and enters FLASH loader
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -94,15 +95,18 @@ void _get_id(char *id)
|
||||
***********************************************************************************/
|
||||
|
||||
/*
|
||||
* hw_get_fb() - get firmware build number
|
||||
* hw_get_fv() - get firmware version number
|
||||
* hw_get_hp() - get hardware platform string
|
||||
* hw_get_hv() - get hardware version string
|
||||
* hw_get_fbs() - get firmware build string
|
||||
*/
|
||||
|
||||
stat_t hw_get_fbs(nvObj_t *nv)
|
||||
{
|
||||
nv->valuetype = TYPE_STRING;
|
||||
ritorno(nv_copy_string(nv, G2CORE_FIRMWARE_BUILD_STRING));
|
||||
return (STAT_OK);
|
||||
}
|
||||
stat_t hw_get_fb(nvObj_t *nv) { return (get_float(nv, cs.fw_build)); }
|
||||
stat_t hw_get_fv(nvObj_t *nv) { return (get_float(nv, cs.fw_version)); }
|
||||
stat_t hw_get_hp(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_PLATFORM)); }
|
||||
stat_t hw_get_hv(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_VERSION)); }
|
||||
stat_t hw_get_fbs(nvObj_t *nv) { return (get_string(nv, G2CORE_FIRMWARE_BUILD_STRING)); }
|
||||
|
||||
/*
|
||||
* hw_get_fbc() - get configuration settings file
|
||||
@@ -111,15 +115,15 @@ stat_t hw_get_fbs(nvObj_t *nv)
|
||||
stat_t hw_get_fbc(nvObj_t *nv)
|
||||
{
|
||||
nv->valuetype = TYPE_STRING;
|
||||
#ifdef SETTINGS_FILE
|
||||
#define settings_file_string1(s) #s
|
||||
#define settings_file_string2(s) settings_file_string1(s)
|
||||
#ifdef SETTINGS_FILE
|
||||
#define settings_file_string1(s) #s
|
||||
#define settings_file_string2(s) settings_file_string1(s)
|
||||
ritorno(nv_copy_string(nv, settings_file_string2(SETTINGS_FILE)));
|
||||
#undef settings_file_string1
|
||||
#undef settings_file_string2
|
||||
#else
|
||||
#undef settings_file_string1
|
||||
#undef settings_file_string2
|
||||
#else
|
||||
ritorno(nv_copy_string(nv, "<default-settings>"));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (STAT_OK);
|
||||
}
|
||||
@@ -140,20 +144,13 @@ stat_t hw_get_id(nvObj_t *nv)
|
||||
/*
|
||||
* hw_flash() - invoke FLASH loader from command input
|
||||
*/
|
||||
|
||||
stat_t hw_flash(nvObj_t *nv)
|
||||
{
|
||||
hw_flash_loader();
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* hw_set_hv() - set hardware version number
|
||||
*/
|
||||
stat_t hw_set_hv(nvObj_t *nv)
|
||||
{
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
* TEXT MODE SUPPORT
|
||||
@@ -162,22 +159,20 @@ stat_t hw_set_hv(nvObj_t *nv)
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
static const char fmt_fb[] = "[fb] firmware build%18.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build \"%32s\"\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config \"%s\"\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_cv[] = "[cv] configuration version%11.2f\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15.2f\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%16.2f\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%21s\n";
|
||||
static const char fmt_fb[] = "[fb] firmware build%18.2f\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build%34s\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config%33s\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15s\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%13s\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%37s\n";
|
||||
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_cv(nvObj_t *nv) { text_print(nv, fmt_cv);} // TYPE_FLOAT
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_FLOAT
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_FLOAT
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_STRING
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_STRING
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
|
||||
#endif //__TEXT_MODE
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* g2v9k-pinout.h - board pinout specification
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart Jr.
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -89,7 +90,7 @@
|
||||
#define TEMPERATURE_OUTPUT_ON 0
|
||||
|
||||
// Some pins, if the PWM capability is turned on, it will cause timer conflicts.
|
||||
// So we have to explicity enable them as PWM pins.
|
||||
// So we have to explicitly enable them as PWM pins.
|
||||
// Generated with:
|
||||
// perl -e 'for($i=1;$i<14;$i++) { print "#define OUTPUT${i}_PWM 0\n";}'
|
||||
#define OUTPUT1_PWM 0
|
||||
|
||||
Executable → Regular
+12
-9
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -28,7 +29,7 @@
|
||||
|
||||
#include "board_stepper.h"
|
||||
|
||||
// These are identical to board_stepper.h, except for the word "extern"
|
||||
// These are identical to board_stepper.h, except for the word "extern", and they have the initialization parameters
|
||||
StepDirStepper<Motate::kSocket1_StepPinNumber,
|
||||
Motate::kSocket1_DirPinNumber,
|
||||
Motate::kSocket1_EnablePinNumber,
|
||||
@@ -36,7 +37,7 @@ StepDirStepper<Motate::kSocket1_StepPinNumber,
|
||||
Motate::kSocket1_Microstep_1PinNumber,
|
||||
Motate::kSocket1_Microstep_2PinNumber,
|
||||
Motate::kSocket1_VrefPinNumber>
|
||||
motor_1{};
|
||||
motor_1{M1_STEP_POLARITY, M1_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket2_StepPinNumber,
|
||||
Motate::kSocket2_DirPinNumber,
|
||||
@@ -45,7 +46,7 @@ StepDirStepper<Motate::kSocket2_StepPinNumber,
|
||||
Motate::kSocket2_Microstep_1PinNumber,
|
||||
Motate::kSocket2_Microstep_2PinNumber,
|
||||
Motate::kSocket2_VrefPinNumber>
|
||||
motor_2{};
|
||||
motor_2{M2_STEP_POLARITY, M2_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket3_StepPinNumber,
|
||||
Motate::kSocket3_DirPinNumber,
|
||||
@@ -54,7 +55,7 @@ StepDirStepper<Motate::kSocket3_StepPinNumber,
|
||||
Motate::kSocket3_Microstep_1PinNumber,
|
||||
Motate::kSocket3_Microstep_2PinNumber,
|
||||
Motate::kSocket3_VrefPinNumber>
|
||||
motor_3{};
|
||||
motor_3{M3_STEP_POLARITY, M3_ENABLE_POLARITY};
|
||||
|
||||
StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
Motate::kSocket4_DirPinNumber,
|
||||
@@ -63,7 +64,7 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
Motate::kSocket4_Microstep_1PinNumber,
|
||||
Motate::kSocket4_Microstep_2PinNumber,
|
||||
Motate::kSocket4_VrefPinNumber>
|
||||
motor_4{};
|
||||
motor_4{M4_STEP_POLARITY, M4_ENABLE_POLARITY};
|
||||
|
||||
// StepDirStepper<
|
||||
// Motate::kSocket5_StepPinNumber,
|
||||
@@ -72,7 +73,8 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket5_Microstep_0PinNumber,
|
||||
// Motate::kSocket5_Microstep_1PinNumber,
|
||||
// Motate::kSocket5_Microstep_2PinNumber,
|
||||
// Motate::kSocket5_VrefPinNumber> motor_5 {};
|
||||
// Motate::kSocket5_VrefPinNumber>
|
||||
// motor_5 {M5_STEP_POLARITY, M5_ENABLE_POLARITY};
|
||||
|
||||
// StepDirStepper<
|
||||
// Motate::kSocket6_StepPinNumber,
|
||||
@@ -81,7 +83,8 @@ StepDirStepper<Motate::kSocket4_StepPinNumber,
|
||||
// Motate::kSocket6_Microstep_0PinNumber,
|
||||
// Motate::kSocket6_Microstep_1PinNumber,
|
||||
// Motate::kSocket6_Microstep_2PinNumber,
|
||||
// Motate::kSocket6_VrefPinNumber> motor_6 {};
|
||||
// Motate::kSocket6_VrefPinNumber>
|
||||
// motor_6 {M6_STEP_POLARITY, M6_ENABLE_POLARITY};
|
||||
|
||||
Stepper* Motors[MOTORS] = {&motor_1, &motor_2, &motor_3, &motor_4};
|
||||
|
||||
|
||||
Executable → Regular
+3
-2
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.h - board-specific code for stepper.h
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.cpp - extended IO functions that are board-specific
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.h - extended IO functions that are board-specific
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* hardware.h - system hardware configuration
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
* For: /board/g2v9
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
*
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -36,42 +37,31 @@
|
||||
|
||||
/*--- Hardware platform enumerations ---*/
|
||||
|
||||
enum hwPlatform {
|
||||
HM_PLATFORM_NONE = 0,
|
||||
HW_PLATFORM_TINYG_XMEGA, // TinyG code base on Xmega boards.
|
||||
HW_PLATFORM_G2_DUE, // G2 code base on native Arduino Due
|
||||
HW_PLATFORM_V9 // G2 code base on v9 boards
|
||||
};
|
||||
#define G2CORE_HARDWARE_PLATFORM "g2v9"
|
||||
#define G2CORE_HARDWARE_VERSION "k"
|
||||
|
||||
#define HW_VERSION_TINYGV6 6
|
||||
#define HW_VERSION_TINYGV7 7
|
||||
#define HW_VERSION_TINYGV8 8
|
||||
|
||||
#define HW_VERSION_TINYGV9I 4
|
||||
#define HW_VERSION_TINYGV9K 5
|
||||
|
||||
|
||||
/***** Axes, motors & PWM channels used by the application *****/
|
||||
// Axes, motors & PWM channels must be defines (not enums) so expressions like this:
|
||||
/***** Motors & PWM channels supported by this hardware *****/
|
||||
// These must be defines (not enums) so expressions like this:
|
||||
// #if (MOTORS >= 6) will work
|
||||
|
||||
#define AXES 6 // number of axes supported in this version
|
||||
#define HOMING_AXES 4 // number of axes that can be homed (assumes Zxyabc sequence)
|
||||
#define MOTORS 4 // number of motors on the board
|
||||
#define COORDS 6 // number of supported coordinate systems (index starts at 1)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#define TOOLS 32 // number of entries in tool table (index starts at 1)
|
||||
#define MOTORS 4 // number of motors supported the hardware
|
||||
#define PWMS 2 // number of PWM channels supported the hardware
|
||||
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
////////////////////////////
|
||||
/////// ARM VERSION ////////
|
||||
////////////////////////////
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
|
||||
// ARM specific code start here
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
*************************/
|
||||
|
||||
#include "MotatePins.h"
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
|
||||
using Motate::TimerChannel;
|
||||
using Motate::ServiceCall;
|
||||
@@ -81,14 +71,6 @@ using Motate::Pin;
|
||||
using Motate::PWMOutputPin;
|
||||
using Motate::OutputPin;
|
||||
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
|
||||
/************************************************************************************
|
||||
**** ARM SAM3X8E SPECIFIC HARDWARE *************************************************
|
||||
************************************************************************************/
|
||||
@@ -175,32 +157,33 @@ stat_t hardware_periodic(); // callback from the main loop (time sensitive)
|
||||
void hw_hard_reset(void);
|
||||
stat_t hw_flash(nvObj_t *nv);
|
||||
|
||||
stat_t hw_get_fb(nvObj_t *nv);
|
||||
stat_t hw_get_fv(nvObj_t *nv);
|
||||
stat_t hw_get_hp(nvObj_t *nv);
|
||||
stat_t hw_get_hv(nvObj_t *nv);
|
||||
stat_t hw_get_fbs(nvObj_t *nv);
|
||||
stat_t hw_get_fbc(nvObj_t *nv);
|
||||
stat_t hw_set_hv(nvObj_t *nv);
|
||||
stat_t hw_get_id(nvObj_t *nv);
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
void hw_print_fb(nvObj_t *nv);
|
||||
void hw_print_fb(nvObj_t *nv);
|
||||
void hw_print_fv(nvObj_t *nv);
|
||||
void hw_print_fbs(nvObj_t *nv);
|
||||
void hw_print_fbc(nvObj_t *nv);
|
||||
void hw_print_fv(nvObj_t *nv);
|
||||
void hw_print_cv(nvObj_t *nv);
|
||||
void hw_print_hp(nvObj_t *nv);
|
||||
void hw_print_hv(nvObj_t *nv);
|
||||
void hw_print_id(nvObj_t *nv);
|
||||
void hw_print_hp(nvObj_t *nv);
|
||||
void hw_print_hv(nvObj_t *nv);
|
||||
void hw_print_id(nvObj_t *nv);
|
||||
|
||||
#else
|
||||
|
||||
#define hw_print_fb tx_print_stub
|
||||
#define hw_print_fb tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_fbs tx_print_stub
|
||||
#define hw_print_fbc tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_cv tx_print_stub
|
||||
#define hw_print_hp tx_print_stub
|
||||
#define hw_print_hv tx_print_stub
|
||||
#define hw_print_id tx_print_stub
|
||||
#define hw_print_hp tx_print_stub
|
||||
#define hw_print_hv tx_print_stub
|
||||
#define hw_print_id tx_print_stub
|
||||
|
||||
#endif // __TEXT_MODE
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* motate_pin_assignments.h - pin assignments for the g2core g2v9 boards
|
||||
* motate_pin_assignments.h - pin assignments
|
||||
* For: /board/g2v9
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart Jr.
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
|
||||
Executable → Regular
+27
-33
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* hardware.cpp - general hardware support functions
|
||||
* For: /board/gQuadratic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2015 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2010 - 2018 Alden S. Hart, Jr.
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -106,7 +107,7 @@ void hardware_init()
|
||||
stat_t hardware_periodic()
|
||||
{
|
||||
#if EXPERIMENTAL_NEOPIXEL_SUPPORT == 1
|
||||
float x_pos = cm_get_work_position(ACTIVE_MODEL, AXIS_X);
|
||||
float x_pos = cm_get_display_position(ACTIVE_MODEL, AXIS_X);
|
||||
if (std::abs(LEDs::old_x_pos - x_pos) > 0.01) {
|
||||
LEDs::old_x_pos = x_pos;
|
||||
|
||||
@@ -178,15 +179,18 @@ void _get_id(char *id)
|
||||
***********************************************************************************/
|
||||
|
||||
/*
|
||||
* hw_get_fb() - get firmware build number
|
||||
* hw_get_fv() - get firmware version number
|
||||
* hw_get_hp() - get hardware platform string
|
||||
* hw_get_hv() - get hardware version string
|
||||
* hw_get_fbs() - get firmware build string
|
||||
*/
|
||||
|
||||
stat_t hw_get_fbs(nvObj_t *nv)
|
||||
{
|
||||
nv->valuetype = TYPE_STRING;
|
||||
ritorno(nv_copy_string(nv, G2CORE_FIRMWARE_BUILD_STRING));
|
||||
return (STAT_OK);
|
||||
}
|
||||
stat_t hw_get_fb(nvObj_t *nv) { return (get_float(nv, cs.fw_build)); }
|
||||
stat_t hw_get_fv(nvObj_t *nv) { return (get_float(nv, cs.fw_version)); }
|
||||
stat_t hw_get_hp(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_PLATFORM)); }
|
||||
stat_t hw_get_hv(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_VERSION)); }
|
||||
stat_t hw_get_fbs(nvObj_t *nv) { return (get_string(nv, G2CORE_FIRMWARE_BUILD_STRING)); }
|
||||
|
||||
/*
|
||||
* hw_get_fbc() - get configuration settings file
|
||||
@@ -230,15 +234,6 @@ stat_t hw_flash(nvObj_t *nv)
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* hw_set_hv() - set hardware version number
|
||||
*/
|
||||
stat_t hw_set_hv(nvObj_t *nv)
|
||||
{
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
* TEXT MODE SUPPORT
|
||||
* Functions to print variables from the cfgArray table
|
||||
@@ -246,22 +241,21 @@ stat_t hw_set_hv(nvObj_t *nv)
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
static const char fmt_fb[] = "[fb] firmware build %18.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build \"%s\"\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config \"%s\"\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_cv[] = "[cv] configuration version%11.2f\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15.2f\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%16.2f\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%21s\n";
|
||||
static const char fmt_fb[] = "[fb] firmware build%18.2f\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build%34s\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config%33s\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15s\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%13s\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%37s\n";
|
||||
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_cv(nvObj_t *nv) { text_print(nv, fmt_cv);} // TYPE_FLOAT
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_FLOAT
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_FLOAT
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_STRING
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_STRING
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
|
||||
#endif //__TEXT_MODE
|
||||
|
||||
|
||||
Executable → Regular
+3
-3
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* For: /board/gQuadratic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016-2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016-2018 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2019 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2019 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -50,7 +51,6 @@ HOT_DATA StepDirStepper<Motate::kSocket2_StepPinNumber,
|
||||
#endif // QUADRATIC_REVISION == 'B'
|
||||
|
||||
#if QUADRATIC_REVISION == 'C'
|
||||
#warning setting up trinamics
|
||||
// Motate::SPIChipSelectPin<Motate::kSocket3_SPISlaveSelectPinNumber> motor_1_cs;
|
||||
HOT_DATA Trinamic2130<SPIBus_used_t::SPIBusDevice,
|
||||
Motate::kSocket1_StepPinNumber,
|
||||
|
||||
Executable → Regular
+3
-2
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.h - board-specific code for stepper.h
|
||||
* For: /board/gQuadratic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.cpp - extended IO functions that are board-specific
|
||||
* For: /board/gQuadratic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.h - extended IO functions that are board-specific
|
||||
* For: /board/gQuadratic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* gquadratic-b-pinout.h - board pinout specification
|
||||
* For: /board/gQuadratic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016-2018 Robert Giseburt
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* hardware.h - system hardware configuration
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
* For: /board/gQuadratic
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
*
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -38,39 +39,39 @@
|
||||
|
||||
/*--- Hardware platform enumerations ---*/
|
||||
|
||||
enum hwPlatform {
|
||||
HM_PLATFORM_NONE = 0,
|
||||
HW_PLATFORM_TINYG_XMEGA, // TinyG code base on Xmega boards.
|
||||
HW_PLATFORM_G2_DUE, // G2 code base on native Arduino Due
|
||||
HW_PLATFORM_V9 // G2 code base on v9 boards
|
||||
};
|
||||
#define G2CORE_HARDWARE_PLATFORM "gQuadtratic"
|
||||
#define G2CORE_HARDWARE_VERSION "b"
|
||||
|
||||
#define HW_VERSION_TINYGV6 6
|
||||
#define HW_VERSION_TINYGV7 7
|
||||
#define HW_VERSION_TINYGV8 8
|
||||
|
||||
#define HW_VERSION_TINYGV9I 4
|
||||
#define HW_VERSION_TINYGV9K 5
|
||||
|
||||
|
||||
/***** Axes, motors & PWM channels used by the application *****/
|
||||
// Axes, motors & PWM channels must be defines (not enums) so expressions like this:
|
||||
/***** Motors & PWM channels supported by this hardware *****/
|
||||
// These must be defines (not enums) so expressions like this:
|
||||
// #if (MOTORS >= 6) will work
|
||||
|
||||
<<<<<<< HEAD
|
||||
#define AXES 6 // number of axes supported in this version
|
||||
#define HOMING_AXES 4 // number of axes that can be homed (assumes Zxyabc sequence)
|
||||
#define MOTORS 3 // number of motors on the board
|
||||
#define COORDS 6 // number of supported coordinate systems (index starts at 1)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#define TOOLS 32 // number of entries in tool table (index starts at 1)
|
||||
=======
|
||||
#define MOTORS 4 // number of motors supported the hardware
|
||||
#define PWMS 2 // number of PWM channels supported the hardware
|
||||
>>>>>>> edge
|
||||
|
||||
////////////////////////////
|
||||
/////// ARM VERSION ////////
|
||||
////////////////////////////
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
// ARM specific code start here
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
*************************/
|
||||
|
||||
#include "MotatePins.h"
|
||||
<<<<<<< HEAD
|
||||
#if QUADRATIC_REVISION == 'C'
|
||||
#define MOTOR_1_IS_TRINAMIC
|
||||
#define MOTOR_2_IS_TRINAMIC
|
||||
@@ -78,6 +79,10 @@ enum hwPlatform {
|
||||
#endif
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
=======
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
>>>>>>> edge
|
||||
|
||||
using Motate::TimerChannel;
|
||||
using Motate::ServiceCall;
|
||||
@@ -87,6 +92,7 @@ using Motate::Pin;
|
||||
using Motate::PWMOutputPin;
|
||||
using Motate::OutputPin;
|
||||
|
||||
<<<<<<< HEAD
|
||||
/*************************
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
@@ -94,6 +100,36 @@ using Motate::OutputPin;
|
||||
#define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N)
|
||||
#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16)
|
||||
#define SYS_ID_LEN 24 // total length including dashes and NUL
|
||||
=======
|
||||
/************************************************************************************
|
||||
**** ARM SAM3X8E SPECIFIC HARDWARE *************************************************
|
||||
************************************************************************************/
|
||||
|
||||
/**** Resource Assignment via Motate ****
|
||||
*
|
||||
* This section defines resource usage for pins, timers, PWM channels, communications
|
||||
* and other resources. Please refer to /motate/utility/SamPins.h, SamTimers.h and
|
||||
* other files for pinouts and other configuration details.
|
||||
*
|
||||
* Commenting out or #ifdef'ing out definitions below will cause the compiler to
|
||||
* drop references to these resources from the compiled code. This will reduce
|
||||
* compiled code size and runtime CPU cycles. E.g. if you are compiling for a 3 motor,
|
||||
* XYZ axis config commenting out the higher motors and axes here will remove them
|
||||
* from later code (using the motate .isNull() test).
|
||||
*/
|
||||
|
||||
/* Interrupt usage and priority
|
||||
*
|
||||
* The following interrupts are defined w/indicated priorities
|
||||
*
|
||||
* 0 DDA_TIMER (9) for step pulse generation
|
||||
* 1 DWELL_TIMER (10) for dwell timing
|
||||
* 2 LOADER software generated interrupt (STIR / SGI)
|
||||
* 3 Serial read character interrupt
|
||||
* 4 EXEC software generated interrupt (STIR / SGI)
|
||||
* 5 Serial write character interrupt
|
||||
*/
|
||||
>>>>>>> edge
|
||||
|
||||
/**** Stepper DDA and dwell timer settings ****/
|
||||
|
||||
@@ -103,7 +139,7 @@ using Motate::OutputPin;
|
||||
|
||||
#define MIN_SEGMENT_MS ((float)0.125) // S70 can handle much much smaller segements
|
||||
|
||||
#define PLANNER_BUFFER_POOL_SIZE (60)
|
||||
#define PLANNER_QUEUE_SIZE (60)
|
||||
|
||||
/**** Motate Definitions ****/
|
||||
|
||||
@@ -151,33 +187,35 @@ stat_t hardware_periodic(); // callback from the main loop (time sensitive)
|
||||
void hw_hard_reset(void);
|
||||
stat_t hw_flash(nvObj_t* nv);
|
||||
|
||||
stat_t hw_get_fbs(nvObj_t* nv);
|
||||
stat_t hw_get_fbc(nvObj_t* nv);
|
||||
stat_t hw_set_hv(nvObj_t* nv);
|
||||
stat_t hw_get_id(nvObj_t* nv);
|
||||
stat_t hw_get_fb(nvObj_t *nv);
|
||||
stat_t hw_get_fv(nvObj_t *nv);
|
||||
stat_t hw_get_hp(nvObj_t *nv);
|
||||
stat_t hw_get_hv(nvObj_t *nv);
|
||||
stat_t hw_get_fbs(nvObj_t *nv);
|
||||
stat_t hw_get_fbc(nvObj_t *nv);
|
||||
stat_t hw_get_id(nvObj_t *nv);
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
void hw_print_fb(nvObj_t* nv);
|
||||
void hw_print_fbs(nvObj_t* nv);
|
||||
void hw_print_fbc(nvObj_t* nv);
|
||||
void hw_print_fv(nvObj_t* nv);
|
||||
void hw_print_cv(nvObj_t* nv);
|
||||
void hw_print_hp(nvObj_t* nv);
|
||||
void hw_print_hv(nvObj_t* nv);
|
||||
void hw_print_id(nvObj_t* nv);
|
||||
void hw_print_fb(nvObj_t *nv);
|
||||
void hw_print_fv(nvObj_t *nv);
|
||||
void hw_print_fbs(nvObj_t *nv);
|
||||
void hw_print_fbc(nvObj_t *nv);
|
||||
void hw_print_hp(nvObj_t *nv);
|
||||
void hw_print_hv(nvObj_t *nv);
|
||||
void hw_print_id(nvObj_t *nv);
|
||||
|
||||
#else
|
||||
|
||||
#define hw_print_fb tx_print_stub
|
||||
#define hw_print_fbs tx_print_stub
|
||||
#define hw_print_fbc tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_cv tx_print_stub
|
||||
#define hw_print_hp tx_print_stub
|
||||
#define hw_print_hv tx_print_stub
|
||||
#define hw_print_id tx_print_stub
|
||||
#define hw_print_fb tx_print_stub
|
||||
#define hw_print_fv tx_print_stub
|
||||
#define hw_print_fbs tx_print_stub
|
||||
#define hw_print_fbc tx_print_stub
|
||||
#define hw_print_hp tx_print_stub
|
||||
#define hw_print_hv tx_print_stub
|
||||
#define hw_print_id tx_print_stub
|
||||
|
||||
#endif // __TEXT_MODE
|
||||
|
||||
#endif // __TEXT_MODE
|
||||
|
||||
#endif // end of include guard: HARDWARE_H_ONCE
|
||||
|
||||
Executable → Regular
+4
-3
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* motate_pin_assignments.h - pin assignments for the gQuadratic boards
|
||||
* motate_pin_assignments.h - pin assignments
|
||||
* For: /board/gQuadratic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2013 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2016 Alden S. Hart Jr.
|
||||
* Copyright (c) 2013 - 2018 Robert Giseburt
|
||||
* Copyright (c) 2013 - 2018 Alden S. Hart Jr.
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
|
||||
Executable → Regular
+31
-35
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* hardware.cpp - general hardware support functions
|
||||
* For: /board/gQuintic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2015 Alden S. Hart, Jr.
|
||||
@@ -42,13 +43,15 @@ Motate::OutputPin<Motate::kExternalClock1_PinNumber> external_clk_pin {Motate::k
|
||||
|
||||
HOT_DATA SPI_CS_PinMux_used_t spiCSPinMux;
|
||||
HOT_DATA SPIBus_used_t spiBus;
|
||||
HOT_DATA TWIBus_used_t twiBus;
|
||||
|
||||
HOT_DATA plex0_t plex0{twiBus, 0x0070L};
|
||||
HOT_DATA plex1_t plex1{twiBus, 0x0071L};
|
||||
// HOT_DATA TWIBus_used_t twiBus;
|
||||
|
||||
// // Define Multiplexers
|
||||
// HOT_DATA plex0_t plex0{twiBus, 0x0070L};
|
||||
// HOT_DATA plex1_t plex1{twiBus, 0x0071L};
|
||||
|
||||
|
||||
// HOT_DATA I2C_EEPROM eeprom{twiBus, 0b01010000};
|
||||
|
||||
// alignas(4) uint8_t eeprom_buffer[128] HOT_DATA = "TestinglyABCDEFGHIJKLmnop";
|
||||
// alignas(4) uint8_t eeprom_in_buffer[128] HOT_DATA = "";
|
||||
|
||||
@@ -59,7 +62,7 @@ HOT_DATA plex1_t plex1{twiBus, 0x0071L};
|
||||
void hardware_init()
|
||||
{
|
||||
spiBus.init();
|
||||
twiBus.init();
|
||||
// twiBus.init();
|
||||
board_hardware_init();
|
||||
external_clk_pin = 0; // Force external clock to 0 for now.
|
||||
}
|
||||
@@ -188,15 +191,18 @@ void _get_id(char *id)
|
||||
***********************************************************************************/
|
||||
|
||||
/*
|
||||
* hw_get_fb() - get firmware build number
|
||||
* hw_get_fv() - get firmware version number
|
||||
* hw_get_hp() - get hardware platform string
|
||||
* hw_get_hv() - get hardware version string
|
||||
* hw_get_fbs() - get firmware build string
|
||||
*/
|
||||
|
||||
stat_t hw_get_fbs(nvObj_t *nv)
|
||||
{
|
||||
nv->valuetype = TYPE_STRING;
|
||||
ritorno(nv_copy_string(nv, G2CORE_FIRMWARE_BUILD_STRING));
|
||||
return (STAT_OK);
|
||||
}
|
||||
stat_t hw_get_fb(nvObj_t *nv) { return (get_float(nv, cs.fw_build)); }
|
||||
stat_t hw_get_fv(nvObj_t *nv) { return (get_float(nv, cs.fw_version)); }
|
||||
stat_t hw_get_hp(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_PLATFORM)); }
|
||||
stat_t hw_get_hv(nvObj_t *nv) { return (get_string(nv, G2CORE_HARDWARE_VERSION)); }
|
||||
stat_t hw_get_fbs(nvObj_t *nv) { return (get_string(nv, G2CORE_FIRMWARE_BUILD_STRING)); }
|
||||
|
||||
/*
|
||||
* hw_get_fbc() - get configuration settings file
|
||||
@@ -240,14 +246,6 @@ stat_t hw_flash(nvObj_t *nv)
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* hw_set_hv() - set hardware version number
|
||||
*/
|
||||
stat_t hw_set_hv(nvObj_t *nv)
|
||||
{
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
* TEXT MODE SUPPORT
|
||||
@@ -256,22 +254,20 @@ stat_t hw_set_hv(nvObj_t *nv)
|
||||
|
||||
#ifdef __TEXT_MODE
|
||||
|
||||
static const char fmt_fb[] = "[fb] firmware build %18.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build \"%s\"\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config \"%s\"\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_cv[] = "[cv] configuration version%11.2f\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15.2f\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%16.2f\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%21s\n";
|
||||
static const char fmt_fb[] = "[fb] firmware build%18.2f\n";
|
||||
static const char fmt_fv[] = "[fv] firmware version%16.2f\n";
|
||||
static const char fmt_fbs[] = "[fbs] firmware build%34s\n";
|
||||
static const char fmt_fbc[] = "[fbc] firmware config%33s\n";
|
||||
static const char fmt_hp[] = "[hp] hardware platform%15s\n";
|
||||
static const char fmt_hv[] = "[hv] hardware version%13s\n";
|
||||
static const char fmt_id[] = "[id] g2core ID%37s\n";
|
||||
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_cv(nvObj_t *nv) { text_print(nv, fmt_cv);} // TYPE_FLOAT
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_FLOAT
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_FLOAT
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
void hw_print_fb(nvObj_t *nv) { text_print(nv, fmt_fb);} // TYPE_FLOAT
|
||||
void hw_print_fv(nvObj_t *nv) { text_print(nv, fmt_fv);} // TYPE_FLOAT
|
||||
void hw_print_fbs(nvObj_t *nv) { text_print(nv, fmt_fbs);} // TYPE_STRING
|
||||
void hw_print_fbc(nvObj_t *nv) { text_print(nv, fmt_fbc);} // TYPE_STRING
|
||||
void hw_print_hp(nvObj_t *nv) { text_print(nv, fmt_hp);} // TYPE_STRING
|
||||
void hw_print_hv(nvObj_t *nv) { text_print(nv, fmt_hv);} // TYPE_STRING
|
||||
void hw_print_id(nvObj_t *nv) { text_print(nv, fmt_id);} // TYPE_STRING
|
||||
|
||||
#endif //__TEXT_MODE
|
||||
|
||||
Executable → Regular
+3
-2
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* For: /board/gQuintic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016-2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016-2018 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2019 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2019 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
|
||||
Executable → Regular
+7
-2
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* board_stepper.h - board-specific code for stepper.h
|
||||
* For: /board/gQuintic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
*
|
||||
* This file ("the software") is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License, version 2 as published by the
|
||||
@@ -63,21 +64,25 @@ extern Trinamic2130<SPIBus_used_t::SPIBusDevice,
|
||||
Motate::kSocket1_DirPinNumber,
|
||||
Motate::kSocket1_EnablePinNumber>
|
||||
motor_1;
|
||||
|
||||
extern Trinamic2130<SPIBus_used_t::SPIBusDevice,
|
||||
Motate::kSocket2_StepPinNumber,
|
||||
Motate::kSocket2_DirPinNumber,
|
||||
Motate::kSocket2_EnablePinNumber>
|
||||
motor_2;
|
||||
|
||||
extern Trinamic2130<SPIBus_used_t::SPIBusDevice,
|
||||
Motate::kSocket3_StepPinNumber,
|
||||
Motate::kSocket3_DirPinNumber,
|
||||
Motate::kSocket3_EnablePinNumber>
|
||||
motor_3;
|
||||
|
||||
extern Trinamic2130<SPIBus_used_t::SPIBusDevice,
|
||||
Motate::kSocket4_StepPinNumber,
|
||||
Motate::kSocket4_DirPinNumber,
|
||||
Motate::kSocket4_EnablePinNumber>
|
||||
motor_4;
|
||||
|
||||
extern Trinamic2130<SPIBus_used_t::SPIBusDevice,
|
||||
Motate::kSocket5_StepPinNumber,
|
||||
Motate::kSocket5_DirPinNumber,
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.cpp - extended IO functions that are board-specific
|
||||
* For: /board/gQuintic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_xio.h - extended IO functions that are board-specific
|
||||
* For: /board/gQuintic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
|
||||
Executable → Regular
+5
-4
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* gquintic-b-pinout.h - board pinout specification
|
||||
* gquintic-a-pinout.h - board pinout specification
|
||||
* For: /board/gQuintic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016-2017 Robert Giseburt
|
||||
* Copyright (c) 2016-2017 Alden S. Hart Jr.
|
||||
* Copyright (c) 2016 - 2019 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2019 Alden S. Hart Jr.
|
||||
*
|
||||
* This file is part of the Motate Library.
|
||||
*
|
||||
@@ -206,7 +207,7 @@ namespace Motate {
|
||||
|
||||
} // namespace Motate
|
||||
|
||||
// We then allow each chip-type to have it's onw function definitions
|
||||
// We then allow each chip-type to have it's own function definitions
|
||||
// that will refer to these pin assignments.
|
||||
#include "motate_chip_pin_functions.h"
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user