mirror of
https://github.com/synthetos/g2.git
synced 2026-09-22 19:36:45 +08:00
interim commit merging edge into finish-320
This commit is contained in:
Executable → Regular
+58
-57
@@ -1,57 +1,58 @@
|
||||
# From https://github.com/github/gitignore/blob/master/Objective-C.gitignore
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
*.o
|
||||
*.d
|
||||
*.bin
|
||||
*.elf
|
||||
*.hex
|
||||
*.eep
|
||||
*.lss
|
||||
*.map
|
||||
*.srec
|
||||
*.aws
|
||||
*.atsuo
|
||||
*.cproj
|
||||
*.log
|
||||
.project
|
||||
.cproject
|
||||
*.launch
|
||||
.settings
|
||||
\bin
|
||||
\build
|
||||
build/
|
||||
bin/
|
||||
.DS_Store
|
||||
TcfTransactionLog.csv
|
||||
*.xcbkptlist
|
||||
*.xccheckout
|
||||
.gdb_history
|
||||
JLink.log
|
||||
Tools/gcc-arm-none-eabi*
|
||||
openocd.cfg
|
||||
openocd.log
|
||||
*/mb.txt
|
||||
Tools/gcc-arm-none-eabi-*.tar.bz2
|
||||
*/TinyG2.componentinfo.xml
|
||||
g2core/g2core.componentinfo.xml
|
||||
.tags
|
||||
|
||||
g2core/compile_commands.json
|
||||
# From https://github.com/github/gitignore/blob/master/Objective-C.gitignore
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
*.o
|
||||
*.d
|
||||
*.bin
|
||||
*.elf
|
||||
*.hex
|
||||
*.eep
|
||||
*.log
|
||||
*.lss
|
||||
*.map
|
||||
*.srec
|
||||
*.aws
|
||||
*.atsuo
|
||||
*.cproj
|
||||
*.log
|
||||
.project
|
||||
.cproject
|
||||
*.launch
|
||||
.settings
|
||||
\bin
|
||||
\build
|
||||
build/
|
||||
bin/
|
||||
.DS_Store
|
||||
TcfTransactionLog.csv
|
||||
*.xcbkptlist
|
||||
*.xccheckout
|
||||
.gdb_history
|
||||
JLink.log
|
||||
Tools/gcc-arm-none-eabi*
|
||||
openocd.cfg
|
||||
openocd.log
|
||||
*/mb.txt
|
||||
Tools/gcc-arm-none-eabi-*.tar.bz2
|
||||
*/TinyG2.componentinfo.xml
|
||||
g2core/g2core.componentinfo.xml
|
||||
.tags
|
||||
|
||||
g2core/compile_commands.json
|
||||
|
||||
@@ -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>
|
||||
@@ -8,6 +8,25 @@ G2 [Edge](https://github.com/synthetos/g2/tree/edge) is the branch for beta test
|
||||
|
||||
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).
|
||||
|
||||
## 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
|
||||
|
||||
## Firmware Build 100 `{fb:100.xx}`
|
||||
### Feature Enhancements
|
||||
@@ -16,7 +35,7 @@ The fb:100 release is a major change from the fb:089 and earlier branches. It re
|
||||
- 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
|
||||
- Intital support for new processors, including the ARM M7
|
||||
- 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.
|
||||
|
||||
Binary file not shown.
@@ -18,6 +18,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
|
||||
@@ -46,6 +47,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
|
||||
@@ -67,6 +70,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
|
||||
|
||||
Executable → Regular
+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.
|
||||
#
|
||||
@@ -64,5 +64,8 @@ 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
|
||||
|
||||
# *** EOF ***
|
||||
|
||||
@@ -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
+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
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
|
||||
@@ -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 *************************************************
|
||||
************************************************************************************/
|
||||
@@ -175,32 +159,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
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
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.
|
||||
*
|
||||
@@ -272,4 +273,4 @@ pin_number kGRBL_CommonEnablePinNumber = 8;
|
||||
|
||||
} // namespace Motate
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
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
|
||||
|
||||
@@ -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 *************************************************
|
||||
************************************************************************************/
|
||||
@@ -176,18 +158,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);
|
||||
@@ -195,10 +179,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
|
||||
|
||||
@@ -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
|
||||
@@ -94,7 +95,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
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
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.
|
||||
|
||||
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,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 *************************************************
|
||||
************************************************************************************/
|
||||
@@ -176,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_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
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* 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_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.
|
||||
|
||||
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 Robert Giseburt
|
||||
|
||||
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
|
||||
@@ -91,7 +92,7 @@ void hardware_init()
|
||||
|
||||
stat_t hardware_periodic()
|
||||
{
|
||||
float x_pos = cm_get_work_position(ACTIVE_MODEL, AXIS_X);
|
||||
float x_pos = cm_get_display_position(ACTIVE_MODEL, AXIS_X);
|
||||
if (fabs(LEDs::old_x_pos - x_pos) > 0.01) {
|
||||
LEDs::old_x_pos = x_pos;
|
||||
|
||||
@@ -162,15 +163,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
|
||||
@@ -214,15 +218,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
|
||||
@@ -230,22 +225,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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -37,41 +38,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 "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
|
||||
|
||||
#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 2 // 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
|
||||
|
||||
////////////////////////////
|
||||
/////// 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"
|
||||
#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 +72,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 *************************************************
|
||||
************************************************************************************/
|
||||
@@ -172,33 +155,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
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* 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_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.
|
||||
|
||||
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
+85
-90
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* gquintic-a-pinout.h - board pinout specification
|
||||
* For: /board/gQuintic
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Robert Giseburt
|
||||
* Copyright (c) 2016 Alden S. Hart Jr.
|
||||
* Copyright (c) 2016 - 2018 Robert Giseburt
|
||||
* Copyright (c) 2016 - 2018 Alden S. Hart Jr.
|
||||
*
|
||||
* This file is part of the Motate Library.
|
||||
*
|
||||
@@ -83,7 +84,6 @@
|
||||
#define INPUT12_AVAILABLE 0
|
||||
#define INPUT13_AVAILABLE 0
|
||||
|
||||
|
||||
#define ADC0_AVAILABLE 0
|
||||
#define ADC1_AVAILABLE 0
|
||||
#define ADC2_AVAILABLE 0
|
||||
@@ -116,99 +116,94 @@
|
||||
|
||||
namespace Motate {
|
||||
|
||||
// Unused:
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// All DO and DI and ADC board pinouts are for gQuintic Rev B
|
||||
// Designators agree with silkscreen on board
|
||||
|
||||
_MAKE_MOTATE_PIN(kLED_RGBWPixelPinNumber, 'A', 0); //
|
||||
_MAKE_MOTATE_PIN(kOutput1_PinNumber, 'A', 1); //
|
||||
_MAKE_MOTATE_PIN(kOutput2_PinNumber, 'A', 2); //
|
||||
_MAKE_MOTATE_PIN(kI2C1_SDAPinNumber, 'A', 3); //
|
||||
_MAKE_MOTATE_PIN(kI2C1_SCLPinNumber, 'A', 4); //
|
||||
_MAKE_MOTATE_PIN(kOutput11_PinNumber, 'A', 5); //
|
||||
_MAKE_MOTATE_PIN(kExternalClock1_PinNumber, 'A', 6); // CPU_CLK
|
||||
_MAKE_MOTATE_PIN(kOutput7_PinNumber, 'A', 7); //
|
||||
_MAKE_MOTATE_PIN(kSerial_RTSPinNumber, 'A', 8); //
|
||||
_MAKE_MOTATE_PIN(kSerial_RXPinNumber, 'A', 9); //
|
||||
_MAKE_MOTATE_PIN(kSerial_TXPinNumber, 'A', 10); //
|
||||
_MAKE_MOTATE_PIN(kSocket2_EnablePinNumber, 'A', 11); //
|
||||
_MAKE_MOTATE_PIN(kOutput6_PinNumber, 'A', 12); //
|
||||
_MAKE_MOTATE_PIN(kOutput8_PinNumber, 'A', 13); //
|
||||
_MAKE_MOTATE_PIN(kSocket1_StepPinNumber, 'A', 14); //
|
||||
_MAKE_MOTATE_PIN(kOutput3_PinNumber, 'A', 15); //
|
||||
_MAKE_MOTATE_PIN(kOutput4_PinNumber, 'A', 16); //
|
||||
_MAKE_MOTATE_PIN(kADC3_PinNumber, 'A', 17); //
|
||||
_MAKE_MOTATE_PIN(kADC2_PinNumber, 'A', 18); //
|
||||
_MAKE_MOTATE_PIN(kADC1_PinNumber, 'A', 19); //
|
||||
_MAKE_MOTATE_PIN(kADC0_PinNumber, 'A', 20); //
|
||||
_MAKE_MOTATE_PIN(kSerial_CTSPinNumber, 'A', 21); //
|
||||
_MAKE_MOTATE_PIN(kSocket1_EnablePinNumber, 'A', 22); //
|
||||
_MAKE_MOTATE_PIN(kOutput10_PinNumber, 'A', 23); //
|
||||
_MAKE_MOTATE_PIN(kSocket3_EnablePinNumber, 'A', 24); //
|
||||
_MAKE_MOTATE_PIN(kSocket2_DirPinNumber, 'A', 25); //
|
||||
_MAKE_MOTATE_PIN(kOutput5_PinNumber, 'A', 26); // On Timer 2!
|
||||
_MAKE_MOTATE_PIN(kSocket3_StepPinNumber, 'A', 27); // On Timer 2!
|
||||
_MAKE_MOTATE_PIN(kUnassigned1, 'A', 28); // DIAG1
|
||||
_MAKE_MOTATE_PIN(kUnassigned2, 'A', 29); //
|
||||
_MAKE_MOTATE_PIN(kInput1_PinNumber, 'A', 30); //
|
||||
_MAKE_MOTATE_PIN(kInput4_PinNumber, 'A', 31); //
|
||||
_MAKE_MOTATE_PIN(kLED_RGBWPixelPinNumber, 'A', 0); // DO12
|
||||
_MAKE_MOTATE_PIN(kOutput1_PinNumber, 'A', 1); // DO1
|
||||
_MAKE_MOTATE_PIN(kOutput2_PinNumber, 'A', 2); // DO2
|
||||
_MAKE_MOTATE_PIN(kI2C1_SDAPinNumber, 'A', 3); // SDA
|
||||
_MAKE_MOTATE_PIN(kI2C1_SCLPinNumber, 'A', 4); // SCK
|
||||
_MAKE_MOTATE_PIN(kOutput11_PinNumber, 'A', 5); // DO11
|
||||
_MAKE_MOTATE_PIN(kExternalClock1_PinNumber, 'A',6); // CPU_CLK (internal signal, not brought out)
|
||||
_MAKE_MOTATE_PIN(kOutput7_PinNumber, 'A', 7); // DO7
|
||||
_MAKE_MOTATE_PIN(kSerial_RTSPinNumber, 'A', 8); // RTS
|
||||
_MAKE_MOTATE_PIN(kSerial_RXPinNumber, 'A', 9); // RX
|
||||
_MAKE_MOTATE_PIN(kSerial_TXPinNumber, 'A', 10); // TX
|
||||
_MAKE_MOTATE_PIN(kSocket2_EnablePinNumber, 'A',11); // M2 ENAB
|
||||
_MAKE_MOTATE_PIN(kOutput6_PinNumber, 'A', 12); // DO6
|
||||
_MAKE_MOTATE_PIN(kOutput8_PinNumber, 'A', 13); // DO8
|
||||
_MAKE_MOTATE_PIN(kSocket1_StepPinNumber, 'A', 14); // M1 Step
|
||||
_MAKE_MOTATE_PIN(kOutput3_PinNumber, 'A', 15); // DO3
|
||||
_MAKE_MOTATE_PIN(kOutput4_PinNumber, 'A', 16); // DO4
|
||||
_MAKE_MOTATE_PIN(kADC3_PinNumber, 'A', 17); // ADC4
|
||||
_MAKE_MOTATE_PIN(kADC2_PinNumber, 'A', 18); // ADC3
|
||||
_MAKE_MOTATE_PIN(kADC1_PinNumber, 'A', 19); // ADC2
|
||||
_MAKE_MOTATE_PIN(kADC0_PinNumber, 'A', 20); // ADC1
|
||||
_MAKE_MOTATE_PIN(kSerial_CTSPinNumber, 'A', 21); // CTS
|
||||
_MAKE_MOTATE_PIN(kSocket1_EnablePinNumber, 'A',22); // M1 ENAB
|
||||
_MAKE_MOTATE_PIN(kOutput10_PinNumber, 'A', 23); // DO10
|
||||
_MAKE_MOTATE_PIN(kSocket3_EnablePinNumber, 'A',24); // M3 ENAB
|
||||
_MAKE_MOTATE_PIN(kSocket2_DirPinNumber, 'A', 25); // M2 DIR
|
||||
_MAKE_MOTATE_PIN(kOutput5_PinNumber, 'A', 26); // DO5 (On Timer 2!)
|
||||
_MAKE_MOTATE_PIN(kSocket3_StepPinNumber, 'A', 27); // M3 DIR (On Timer 2!)
|
||||
_MAKE_MOTATE_PIN(kUnassigned1, 'A', 28); // DIAG1 (internal signal)
|
||||
_MAKE_MOTATE_PIN(kUnassigned2, 'A', 29); // (not present on S70)
|
||||
_MAKE_MOTATE_PIN(kInput1_PinNumber, 'A', 30); // DI1
|
||||
_MAKE_MOTATE_PIN(kInput4_PinNumber, 'A', 31); // DI4
|
||||
|
||||
_MAKE_MOTATE_PIN(kInput12_PinNumber, 'B', 0); //
|
||||
_MAKE_MOTATE_PIN(kInput11_PinNumber, 'B', 1); //
|
||||
_MAKE_MOTATE_PIN(kSocket1_SPISlaveSelectPinNumber, 'B', 2); //
|
||||
_MAKE_MOTATE_PIN(kOutputSAFE_PinNumber, 'B', 3); //
|
||||
//_MAKE_MOTATE_PIN( , 'B', 4); // TDI
|
||||
//_MAKE_MOTATE_PIN( , 'B', 5); // TRACESDO
|
||||
//_MAKE_MOTATE_PIN( , 'B', 6); // SWDIO
|
||||
//_MAKE_MOTATE_PIN( , 'B', 7); // SWDCLK
|
||||
//_MAKE_MOTATE_PIN( , 'B', 8); // XOUT
|
||||
//_MAKE_MOTATE_PIN( , 'B', 9); // XIN
|
||||
//_MAKE_MOTATE_PIN( , 'B', 10); // USB_D-
|
||||
//_MAKE_MOTATE_PIN( , 'B', 11); // USB_D+
|
||||
//_MAKE_MOTATE_PIN( , 'B', 12); // ERASE
|
||||
_MAKE_MOTATE_PIN(kLED_USBRXPinNumber, 'B', 13); // LED_1 (Heartbeat) - PWM2
|
||||
_MAKE_MOTATE_PIN(kSocket4_SPISlaveSelectPinNumber, 'B', 14); // NOT CONNECTED
|
||||
_MAKE_MOTATE_PIN(kInput12_PinNumber, 'B', 0); // DI12
|
||||
_MAKE_MOTATE_PIN(kInput11_PinNumber, 'B', 1); // DI11
|
||||
_MAKE_MOTATE_PIN(kSocket1_SPISlaveSelectPinNumber,'B',2); // SPI Slave select 0 (multiplexed)
|
||||
_MAKE_MOTATE_PIN(kOutputSAFE_PinNumber, 'B', 3); // SAFI (SAFE pulses)
|
||||
//_MAKE_MOTATE_PIN( , 'B', 4); // TDI
|
||||
//_MAKE_MOTATE_PIN( , 'B', 5); // TRACESDO
|
||||
//_MAKE_MOTATE_PIN( , 'B', 6); // SWDIO
|
||||
//_MAKE_MOTATE_PIN( , 'B', 7); // SWDCLK
|
||||
//_MAKE_MOTATE_PIN( , 'B', 8); // XOUT
|
||||
//_MAKE_MOTATE_PIN( , 'B', 9); // XIN
|
||||
//_MAKE_MOTATE_PIN( , 'B', 10); // USB_D-
|
||||
//_MAKE_MOTATE_PIN( , 'B', 11); // USB_D+
|
||||
//_MAKE_MOTATE_PIN( , 'B', 12); // ERASE
|
||||
_MAKE_MOTATE_PIN(kLED_USBRXPinNumber, 'B', 13); // LED_1 (Heartbeat) - PWM2
|
||||
_MAKE_MOTATE_PIN(kSocket4_SPISlaveSelectPinNumber, 'B', 14); // not connected
|
||||
|
||||
|
||||
//_MAKE_MOTATE_PIN( , 'D', 0); // USB_VBUS
|
||||
_MAKE_MOTATE_PIN(kInput9_PinNumber, 'D', 1); //
|
||||
_MAKE_MOTATE_PIN(kInput10_PinNumber, 'D', 2); //
|
||||
_MAKE_MOTATE_PIN(kInput8_PinNumber, 'D', 3); //
|
||||
_MAKE_MOTATE_PIN(kInput7_PinNumber, 'D', 4); //
|
||||
_MAKE_MOTATE_PIN(kInput6_PinNumber, 'D', 5); //
|
||||
_MAKE_MOTATE_PIN(kInput5_PinNumber, 'D', 6); //
|
||||
_MAKE_MOTATE_PIN(kInput3_PinNumber, 'D', 7); //
|
||||
_MAKE_MOTATE_PIN(kInput2_PinNumber, 'D', 8); // ]
|
||||
_MAKE_MOTATE_PIN(kUnassigned3, 'D', 9); // DIAG0
|
||||
_MAKE_MOTATE_PIN(kUnassigned4, 'D', 10); //
|
||||
_MAKE_MOTATE_PIN(kSocket5_StepPinNumber, 'D', 11); //
|
||||
_MAKE_MOTATE_PIN(kSocket3_SPISlaveSelectPinNumber, 'D', 12); //
|
||||
_MAKE_MOTATE_PIN(kSocket5_DirPinNumber, 'D', 13); //
|
||||
_MAKE_MOTATE_PIN(kSocket5_EnablePinNumber, 'D', 14); //
|
||||
_MAKE_MOTATE_PIN(kUnassigned5, 'D', 15); //
|
||||
_MAKE_MOTATE_PIN(kSocket4_StepPinNumber, 'D', 16); //
|
||||
_MAKE_MOTATE_PIN(kSocket4_DirPinNumber, 'D', 17); //
|
||||
_MAKE_MOTATE_PIN(kSocket3_DirPinNumber, 'D', 18); //
|
||||
_MAKE_MOTATE_PIN(kUnassigned6, 'D', 19); //
|
||||
_MAKE_MOTATE_PIN(kSPI0_MISOPinNumber, 'D', 20); //
|
||||
_MAKE_MOTATE_PIN(kSPI0_MOSIPinNumber, 'D', 21); //
|
||||
_MAKE_MOTATE_PIN(kSPI0_SCKPinNumber, 'D', 22); //
|
||||
_MAKE_MOTATE_PIN(kUnassigned7, 'D', 23); //
|
||||
_MAKE_MOTATE_PIN(kSocket2_StepPinNumber, 'D', 24); //
|
||||
_MAKE_MOTATE_PIN(kSocket2_SPISlaveSelectPinNumber, 'D', 25); //
|
||||
_MAKE_MOTATE_PIN(kOutput9_PinNumber, 'D', 26); //
|
||||
_MAKE_MOTATE_PIN(kSocket1_DirPinNumber, 'D', 27); //
|
||||
_MAKE_MOTATE_PIN(kSocket4_EnablePinNumber, 'D', 28); //
|
||||
_MAKE_MOTATE_PIN(kUnassigned8, 'D', 29); //
|
||||
_MAKE_MOTATE_PIN(kUnassigned9, 'D', 30); // INTERRUPT_OUT
|
||||
_MAKE_MOTATE_PIN(kUnassigned10, 'D', 31); //
|
||||
//_MAKE_MOTATE_PIN( ,' D', 0); // USB_VBUS
|
||||
_MAKE_MOTATE_PIN(kInput9_PinNumber, 'D', 1); // DI9
|
||||
_MAKE_MOTATE_PIN(kInput10_PinNumber,'D', 2); // DI10
|
||||
_MAKE_MOTATE_PIN(kInput8_PinNumber, 'D', 3); // DI8
|
||||
_MAKE_MOTATE_PIN(kInput7_PinNumber, 'D', 4); // DI7
|
||||
_MAKE_MOTATE_PIN(kInput6_PinNumber, 'D', 5); // DI6
|
||||
_MAKE_MOTATE_PIN(kInput5_PinNumber, 'D', 6); // DI5
|
||||
_MAKE_MOTATE_PIN(kInput3_PinNumber, 'D', 7); // DI3
|
||||
_MAKE_MOTATE_PIN(kInput2_PinNumber, 'D', 8); // DI2
|
||||
_MAKE_MOTATE_PIN(kUnassigned3, 'D', 9); // DIAG0
|
||||
_MAKE_MOTATE_PIN(kUnassigned4, 'D', 10); // not connected
|
||||
_MAKE_MOTATE_PIN(kSocket5_StepPinNumber, 'D', 11); // M5 STEP
|
||||
_MAKE_MOTATE_PIN(kSocket3_SPISlaveSelectPinNumber, 'D',12); // SPI Slave select 2 (multiplexed)
|
||||
_MAKE_MOTATE_PIN(kSocket5_DirPinNumber, 'D', 13); // M5 DIR
|
||||
_MAKE_MOTATE_PIN(kSocket5_EnablePinNumber, 'D',14); // M5 ENAB
|
||||
_MAKE_MOTATE_PIN(kUnassigned5, 'D', 15); // not connected
|
||||
_MAKE_MOTATE_PIN(kSocket4_StepPinNumber, 'D', 16); // M4 STEP
|
||||
_MAKE_MOTATE_PIN(kSocket4_DirPinNumber, 'D', 17); // M4 DIR
|
||||
_MAKE_MOTATE_PIN(kSocket3_DirPinNumber, 'D', 18); // M3 STEP
|
||||
_MAKE_MOTATE_PIN(kUnassigned6, 'D', 19); // not connected
|
||||
_MAKE_MOTATE_PIN(kSPI0_MISOPinNumber, 'D', 20); // MISO
|
||||
_MAKE_MOTATE_PIN(kSPI0_MOSIPinNumber, 'D', 21); // MOSI
|
||||
_MAKE_MOTATE_PIN(kSPI0_SCKPinNumber, 'D', 22); // CLK
|
||||
_MAKE_MOTATE_PIN(kUnassigned7, 'D', 23); // not connected
|
||||
_MAKE_MOTATE_PIN(kSocket2_StepPinNumber, 'D', 24); // M2 STEP
|
||||
_MAKE_MOTATE_PIN(kSocket2_SPISlaveSelectPinNumber, 'D',25); // SPI Slave select 1 (multiplexed)
|
||||
_MAKE_MOTATE_PIN(kOutput9_PinNumber, 'D', 26); // DO9
|
||||
_MAKE_MOTATE_PIN(kSocket1_DirPinNumber, 'D', 27); // M1 DIR
|
||||
_MAKE_MOTATE_PIN(kSocket4_EnablePinNumber, 'D',28); // M4 ENAB
|
||||
_MAKE_MOTATE_PIN(kUnassigned8, 'D', 29); // (not present on S70)
|
||||
_MAKE_MOTATE_PIN(kUnassigned9, 'D', 30); // supposed to become INT (INTERRUPT_OUT)
|
||||
_MAKE_MOTATE_PIN(kUnassigned10, 'D', 31); // not connected
|
||||
|
||||
} // 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"
|
||||
|
||||
|
||||
Executable → Regular
+25
-31
@@ -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.
|
||||
@@ -96,15 +97,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
|
||||
@@ -148,14 +152,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
|
||||
@@ -164,22 +160,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
|
||||
#endif //__TEXT_MODE
|
||||
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* hardware.h - system hardware configuration
|
||||
* THIS FILE IS HARDWARE PLATFORM SPECIFIC - ARM version
|
||||
* For: /board/gQuintic
|
||||
* 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
|
||||
@@ -34,43 +35,33 @@
|
||||
#ifndef HARDWARE_H_ONCE
|
||||
#define HARDWARE_H_ONCE
|
||||
|
||||
|
||||
/*--- 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 "gQuintic"
|
||||
#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
|
||||
|
||||
#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 5 // 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;
|
||||
@@ -80,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 *************************************************
|
||||
************************************************************************************/
|
||||
@@ -173,18 +156,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);
|
||||
@@ -192,10 +177,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
+4
-3
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* motate_pin_assignments.h - pin assignments for the gQuintic boards
|
||||
* motate_pin_assignments.h - pin assignments
|
||||
* For: /board/gQuintic
|
||||
* 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
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_stepper.cpp - board-specific code for stepper.cpp
|
||||
* For: /board/printrboardg2
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
|
||||
Executable → Regular
+1
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* board_stepper.h - board-specific code for stepper.h
|
||||
* For: /board/printrboardg2
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2016 Alden S. Hart, Jr.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user