mirror of
https://github.com/synthetos/g2.git
synced 2026-09-21 10:35:38 +08:00
merging in edge to dev-p24-feedhold-lift. Still many things broken
This commit is contained in:
+1
-1
Submodule Motate updated: 18c93112f1...edf4f306fc
@@ -50,7 +50,9 @@ Build 100.xx also significantly advances the project structure to support multip
|
||||
- Included `G10 L20` offset mode
|
||||
- Extended `G38.2` probing to also include `G38.3`, `G38.4`, `G38.5`
|
||||
- Homing can now be set to a non-zero switch. Homing will set to the travel value of the positive or negative switch, as determined by the search direction. This allows homing to home to a maximum - for example - and set the homed location to the non-zero switch.
|
||||
|
||||
- [100.13] Fixes for dwells mixed with gcode moves.
|
||||
- [100.13] Minor planner refactoring to better handle commands and gcode mixed. (Forward-planning now looks past commands.)
|
||||
- [100.13] *Experimental!* Optioan `TRAVERSE_AT_HIGH_JERK` (defaults to off, set to 1 in a settings file to enable) will make traverse moves (`G0`) use the high-jerk settings instead of the normal jerk settings. This applies to all axes universally.
|
||||
|
||||
- **Planner and Motion Changes**
|
||||
- Junction Integration Time - the [`{jt:...}`](https://github.com/synthetos/g2/wiki/Configuring-0.99-System-Groups#jt-junction-integration-time) parameter is now the way to set cornering velocity limits. Cornering now obeys full jerk limitation instead of the centripetal acceleration heuristic, making it much more accurate and more true to the jerk limits set for the machine. JT is a normalized scaled factor that is nominally set to 1.000. Set to less than 1 for slower cornering (less aggressive), greater than 1 (but probably less than 2) for more aggressive cornering. This parameter replaces Junction Acceleration `{ja:...}` and the axis Junction Deviation commands - e.g. `{xjd:0.01}`.
|
||||
@@ -75,9 +77,23 @@ Build 100.xx also significantly advances the project structure to support multip
|
||||
- **Active JSON comments** - i.e. JSON called from Gcode
|
||||
- Added `M100 ({...})` active comment. Currently only supports temperature setting command.
|
||||
- Added `M101 ({...})` "wait-on-event" active comment. Currently only supports temperature wait command.
|
||||
- Additional note: `M101` will only wait on values that return `true` or `false`, and will only work if given `true` or `false`.
|
||||
- Valid example:
|
||||
```
|
||||
M101 ({in1: true})
|
||||
```
|
||||
- Using `0` or `1`, or anything except `true` or `false` will *not* work.
|
||||
|
||||
|
||||
- **System and Communications**
|
||||
- [100.13] **Important:** USB will only expose one virtal serial port by default.
|
||||
- This can be overridden in the settings file with:
|
||||
```c++
|
||||
// Valid options are 1 or 2 only!
|
||||
#define USB_SERIAL_PORTS_EXPOSED 1
|
||||
```
|
||||
- [100.13] Refactored XIO to handle `!`, `%`, `~`, and JSON commends intermixed with gcode better.
|
||||
- [100.13] Fixes to USB connection, initialization, and DMA operation for Sam3X-base machines.
|
||||
- Added `Linemode` communication protocol, and provide guidance to use linemode for much simpler and more reliable application-level flow control
|
||||
- Footer format has changed. Checksum is no longer supported and has been removed
|
||||
- Added `ENQ/ACK handshake`. If the host sends an ASCII `ENQ (0x05)` the board should respond with an `ACK (0x06)`. This is provided to facilitate low-level communications startup and automated testing
|
||||
|
||||
@@ -45,14 +45,10 @@ const Motate::USBSettings_t Motate::USBSettings = {
|
||||
|
||||
XIOUSBDevice_t usb;
|
||||
|
||||
extern decltype(usb.mixin<0>::Serial)& SerialUSB;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
extern decltype(usb.mixin<1>::Serial)& SerialUSB1;
|
||||
#endif
|
||||
|
||||
|
||||
decltype(usb.mixin<0>::Serial) &SerialUSB = usb.mixin<0>::Serial;
|
||||
//decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#endif
|
||||
|
||||
MOTATE_SET_USB_VENDOR_STRING( u"Synthetos" )
|
||||
MOTATE_SET_USB_PRODUCT_STRING( u"TinyG v2" )
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
void hardware_init()
|
||||
{
|
||||
board_hardware_init();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,11 +44,12 @@
|
||||
// Axes, motors & PWM channels 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 (1-6)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#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)
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
|
||||
@@ -45,14 +45,10 @@ const Motate::USBSettings_t Motate::USBSettings = {
|
||||
|
||||
XIOUSBDevice_t usb;
|
||||
|
||||
extern decltype(usb.mixin<0>::Serial)& SerialUSB;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
extern decltype(usb.mixin<1>::Serial)& SerialUSB1;
|
||||
#endif
|
||||
|
||||
|
||||
decltype(usb.mixin<0>::Serial) &SerialUSB = usb.mixin<0>::Serial;
|
||||
//decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#endif
|
||||
|
||||
MOTATE_SET_USB_VENDOR_STRING( u"Synthetos" )
|
||||
MOTATE_SET_USB_PRODUCT_STRING( u"TinyG v2" )
|
||||
@@ -75,8 +71,10 @@ Motate::UART<Motate::kSerial_RXPinNumber, Motate::kSerial_TXPinNumber, Motate::k
|
||||
|
||||
void board_hardware_init(void) // called 1st
|
||||
{
|
||||
#if XIO_HAS_USB
|
||||
// Init USB
|
||||
usb.attach(); // USB setup. Runs in "background" as the rest of this executes
|
||||
usb.attach(); // USB setup. Runs in "background" as the rest of this executes
|
||||
#endif // XIO_HAS_USB
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -64,9 +64,8 @@ extern Motate::SPI<Motate::kSocket4_SPISlaveSelectPinNumber> spi;
|
||||
extern Motate::UART<Motate::kSerial_RXPinNumber, Motate::kSerial_TXPinNumber, Motate::kSerial_RTSPinNumber, Motate::kSerial_CTSPinNumber> Serial;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//******* Generic Functions *******
|
||||
void board_xio_init(void);
|
||||
void board_hardware_init(void); // called 1st
|
||||
void board_xio_init(void); // called later
|
||||
|
||||
#endif // board_xio_h
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
void hardware_init()
|
||||
{
|
||||
board_hardware_init();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,11 +44,12 @@
|
||||
// Axes, motors & PWM channels 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 (1-6)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#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)
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
|
||||
@@ -120,10 +120,10 @@ _MAKE_MOTATE_PIN(kCoolant_EnablePinNumber, 'A', 1); // Coolant_EnableP
|
||||
_MAKE_MOTATE_PIN(kSocket4_VrefPinNumber, 'A', 2); // Socket4_VrefPinNumber
|
||||
_MAKE_MOTATE_PIN(kSocket5_VrefPinNumber, 'A', 3); // Socket5_VrefPinNumber
|
||||
_MAKE_MOTATE_PIN(kSocket2_Microstep_2PinNumber, 'A', 4); // Socket2_Microstep_2PinNumber
|
||||
_MAKE_MOTATE_PIN(kOutput3_PinNumber, 'A', 5); // Spindle_EnablePinNumber -- now used for Fan 1
|
||||
_MAKE_MOTATE_PIN(kSpindle_EnablePinNumber, 'A', 5); // Spindle_EnablePinNumber
|
||||
_MAKE_MOTATE_PIN(kSocket1_DirPinNumber, 'A', 6); // Socket1_DirPinNumber
|
||||
_MAKE_MOTATE_PIN(kSpindle_DirPinNumber, 'A', 7); // Spindle_DirPinNumber
|
||||
_MAKE_MOTATE_PIN(kOutput1_PinNumber, 'A', 8); // Spindle_PwmPinNumber -- now used for Extruder 1
|
||||
_MAKE_MOTATE_PIN(kSpindle_PwmPinNumber, 'A', 8); // Spindle_PwmPinNumber
|
||||
_MAKE_MOTATE_PIN(kInput2_PinNumber, 'A', 9); // XAxis_MaxPinNumber
|
||||
_MAKE_MOTATE_PIN(kInput3_PinNumber, 'A', 10); // YAxis_MinPinNumber
|
||||
_MAKE_MOTATE_PIN(kInput4_PinNumber, 'A', 11); // YAxis_MaxPinNumber
|
||||
|
||||
@@ -45,14 +45,10 @@ const Motate::USBSettings_t Motate::USBSettings = {
|
||||
|
||||
XIOUSBDevice_t usb;
|
||||
|
||||
extern decltype(usb.mixin<0>::Serial)& SerialUSB;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
extern decltype(usb.mixin<1>::Serial)& SerialUSB1;
|
||||
#endif
|
||||
|
||||
|
||||
decltype(usb.mixin<0>::Serial) &SerialUSB = usb.mixin<0>::Serial;
|
||||
//decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#endif
|
||||
|
||||
MOTATE_SET_USB_VENDOR_STRING( u"Synthetos" )
|
||||
MOTATE_SET_USB_PRODUCT_STRING( u"TinyG v2" )
|
||||
@@ -74,8 +70,10 @@ Motate::UART<Motate::kSerial_RXPinNumber, Motate::kSerial_TXPinNumber, Motate::k
|
||||
|
||||
void board_hardware_init(void) // called 1st
|
||||
{
|
||||
#if XIO_HAS_USB
|
||||
// Init USB
|
||||
usb.attach(); // USB setup. Runs in "background" as the rest of this executes
|
||||
usb.attach(); // USB setup. Runs in "background" as the rest of this executes
|
||||
#endif // XIO_HAS_USB
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,11 +44,12 @@
|
||||
// Axes, motors & PWM channels 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 (1-6)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#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)
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
|
||||
@@ -140,15 +140,15 @@ pin_number kInput10_PinNumber = 109;
|
||||
pin_number kInput11_PinNumber = 110;
|
||||
pin_number kInput12_PinNumber = 111;
|
||||
|
||||
pin_number kSpindle_EnablePinNumber = 112;
|
||||
pin_number kSpindle_DirPinNumber = 113;
|
||||
pin_number kSpindle_PwmPinNumber = 114;
|
||||
pin_number kSpindle_Pwm2PinNumber = 115;
|
||||
pin_number kCoolant_EnablePinNumber = 116;
|
||||
|
||||
// START DEBUG PINS - Convenient pins to hijack for hardware debugging
|
||||
// To reuse a pin for debug change the original pin number to -1
|
||||
// and uncomment the corresponding debug pin
|
||||
pin_number kSpindle_EnablePinNumber = 112; // Spindle ON implemented in g2ref
|
||||
pin_number kSpindle_DirPinNumber = 113; // Spindle ON implemented in g2ref
|
||||
pin_number kSpindle_PwmPinNumber = -1; // 114; // Not implemented (superseded by Extruder1_PWM)
|
||||
pin_number kSpindle_Pwm2PinNumber = -1; // 115; // Not implemented (superseded by Fan1B_PWM)
|
||||
pin_number kCoolant_EnablePinNumber = 116; // Spindle ON implemented in g2ref
|
||||
|
||||
pin_number kDebug1_PinNumber = -1; // 112;
|
||||
pin_number kDebug2_PinNumber = -1; // 113;
|
||||
pin_number kDebug3_PinNumber = -1; // 116; // Note the out-of-order numbering & 115 missing
|
||||
@@ -184,7 +184,7 @@ pin_number kOutput8_PinNumber = -1; // 137; // See Coolant Enable
|
||||
pin_number kOutput9_PinNumber = 138; // <unassigned, available out>
|
||||
pin_number kOutput10_PinNumber = 139; // DO_10: Fan2B_PWM
|
||||
|
||||
pin_number kOutput11_PinNumber = 140; // DO_11: Heted Bed FET
|
||||
pin_number kOutput11_PinNumber = 140; // DO_11: Heated Bed FET
|
||||
pin_number kOutput12_PinNumber = 141; // DO_12: Indicator_LED
|
||||
pin_number kOutput13_PinNumber = -1; // 142;
|
||||
pin_number kOutput14_PinNumber = -1; // 143;
|
||||
|
||||
@@ -45,14 +45,10 @@ const Motate::USBSettings_t Motate::USBSettings = {
|
||||
|
||||
XIOUSBDevice_t usb;
|
||||
|
||||
extern decltype(usb.mixin<0>::Serial)& SerialUSB;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
extern decltype(usb.mixin<1>::Serial)& SerialUSB1;
|
||||
#endif
|
||||
|
||||
|
||||
decltype(usb.mixin<0>::Serial) &SerialUSB = usb.mixin<0>::Serial;
|
||||
//decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#endif
|
||||
|
||||
MOTATE_SET_USB_VENDOR_STRING( u"Synthetos" )
|
||||
MOTATE_SET_USB_PRODUCT_STRING( u"TinyG v2" )
|
||||
|
||||
@@ -50,11 +50,19 @@
|
||||
#define MOTORS 3 // number of motors on the board
|
||||
#define COORDS 6 // number of supported coordinate systems (1-6)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#define TOOLS 32 // number of entries in tool table (index starts at 1)
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
*************************/
|
||||
|
||||
////////////////////////////
|
||||
/////// ARM VERSION ////////
|
||||
////////////////////////////
|
||||
|
||||
// ARM specific code start here
|
||||
>>>>>>> refs/heads/edge
|
||||
|
||||
#include "MotatePins.h"
|
||||
#include "MotateTimers.h" // for TimerChanel<> and related...
|
||||
#include "MotateServiceCall.h" // for ServiceCall<>
|
||||
|
||||
@@ -45,14 +45,10 @@ const Motate::USBSettings_t Motate::USBSettings = {
|
||||
|
||||
XIOUSBDevice_t usb;
|
||||
|
||||
extern decltype(usb.mixin<0>::Serial)& SerialUSB;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
extern decltype(usb.mixin<1>::Serial)& SerialUSB1;
|
||||
#endif
|
||||
|
||||
|
||||
decltype(usb.mixin<0>::Serial) &SerialUSB = usb.mixin<0>::Serial;
|
||||
//decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#endif
|
||||
|
||||
MOTATE_SET_USB_VENDOR_STRING( u"Synthetos" )
|
||||
MOTATE_SET_USB_PRODUCT_STRING( u"TinyG v2" )
|
||||
|
||||
@@ -48,8 +48,9 @@
|
||||
#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 (1-6)
|
||||
#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)
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
@@ -71,9 +72,9 @@ using Motate::OutputPin;
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
#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
|
||||
#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 SAM3X8E SPECIFIC HARDWARE *************************************************
|
||||
|
||||
@@ -45,14 +45,10 @@ const Motate::USBSettings_t Motate::USBSettings = {
|
||||
|
||||
XIOUSBDevice_t usb;
|
||||
|
||||
extern decltype(usb.mixin<0>::Serial)& SerialUSB;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
extern decltype(usb.mixin<1>::Serial)& SerialUSB1;
|
||||
#endif
|
||||
|
||||
|
||||
decltype(usb.mixin<0>::Serial) &SerialUSB = usb.mixin<0>::Serial;
|
||||
//decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#endif
|
||||
|
||||
MOTATE_SET_USB_VENDOR_STRING( u"Synthetos" )
|
||||
MOTATE_SET_USB_PRODUCT_STRING( u"TinyG v2" )
|
||||
|
||||
@@ -47,8 +47,9 @@
|
||||
#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 (1-6)
|
||||
#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)
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
@@ -70,9 +71,9 @@ using Motate::OutputPin;
|
||||
* Global System Defines *
|
||||
*************************/
|
||||
|
||||
#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
|
||||
#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 SAM3X8E SPECIFIC HARDWARE *************************************************
|
||||
|
||||
@@ -45,14 +45,10 @@ const Motate::USBSettings_t Motate::USBSettings = {
|
||||
|
||||
XIOUSBDevice_t usb;
|
||||
|
||||
extern decltype(usb.mixin<0>::Serial)& SerialUSB;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
extern decltype(usb.mixin<1>::Serial)& SerialUSB1;
|
||||
#endif
|
||||
|
||||
|
||||
decltype(usb.mixin<0>::Serial) &SerialUSB = usb.mixin<0>::Serial;
|
||||
//decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#if USB_SERIAL_PORTS_EXPOSED == 2
|
||||
decltype(usb.mixin<1>::Serial) &SerialUSB1 = usb.mixin<1>::Serial;
|
||||
#endif
|
||||
|
||||
MOTATE_SET_USB_VENDOR_STRING( u"Synthetos" )
|
||||
MOTATE_SET_USB_PRODUCT_STRING( u"TinyG v2" )
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
void hardware_init()
|
||||
{
|
||||
board_hardware_init();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#define MOTORS 4 // number of motors on the board
|
||||
#define COORDS 6 // number of supported coordinate systems (1-6)
|
||||
#define PWMS 2 // number of supported PWM channels
|
||||
#define TOOLS 32 // number of entries in tool table (index starts at 1)
|
||||
|
||||
/*************************
|
||||
* Motate Setup *
|
||||
|
||||
+238
-86
File diff suppressed because it is too large
Load Diff
+493
-70
File diff suppressed because it is too large
Load Diff
+29
-7
@@ -259,7 +259,16 @@ stat_t set_noop(nvObj_t *nv) {
|
||||
stat_t set_nul(nvObj_t *nv) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_PARAMETER_IS_READ_ONLY); // this is what it should be
|
||||
// return (STAT_OK); // hack until JSON is refactored
|
||||
return (STAT_OK); // hack until JSON is refactored
|
||||
}
|
||||
|
||||
stat_t set_ro(nvObj_t *nv) {
|
||||
// hack. If setting an SR it doesn't fail
|
||||
if (strcmp(nv_body->token, "sr") == 0) {
|
||||
return (STAT_OK);
|
||||
}
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_PARAMETER_IS_READ_ONLY);
|
||||
}
|
||||
|
||||
stat_t set_ui8(nvObj_t *nv)
|
||||
@@ -278,27 +287,39 @@ stat_t set_int8(nvObj_t *nv)
|
||||
|
||||
stat_t set_01(nvObj_t *nv)
|
||||
{
|
||||
if ((nv->value < 0) || (nv->value > 1)) {
|
||||
if (nv->value < 0) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_VALUE_RANGE_ERROR);
|
||||
return (STAT_INPUT_LESS_THAN_MIN_VALUE);
|
||||
}
|
||||
if (nv->value > 1) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_EXCEEDS_MAX_VALUE);
|
||||
}
|
||||
return (set_ui8(nv));
|
||||
}
|
||||
|
||||
stat_t set_012(nvObj_t *nv)
|
||||
{
|
||||
if ((nv->value < 0) || (nv->value > 2)) {
|
||||
if (nv->value < 0) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_VALUE_RANGE_ERROR);
|
||||
return (STAT_INPUT_LESS_THAN_MIN_VALUE);
|
||||
}
|
||||
if (nv->value > 2) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_EXCEEDS_MAX_VALUE);
|
||||
}
|
||||
return (set_ui8(nv));
|
||||
}
|
||||
|
||||
stat_t set_0123(nvObj_t *nv)
|
||||
{
|
||||
if ((nv->value < 0) || (nv->value > 3)) {
|
||||
if (nv->value < 0) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_VALUE_RANGE_ERROR);
|
||||
return (STAT_INPUT_LESS_THAN_MIN_VALUE);
|
||||
}
|
||||
if (nv->value > 3) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_EXCEEDS_MAX_VALUE);
|
||||
}
|
||||
return (set_ui8(nv));
|
||||
}
|
||||
@@ -702,6 +723,7 @@ nvObj_t *nv_add_conditional_message(const char *string) // conditionally add
|
||||
* Inputs:
|
||||
* json_flags = JSON_OBJECT_FORMAT - print just the body w/o header or footer
|
||||
* json_flags = JSON_RESPONSE_FORMAT - print a full "r" object with footer
|
||||
* json_flags = JSON_RESPONSE_TO_MUTED_FORMAT - JSON_RESPONSE_FORMAT, but only to muted channels
|
||||
*
|
||||
* text_flags = TEXT_INLINE_PAIRS - print text as name/value pairs on a single line
|
||||
* text_flags = TEXT_INLINE_VALUES - print text as comma separated values on a single line
|
||||
|
||||
@@ -319,6 +319,7 @@ bool nv_group_is_prefixed(char *group);
|
||||
// generic internal functions and accessors
|
||||
stat_t set_noop(nvObj_t *nv); // set nothing and return OK
|
||||
stat_t set_nul(nvObj_t *nv); // set nothing and return READ_ONLY error
|
||||
stat_t set_ro(nvObj_t *nv); // set nothing, return read-only error
|
||||
stat_t set_ui8(nvObj_t *nv); // set uint8_t value
|
||||
stat_t set_int8(nvObj_t *nv); // set signed 8 bit integer
|
||||
stat_t set_01(nvObj_t *nv); // set a 0 or 1 value with validation
|
||||
@@ -353,6 +354,7 @@ nvObj_t *nv_add_conditional_message(const char *string);
|
||||
void nv_print_list(stat_t status, uint8_t text_flags, uint8_t json_flags);
|
||||
|
||||
// application specific helpers and functions (config_app.c)
|
||||
|
||||
stat_t set_flu(nvObj_t *nv); // set floating point number with G20/G21 units conversion
|
||||
|
||||
void process_incoming_float(nvObj_t *nv); // pre-process outgoing float values for units and illegal values
|
||||
|
||||
+364
-79
File diff suppressed because it is too large
Load Diff
+33
-6
@@ -72,7 +72,7 @@ static stat_t _sync_to_planner(void);
|
||||
static stat_t _sync_to_tx_buffer(void);
|
||||
static stat_t _dispatch_command(void);
|
||||
static stat_t _dispatch_control(void);
|
||||
static void _dispatch_kernel(void);
|
||||
static void _dispatch_kernel(const devflags_t flags);
|
||||
static stat_t _controller_state(void); // manage controller state transitions
|
||||
|
||||
static Motate::OutputPin<Motate::kOutputSAFE_PinNumber> safe_pin;
|
||||
@@ -191,7 +191,7 @@ static stat_t _dispatch_control()
|
||||
if (cs.controller_state != CONTROLLER_PAUSED) {
|
||||
devflags_t flags = DEV_IS_CTRL;
|
||||
if ((cs.bufp = xio_readline(flags, cs.linelen)) != NULL) {
|
||||
_dispatch_kernel();
|
||||
_dispatch_kernel(flags);
|
||||
}
|
||||
}
|
||||
return (STAT_OK);
|
||||
@@ -200,17 +200,27 @@ static stat_t _dispatch_control()
|
||||
static stat_t _dispatch_command()
|
||||
{
|
||||
if (cs.controller_state != CONTROLLER_PAUSED) {
|
||||
devflags_t flags = DEV_IS_BOTH;
|
||||
devflags_t flags = DEV_IS_BOTH | DEV_IS_MUTED; // expressly state we'll handle muted devices
|
||||
if ((!mp_planner_is_full(ACTIVE_Q)) && (cs.bufp = xio_readline(flags, cs.linelen)) != NULL) {
|
||||
_dispatch_kernel();
|
||||
_dispatch_kernel(flags);
|
||||
}
|
||||
}
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
static void _dispatch_kernel()
|
||||
static void _dispatch_kernel(const devflags_t flags)
|
||||
{
|
||||
stat_t status;
|
||||
|
||||
if (flags & DEV_IS_MUTED) {
|
||||
status = STAT_INPUT_FROM_MUTED_CHANNEL_ERROR;
|
||||
nv_reset_nv_list(); // get a fresh nvObj list
|
||||
nv_add_string((const char *)"msg", "lines from muted devices are ignored");
|
||||
nv_print_list(status, TEXT_NO_PRINT, JSON_RESPONSE_TO_MUTED_FORMAT);
|
||||
|
||||
// It's possible to let some stuff through, but that's not happening yet.
|
||||
return;
|
||||
}
|
||||
|
||||
while ((*cs.bufp == SPC) || (*cs.bufp == TAB)) { // position past any leading whitespace
|
||||
cs.bufp++;
|
||||
@@ -299,6 +309,23 @@ void controller_set_connected(bool is_connected) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* controller_set_muted(bool) - hook for xio to tell the controller that we
|
||||
* have/don't have one or more muted devices.
|
||||
*/
|
||||
|
||||
void controller_set_muted(bool is_muted) {
|
||||
// TODO: care about text mode
|
||||
if (is_muted) {
|
||||
// one channel just got muted.
|
||||
const bool only_to_muted = true;
|
||||
xio_writeline("{\"muted\":true}\n", only_to_muted);
|
||||
} else {
|
||||
// one channel just got unmuted, announce it (except to the muted)
|
||||
xio_writeline("{\"muted\":false}\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* controller_parse_control() - return true if command is a control (versus data)
|
||||
* Note: parsing for control is somewhat naiive. This will need to get better
|
||||
@@ -456,4 +483,4 @@ stat_t _test_system_assertions()
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ extern controller_t cs; // controller state structure
|
||||
void controller_init(void);
|
||||
void controller_run(void);
|
||||
void controller_set_connected(bool is_connected);
|
||||
void controller_set_muted(bool is_muted);
|
||||
bool controller_parse_control(char *p);
|
||||
|
||||
#endif // End of include guard: CONTROLLER_H_ONCE
|
||||
|
||||
@@ -162,7 +162,7 @@ stat_t cm_homing_cycle_start(void) {
|
||||
|
||||
// set working values
|
||||
cm_set_units_mode(MILLIMETERS);
|
||||
cm_set_distance_mode(INCREMENTAL_MODE);
|
||||
cm_set_distance_mode(INCREMENTAL_DISTANCE_MODE);
|
||||
cm_set_coord_system(ABSOLUTE_COORDS); // homing is done in machine coordinates
|
||||
cm_set_feed_rate_mode(UNITS_PER_MINUTE_MODE);
|
||||
hm.set_coordinates = true;
|
||||
|
||||
@@ -95,7 +95,7 @@ stat_t cm_jogging_cycle_start(uint8_t axis) {
|
||||
|
||||
// set working values
|
||||
cm_set_units_mode(MILLIMETERS);
|
||||
cm_set_distance_mode(ABSOLUTE_MODE);
|
||||
cm_set_distance_mode(ABSOLUTE_DISTANCE_MODE);
|
||||
cm_set_coord_system(ABSOLUTE_COORDS); // jogging is done in machine coordinates
|
||||
cm_set_feed_rate_mode(UNITS_PER_MINUTE_MODE);
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ static uint8_t _probing_init() {
|
||||
pb.saved_distance_mode = cm_get_distance_mode(ACTIVE_MODEL);
|
||||
|
||||
// set working values
|
||||
cm_set_distance_mode(ABSOLUTE_MODE);
|
||||
cm_set_distance_mode(ABSOLUTE_DISTANCE_MODE);
|
||||
cm_set_coord_system(ABSOLUTE_COORDS); // probing is done in machine coordinates
|
||||
|
||||
// initialize the axes - save the jerk settings & switch to the jerk_homing settings
|
||||
@@ -309,7 +309,7 @@ static stat_t _probe_axis_move(const float target[], bool exact_position) {
|
||||
if (exact_position) {
|
||||
cm_set_absolute_override(MODEL, ABSOLUTE_OVERRIDE_ON); // Position was stored in absolute coords
|
||||
cm->gm.units_mode = MILLIMETERS;
|
||||
cm->gm.distance_mode = ABSOLUTE_MODE;
|
||||
cm->gm.distance_mode = ABSOLUTE_DISTANCE_MODE;
|
||||
}
|
||||
|
||||
for (uint8_t axis = AXIS_X; axis < AXES; axis++) { // set all positions
|
||||
|
||||
+4
-3
@@ -2,8 +2,8 @@
|
||||
* error.h - g2core status codes
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2010 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2010 - 2017 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2010 - 2017 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
|
||||
@@ -204,7 +204,8 @@ char *get_status_message(stat_t status);
|
||||
#define STAT_MAX_DEPTH_EXCEEDED 115 // JSON exceeded maximum nesting depth
|
||||
#define STAT_VALUE_TYPE_ERROR 116 // JSON value does not agree with variable type
|
||||
|
||||
#define STAT_ERROR_DEVICE_NOT_ACTIVE 117 // Device cannot receive commands at this time
|
||||
//#define STAT_ERROR_DEVICE_NOT_ACTIVE 117 // Device cannot receive commands at this time
|
||||
#define STAT_INPUT_FROM_MUTED_CHANNEL_ERROR 117 // input from a muted channel was ignored
|
||||
#define STAT_ERROR_118 118
|
||||
#define STAT_ERROR_119 119
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<InterfaceName>SWD</InterfaceName>
|
||||
</ToolOptions>
|
||||
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
|
||||
<ToolNumber>J41800036434</ToolNumber>
|
||||
<ToolNumber>J41800030015</ToolNumber>
|
||||
<ToolName>Atmel-ICE</ToolName>
|
||||
</com_atmel_avrdbg_tool_atmelice>
|
||||
<UseGdb>True</UseGdb>
|
||||
@@ -100,7 +100,7 @@
|
||||
<HWProgramCounterSampling>True</HWProgramCounterSampling>
|
||||
</PercepioTrace>
|
||||
<preserveEEPROM>true</preserveEEPROM>
|
||||
<avrtoolserialnumber>J41800036434</avrtoolserialnumber>
|
||||
<avrtoolserialnumber>J41800030015</avrtoolserialnumber>
|
||||
<avrdeviceexpectedsignature>0x284E0A60</avrdeviceexpectedsignature>
|
||||
<avrtoolinterfaceclock>10000000</avrtoolinterfaceclock>
|
||||
<custom>
|
||||
|
||||
Executable → Regular
+2
-2
@@ -2,8 +2,8 @@
|
||||
* g2core.h - g2core main header file
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2010 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2010 - 2017 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2010 - 2017 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
|
||||
|
||||
@@ -53,13 +53,12 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
D41997401DF9D6A800E0FB51 /* settings */ = {isa = PBXFileReference; lastKnownFileType = folder; path = settings; sourceTree = "<group>"; };
|
||||
D43FF6F51D52C8AF00FB5B53 /* board */ = {isa = PBXFileReference; lastKnownFileType = folder; path = board; sourceTree = "<group>"; };
|
||||
D44E72C01D663B0300ECD5DD /* coolant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coolant.cpp; sourceTree = "<group>"; };
|
||||
D44E72C21D663B0F00ECD5DD /* coolant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coolant.h; sourceTree = "<group>"; };
|
||||
D4522DC91C45F41D0086AAE6 /* g2core_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = g2core_info.h; sourceTree = "<group>"; };
|
||||
D457117B17053EFA00EA19A8 /* Makefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile; sourceTree = "<group>"; usesTabs = 1; xcLanguageSpecificationIdentifier = xcode.lang.sh; };
|
||||
D4782AB21D9B5F9400B32136 /* settings_watercolorbot_v2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = settings_watercolorbot_v2.h; sourceTree = "<group>"; };
|
||||
D4782AB41D9E2FF300B32136 /* settings_eggbot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = settings_eggbot.h; sourceTree = "<group>"; };
|
||||
D47B744C1D4925B4004FAB53 /* device */ = {isa = PBXFileReference; lastKnownFileType = folder; path = device; sourceTree = "<group>"; };
|
||||
D48F5A40172CB1F900D0E055 /* canonical_machine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = canonical_machine.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
D48F5A41172CB1F900D0E055 /* config_app.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = config_app.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
@@ -100,25 +99,10 @@
|
||||
D48F5A7F172CB21100D0E055 /* g2core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = g2core.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D48F5A80172CB21100D0E055 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; };
|
||||
D48F5A81172CB21100D0E055 /* xio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = xio.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D49177A11D21CFC50029CDEB /* settings_Printrbot_Simple_1403.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = settings_Printrbot_Simple_1403.h; sourceTree = "<group>"; };
|
||||
D49177A21D21CFDB0029CDEB /* settings_Printrbot_Simple_1608.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = settings_Printrbot_Simple_1608.h; sourceTree = "<group>"; };
|
||||
D4922F3F1CB8361B00A565FF /* boards.mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = boards.mk; sourceTree = "<group>"; };
|
||||
D49367D71B87CA8A000BB759 /* temperature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = temperature.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
D49367D81B87CA8A000BB759 /* temperature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = temperature.h; sourceTree = "<group>"; };
|
||||
D49367DB1B8E0AF1000BB759 /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = error.h; sourceTree = "<group>"; };
|
||||
D4AC39081C77C1F20098D685 /* settings_default.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_default.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC39091C77C1F20098D685 /* settings_makeblock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_makeblock.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC390A1C77C1F20098D685 /* settings_othermill_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_othermill_test.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC390B1C77C1F20098D685 /* settings_othermill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_othermill.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC390C1C77C1F20098D685 /* settings_Printrbot_Play.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_Printrbot_Play.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC390D1C77C1F20098D685 /* settings_Printrbot_Plus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_Printrbot_Plus.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC390F1C77C1F20098D685 /* settings_probotixV90.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_probotixV90.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC39101C77C1F20098D685 /* settings_shapeoko2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_shapeoko2.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC39111C77C1F20098D685 /* settings_shopbot_sbv300.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_shopbot_sbv300.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC39121C77C1F20098D685 /* settings_shopbot_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_shopbot_test.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC39131C77C1F20098D685 /* settings_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = settings_test.h; sourceTree = "<group>"; };
|
||||
D4AC39141C77C1F20098D685 /* settings_Ultimaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = settings_Ultimaker.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
D4AC39151C77C1F20098D685 /* settings_zen7x12.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = settings_zen7x12.h; sourceTree = "<group>"; };
|
||||
D4B6579C18B5C1DE00F8616C /* plan_exec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = plan_exec.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
D4B6579E18B5C21500F8616C /* cycle_jogging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cycle_jogging.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
D4B6579F18B5C21500F8616C /* cycle_probing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cycle_probing.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
@@ -144,30 +128,6 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
D41D13F617374B7D00D522D9 /* settings */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D4AC39081C77C1F20098D685 /* settings_default.h */,
|
||||
D4782AB41D9E2FF300B32136 /* settings_eggbot.h */,
|
||||
D4782AB21D9B5F9400B32136 /* settings_watercolorbot_v2.h */,
|
||||
D4AC39091C77C1F20098D685 /* settings_makeblock.h */,
|
||||
D4AC390A1C77C1F20098D685 /* settings_othermill_test.h */,
|
||||
D4AC390B1C77C1F20098D685 /* settings_othermill.h */,
|
||||
D4AC390C1C77C1F20098D685 /* settings_Printrbot_Play.h */,
|
||||
D4AC390D1C77C1F20098D685 /* settings_Printrbot_Plus.h */,
|
||||
D49177A11D21CFC50029CDEB /* settings_Printrbot_Simple_1403.h */,
|
||||
D49177A21D21CFDB0029CDEB /* settings_Printrbot_Simple_1608.h */,
|
||||
D4AC390F1C77C1F20098D685 /* settings_probotixV90.h */,
|
||||
D4AC39101C77C1F20098D685 /* settings_shapeoko2.h */,
|
||||
D4AC39111C77C1F20098D685 /* settings_shopbot_sbv300.h */,
|
||||
D4AC39121C77C1F20098D685 /* settings_shopbot_test.h */,
|
||||
D4AC39131C77C1F20098D685 /* settings_test.h */,
|
||||
D4AC39141C77C1F20098D685 /* settings_Ultimaker.h */,
|
||||
D4AC39151C77C1F20098D685 /* settings_zen7x12.h */,
|
||||
);
|
||||
path = settings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D45710B7170532AC00EA19A8 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -231,7 +191,7 @@
|
||||
D4922F3F1CB8361B00A565FF /* boards.mk */,
|
||||
D43FF6F51D52C8AF00FB5B53 /* board */,
|
||||
D47B744C1D4925B4004FAB53 /* device */,
|
||||
D41D13F617374B7D00D522D9 /* settings */,
|
||||
D41997401DF9D6A800E0FB51 /* settings */,
|
||||
D4FEBFF81B0A65E30042EA32 /* index */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* g2core_info.h - g2core build information
|
||||
* This file is part of the g2core project
|
||||
*
|
||||
* Copyright (c) 2010 - 2016 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2010 - 2016 Robert Giseburt
|
||||
* Copyright (c) 2010 - 2017 Alden S. Hart, Jr.
|
||||
* Copyright (c) 2010 - 2017 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
|
||||
@@ -21,8 +21,8 @@
|
||||
#ifndef G2CORE_INFO_H_ONCE
|
||||
#define G2CORE_INFO_H_ONCE
|
||||
|
||||
#define G2CORE_FIRMWARE_BUILD 100.12 // Changes to USB serial for SAMS70 and SAM8X targets
|
||||
#define G2CORE_FIRMWARE_VERSION 0.99 // firmware major version
|
||||
#define G2CORE_FIRMWARE_BUILD 100.17 // Added tool offsets (PR #211)
|
||||
#define G2CORE_FIRMWARE_VERSION 0.99
|
||||
|
||||
#ifdef GIT_VERSION
|
||||
#define G2CORE_FIRMWARE_BUILD_STRING GIT_VERSION
|
||||
|
||||
+21
-16
@@ -31,26 +31,28 @@
|
||||
|
||||
typedef enum { // these are in order to optimized CASE statement
|
||||
NEXT_ACTION_DEFAULT = 0, // Must be zero (invokes motion modes)
|
||||
NEXT_ACTION_DWELL, // G4
|
||||
NEXT_ACTION_SET_G10_DATA, // G10
|
||||
NEXT_ACTION_GOTO_G28_POSITION, // G28 go to machine position
|
||||
NEXT_ACTION_SET_G28_POSITION, // G28.1 set position in abs coordinates
|
||||
NEXT_ACTION_SEARCH_HOME, // G28.2 homing cycle
|
||||
NEXT_ACTION_SET_ABSOLUTE_ORIGIN, // G28.3 origin set
|
||||
NEXT_ACTION_HOMING_NO_SET, // G28.4 homing cycle with no coordinate setting
|
||||
NEXT_ACTION_SET_G28_POSITION, // G28.1 set position in abs coordinates
|
||||
NEXT_ACTION_GOTO_G28_POSITION, // G28 go to machine position
|
||||
NEXT_ACTION_SET_G30_POSITION, // G30.1
|
||||
NEXT_ACTION_GOTO_G30_POSITION, // G30
|
||||
NEXT_ACTION_SET_COORD_DATA, // G10
|
||||
NEXT_ACTION_SET_ORIGIN_OFFSETS, // G92
|
||||
NEXT_ACTION_RESET_ORIGIN_OFFSETS, // G92.1
|
||||
NEXT_ACTION_SUSPEND_ORIGIN_OFFSETS, // G92.2
|
||||
NEXT_ACTION_RESUME_ORIGIN_OFFSETS, // G92.3
|
||||
NEXT_ACTION_DWELL, // G4
|
||||
NEXT_ACTION_GOTO_G30_POSITION, // G30 go to machine position
|
||||
NEXT_ACTION_SET_G30_POSITION, // G30.1 set position in abs coordinates
|
||||
NEXT_ACTION_STRAIGHT_PROBE_ERR, // G38.2
|
||||
NEXT_ACTION_STRAIGHT_PROBE, // G38.3
|
||||
NEXT_ACTION_STRAIGHT_PROBE_AWAY_ERR,// G38.4
|
||||
NEXT_ACTION_STRAIGHT_PROBE_AWAY, // G38.5
|
||||
NEXT_ACTION_SET_TL_OFFSET, // G43
|
||||
NEXT_ACTION_SET_ADDITIONAL_TL_OFFSET,// G43.2
|
||||
NEXT_ACTION_CANCEL_TL_OFFSET, // G49
|
||||
NEXT_ACTION_SET_ORIGIN_OFFSETS, // G92
|
||||
NEXT_ACTION_RESET_ORIGIN_OFFSETS, // G92.1
|
||||
NEXT_ACTION_SUSPEND_ORIGIN_OFFSETS, // G92.2
|
||||
NEXT_ACTION_RESUME_ORIGIN_OFFSETS, // G92.3
|
||||
NEXT_ACTION_JSON_COMMAND_SYNC, // M100
|
||||
NEXT_ACTION_JSON_COMMAND_IMMEDIATE, // M101
|
||||
NEXT_ACTION_JSON_WAIT // M102
|
||||
NEXT_ACTION_JSON_WAIT // M101
|
||||
} cmNextAction;
|
||||
|
||||
typedef enum { // G Modal Group 1
|
||||
@@ -128,8 +130,8 @@ typedef enum { // G Modal Group 13
|
||||
} cmPathControl;
|
||||
|
||||
typedef enum {
|
||||
ABSOLUTE_MODE = 0, // G90 / G90.1
|
||||
INCREMENTAL_MODE // G91 / G91.1
|
||||
ABSOLUTE_DISTANCE_MODE = 0, // G90 / G90.1
|
||||
INCREMENTAL_DISTANCE_MODE // G91 / G91.1
|
||||
} cmDistanceMode;
|
||||
|
||||
typedef enum {
|
||||
@@ -156,6 +158,7 @@ typedef enum { // used for spindle and arc dir
|
||||
} cmDirection;
|
||||
|
||||
typedef enum { // axis types
|
||||
AXIS_TYPE_SYSTEM=-2, // no axis, system parameter
|
||||
AXIS_TYPE_UNDEFINED=-1, // invalid type
|
||||
AXIS_TYPE_LINEAR, // linear axis
|
||||
AXIS_TYPE_ROTARY // rotary axis
|
||||
@@ -244,8 +247,8 @@ typedef struct GCodeState { // Gcode model state - used by model, pl
|
||||
select_plane = CANON_PLANE_XY;
|
||||
units_mode = INCHES;
|
||||
path_control = PATH_EXACT_PATH;
|
||||
distance_mode = ABSOLUTE_MODE;
|
||||
arc_distance_mode = ABSOLUTE_MODE;
|
||||
distance_mode = ABSOLUTE_DISTANCE_MODE;
|
||||
arc_distance_mode = ABSOLUTE_DISTANCE_MODE;
|
||||
absolute_override = ABSOLUTE_OVERRIDE_OFF;
|
||||
coord_system = ABSOLUTE_COORDS;
|
||||
tool = 0;
|
||||
@@ -292,6 +295,7 @@ typedef struct GCodeInput { // Gcode model inputs - meaning depends
|
||||
uint32_t linenum; // N word
|
||||
float target[AXES]; // XYZABC where the move should go
|
||||
|
||||
uint8_t H_word; // H word - used by G43s
|
||||
uint8_t L_word; // L word - used by G10s
|
||||
|
||||
float feed_rate; // F - normalized to millimeters/minute
|
||||
@@ -338,6 +342,7 @@ typedef struct GCodeFlags { // Gcode model input flags
|
||||
bool linenum;
|
||||
bool target[AXES];
|
||||
|
||||
bool H_word;
|
||||
bool L_word;
|
||||
bool feed_rate;
|
||||
bool feed_rate_mode;
|
||||
|
||||
+32
-9
@@ -439,7 +439,7 @@ static stat_t _parse_gcode_block(char *buf, char *active_comment)
|
||||
case 2: SET_MODAL (MODAL_GROUP_G1, motion_mode, MOTION_MODE_CW_ARC);
|
||||
case 3: SET_MODAL (MODAL_GROUP_G1, motion_mode, MOTION_MODE_CCW_ARC);
|
||||
case 4: SET_NON_MODAL (next_action, NEXT_ACTION_DWELL);
|
||||
case 10: SET_MODAL (MODAL_GROUP_G0, next_action, NEXT_ACTION_SET_COORD_DATA);
|
||||
case 10: SET_MODAL (MODAL_GROUP_G0, next_action, NEXT_ACTION_SET_G10_DATA);
|
||||
case 17: SET_MODAL (MODAL_GROUP_G2, select_plane, CANON_PLANE_XY);
|
||||
case 18: SET_MODAL (MODAL_GROUP_G2, select_plane, CANON_PLANE_XZ);
|
||||
case 19: SET_MODAL (MODAL_GROUP_G2, select_plane, CANON_PLANE_YZ);
|
||||
@@ -475,7 +475,15 @@ static stat_t _parse_gcode_block(char *buf, char *active_comment)
|
||||
break;
|
||||
}
|
||||
case 40: break; // ignore cancel cutter radius compensation
|
||||
case 49: break; // ignore cancel tool length offset comp.
|
||||
case 43: {
|
||||
switch (_point(value)) {
|
||||
case 0: SET_NON_MODAL (next_action, NEXT_ACTION_SET_TL_OFFSET);
|
||||
case 2: SET_NON_MODAL (next_action, NEXT_ACTION_SET_ADDITIONAL_TL_OFFSET);
|
||||
default: status = STAT_GCODE_COMMAND_UNSUPPORTED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 49: SET_NON_MODAL (next_action, NEXT_ACTION_CANCEL_TL_OFFSET);
|
||||
case 53: SET_NON_MODAL (absolute_override, true);
|
||||
case 54: SET_MODAL (MODAL_GROUP_G12, coord_system, G54);
|
||||
case 55: SET_MODAL (MODAL_GROUP_G12, coord_system, G55);
|
||||
@@ -495,16 +503,16 @@ static stat_t _parse_gcode_block(char *buf, char *active_comment)
|
||||
case 80: SET_MODAL (MODAL_GROUP_G1, motion_mode, MOTION_MODE_CANCEL_MOTION_MODE);
|
||||
case 90: {
|
||||
switch (_point(value)) {
|
||||
case 0: SET_MODAL (MODAL_GROUP_G3, distance_mode, ABSOLUTE_MODE);
|
||||
case 1: SET_MODAL (MODAL_GROUP_G3, arc_distance_mode, ABSOLUTE_MODE);
|
||||
case 0: SET_MODAL (MODAL_GROUP_G3, distance_mode, ABSOLUTE_DISTANCE_MODE);
|
||||
case 1: SET_MODAL (MODAL_GROUP_G3, arc_distance_mode, ABSOLUTE_DISTANCE_MODE);
|
||||
default: status = STAT_GCODE_COMMAND_UNSUPPORTED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 91: {
|
||||
switch (_point(value)) {
|
||||
case 0: SET_MODAL (MODAL_GROUP_G3, distance_mode, INCREMENTAL_MODE);
|
||||
case 1: SET_MODAL (MODAL_GROUP_G3, arc_distance_mode, INCREMENTAL_MODE);
|
||||
case 0: SET_MODAL (MODAL_GROUP_G3, distance_mode, INCREMENTAL_DISTANCE_MODE);
|
||||
case 1: SET_MODAL (MODAL_GROUP_G3, arc_distance_mode, INCREMENTAL_DISTANCE_MODE);
|
||||
default: status = STAT_GCODE_COMMAND_UNSUPPORTED;
|
||||
}
|
||||
break;
|
||||
@@ -545,7 +553,6 @@ static stat_t _parse_gcode_block(char *buf, char *active_comment)
|
||||
case 51: SET_MODAL (MODAL_GROUP_M9, sso_enable, true);
|
||||
case 100: SET_NON_MODAL (next_action, NEXT_ACTION_JSON_COMMAND_SYNC);
|
||||
case 101: SET_NON_MODAL (next_action, NEXT_ACTION_JSON_WAIT);
|
||||
// case 102: SET_NON_MODAL (next_action, NEXT_ACTION_JSON_COMMAND_IMMEDIATE);
|
||||
default: status = STAT_MCODE_COMMAND_UNSUPPORTED;
|
||||
}
|
||||
break;
|
||||
@@ -563,6 +570,7 @@ static stat_t _parse_gcode_block(char *buf, char *active_comment)
|
||||
// case 'U': SET_NON_MODAL (target[AXIS_U], value); // reserved
|
||||
// case 'V': SET_NON_MODAL (target[AXIS_V], value); // reserved
|
||||
// case 'W': SET_NON_MODAL (target[AXIS_W], value); // reserved
|
||||
case 'H': SET_NON_MODAL (H_word, value);
|
||||
case 'I': SET_NON_MODAL (arc_offset[0], value);
|
||||
case 'J': SET_NON_MODAL (arc_offset[1], value);
|
||||
case 'K': SET_NON_MODAL (arc_offset[2], value);
|
||||
@@ -650,7 +658,22 @@ static stat_t _execute_gcode_block(char *active_comment)
|
||||
EXEC_FUNC(cm_select_plane, select_plane); // G17, G18, G19
|
||||
EXEC_FUNC(cm_set_units_mode, units_mode); // G20, G21
|
||||
//--> cutter radius compensation goes here
|
||||
//--> cutter length compensation goes here
|
||||
|
||||
switch (gc.gn.next_action) { // Tool length offsets
|
||||
case NEXT_ACTION_SET_TL_OFFSET: { // G43
|
||||
ritorno(cm_set_tl_offset(gc.gn.H_word, false));
|
||||
break;
|
||||
}
|
||||
case NEXT_ACTION_SET_ADDITIONAL_TL_OFFSET: { // G43.2
|
||||
ritorno(cm_set_tl_offset(gc.gn.H_word, true));
|
||||
break;
|
||||
}
|
||||
case NEXT_ACTION_CANCEL_TL_OFFSET: { // G49
|
||||
ritorno(cm_cancel_tl_offset());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
EXEC_FUNC(cm_set_coord_system, coord_system); // G54, G55, G56, G57, G58, G59
|
||||
// EXEC_FUNC(cm_set_path_control, path_control); // G61, G61.1, G64
|
||||
if(gc.gf.path_control) { status = cm_set_path_control(MODEL, gc.gn.path_control); }
|
||||
@@ -674,7 +697,7 @@ static stat_t _execute_gcode_block(char *active_comment)
|
||||
case NEXT_ACTION_STRAIGHT_PROBE_AWAY_ERR:{ status = cm_straight_probe(gc.gn.target, gc.gf.target, true, false); break;} // G38.4
|
||||
case NEXT_ACTION_STRAIGHT_PROBE_AWAY: { status = cm_straight_probe(gc.gn.target, gc.gf.target, false, false); break;} // G38.5
|
||||
|
||||
case NEXT_ACTION_SET_COORD_DATA: { status = cm_set_coord_offsets(gc.gn.parameter, gc.gn.L_word, gc.gn.target, gc.gf.target); break;}
|
||||
case NEXT_ACTION_SET_G10_DATA: { status = cm_set_g10_data(gc.gn.parameter, gc.gn.L_word, gc.gn.target, gc.gf.target); break;}
|
||||
case NEXT_ACTION_SET_ORIGIN_OFFSETS: { status = cm_set_origin_offsets(gc.gn.target, gc.gf.target); break;}// G92
|
||||
case NEXT_ACTION_RESET_ORIGIN_OFFSETS: { status = cm_reset_origin_offsets(); break;} // G92.1
|
||||
case NEXT_ACTION_SUSPEND_ORIGIN_OFFSETS: { status = cm_suspend_origin_offsets(); break;} // G92.2
|
||||
|
||||
+35
-8
@@ -89,8 +89,7 @@ void json_parser(char *str)
|
||||
{
|
||||
nvObj_t *nv = nv_reset_nv_list(); // get a fresh nvObj list
|
||||
stat_t status = _json_parser_kernal(nv, str);
|
||||
if (status == STAT_OK) {
|
||||
// execute the command
|
||||
if (status == STAT_OK) { // execute the command
|
||||
nv = nv_body;
|
||||
status = _json_parser_execute(nv);
|
||||
}
|
||||
@@ -98,7 +97,7 @@ void json_parser(char *str)
|
||||
return;
|
||||
}
|
||||
nv_print_list(status, TEXT_MULTILINE_FORMATTED, JSON_RESPONSE_FORMAT);
|
||||
|
||||
// nv_print_list(status, TEXT_NO_PRINT, JSON_RESPONSE_FORMAT);
|
||||
sr_request_status_report(SR_REQUEST_TIMED); // generate incremental status report to show any changes
|
||||
}
|
||||
|
||||
@@ -499,7 +498,9 @@ void json_print_list(stat_t status, uint8_t flags)
|
||||
switch (flags) {
|
||||
case JSON_NO_PRINT: break;
|
||||
case JSON_OBJECT_FORMAT: { json_print_object(nv_body); break; }
|
||||
case JSON_RESPONSE_FORMAT: { json_print_response(status); break; }
|
||||
case JSON_RESPONSE_FORMAT:
|
||||
case JSON_RESPONSE_TO_MUTED_FORMAT:
|
||||
{ json_print_response(status, flags == JSON_RESPONSE_TO_MUTED_FORMAT); break; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,7 +523,7 @@ void json_print_list(stat_t status, uint8_t flags)
|
||||
* on all the (non-silent) responses.
|
||||
*/
|
||||
|
||||
void json_print_response(uint8_t status)
|
||||
void json_print_response(uint8_t status, const bool only_to_muted /*= false*/)
|
||||
{
|
||||
if (js.json_verbosity == JV_SILENT) { // silent means no responses
|
||||
return;
|
||||
@@ -566,10 +567,13 @@ void json_print_response(uint8_t status)
|
||||
nv->valuetype = TYPE_EMPTY;
|
||||
}
|
||||
}
|
||||
} while ((nv = nv->nx) != NULL);
|
||||
} while ((nv = nv->nx) != NULL); // Emergency escape
|
||||
}
|
||||
|
||||
// Footer processing
|
||||
// Footer processing - wind to the end of the populated blocks
|
||||
if (nv == NULL) { // this can happen when processing a stale list
|
||||
return; //...that already has a null-terminated footer
|
||||
}
|
||||
while(nv->valuetype != TYPE_EMPTY) { // find a free nvObj at end of the list...
|
||||
if ((nv = nv->nx) == NULL) { // oops! No free nvObj!
|
||||
rpt_exception(STAT_JSON_OUTPUT_TOO_LONG, "json_print_response() json too long"); // report this as an exception
|
||||
@@ -599,7 +603,7 @@ void json_print_response(uint8_t status)
|
||||
|
||||
// serialize the JSON response and print it if there were no errors
|
||||
if (json_serialize(nv_header, cs.out_buf, sizeof(cs.out_buf)) >= 0) {
|
||||
xio_writeline(cs.out_buf);
|
||||
xio_writeline(cs.out_buf, only_to_muted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -660,6 +664,29 @@ stat_t js_set_jv(nvObj_t *nv)
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* json_set_ej() - set JSON communications mode
|
||||
*/
|
||||
/*
|
||||
stat_t json_set_ej(nvObj_t *nv)
|
||||
{
|
||||
if (nv->value < TEXT_MODE) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_LESS_THAN_MIN_VALUE);
|
||||
}
|
||||
if (nv->value > AUTO_MODE) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_EXCEEDS_MAX_VALUE);
|
||||
}
|
||||
|
||||
// set json_mode to 0 or 1, but don't change it if comm_mode == 2
|
||||
if (commMode(nv->value) < AUTO_MODE) {
|
||||
js.json_mode = commMode(nv->value);
|
||||
}
|
||||
return (set_ui8(nv));
|
||||
}
|
||||
*/
|
||||
|
||||
/***********************************************************************************
|
||||
* TEXT MODE SUPPORT
|
||||
* Functions to print variables from the cfgArray table
|
||||
|
||||
@@ -57,7 +57,8 @@ typedef enum {
|
||||
typedef enum { // json output print modes
|
||||
JSON_NO_PRINT = 0, // don't print anything if you find yourself in JSON mode
|
||||
JSON_OBJECT_FORMAT, // print just the body as a json object
|
||||
JSON_RESPONSE_FORMAT // print the header/body/footer as a response object
|
||||
JSON_RESPONSE_FORMAT, // print the header/body/footer as a response object
|
||||
JSON_RESPONSE_TO_MUTED_FORMAT // print the header/body/footer as a response object, only to muted channels
|
||||
} jsonFormats;
|
||||
|
||||
typedef struct jsSingleton {
|
||||
@@ -85,7 +86,7 @@ void json_parser(char *str);
|
||||
void json_parse_for_exec(char *str, bool execute);
|
||||
uint16_t json_serialize(nvObj_t *nv, char *out_buf, uint16_t size);
|
||||
void json_print_object(nvObj_t *nv);
|
||||
void json_print_response(uint8_t status);
|
||||
void json_print_response(uint8_t status, const bool only_to_muted = false);
|
||||
void json_print_list(stat_t status, uint8_t flags);
|
||||
|
||||
stat_t js_get_ej(nvObj_t *nv);
|
||||
|
||||
@@ -153,3 +153,12 @@ void loop() {
|
||||
controller_run( ); // single pass through the controller
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Traps for debugging. These must be in main.cpp for proper linker ordering
|
||||
*/
|
||||
|
||||
void MemManage_Handler ( void ) { __asm__("BKPT"); }
|
||||
void BusFault_Handler ( void ) { __asm__("BKPT"); }
|
||||
void UsageFault_Handler ( void ) { __asm__("BKPT"); }
|
||||
void HardFault_Handler ( void ) { __asm__("BKPT"); }
|
||||
|
||||
+2
-2
@@ -175,7 +175,7 @@ stat_t cm_arc_feed(const float target[], const bool target_f[], // target en
|
||||
}
|
||||
}
|
||||
else { // test that center format absolute distance mode arcs have both offsets specified
|
||||
if (cm->gm.arc_distance_mode == ABSOLUTE_MODE) {
|
||||
if (cm->gm.arc_distance_mode == ABSOLUTE_DISTANCE_MODE) {
|
||||
if (!(offset_f[cm->arc.plane_axis_0] && offset_f[cm->arc.plane_axis_1])) { // if one or both offsets are missing
|
||||
return (STAT_ARC_OFFSETS_MISSING_FOR_SELECTED_PLANE);
|
||||
}
|
||||
@@ -222,7 +222,7 @@ stat_t cm_arc_feed(const float target[], const bool target_f[], // target en
|
||||
cm->arc.offset[OFS_J] = _to_millimeters(offset[OFS_J]);
|
||||
cm->arc.offset[OFS_K] = _to_millimeters(offset[OFS_K]);
|
||||
|
||||
if (cm->arc.gm.arc_distance_mode == ABSOLUTE_MODE) { // adjust offsets if in absolute mode
|
||||
if (cm->arc.gm.arc_distance_mode == ABSOLUTE_DISTANCE_MODE) { // adjust offsets if in absolute mode
|
||||
cm->arc.offset[OFS_I] -= cm->arc.position[AXIS_X];
|
||||
cm->arc.offset[OFS_J] -= cm->arc.position[AXIS_Y];
|
||||
cm->arc.offset[OFS_K] -= cm->arc.position[AXIS_Z];
|
||||
|
||||
@@ -178,12 +178,16 @@ static stat_t _plan_move(mpBuf_t *bf, float entry_velocity)
|
||||
mp_calculate_ramps(block, bf, entry_velocity); // (which it will if you don't do this)
|
||||
|
||||
// diagnostic traps
|
||||
|
||||
#if IN_DEBUGGER == 1
|
||||
if (block->exit_velocity > block->cruise_velocity) {
|
||||
__asm__("BKPT"); // exit > cruise after calculate_block
|
||||
}
|
||||
if (block->head_length < 0.00001 && block->body_length < 0.00001 && block->tail_length < 0.00001) {
|
||||
__asm__("BKPT"); // zero or negative length block
|
||||
}
|
||||
#endif
|
||||
|
||||
bf->buffer_state = MP_BUFFER_PLANNED; //...here
|
||||
bf->plannable = false;
|
||||
return (STAT_OK); // report that we planned something...
|
||||
@@ -254,8 +258,10 @@ stat_t mp_exec_move()
|
||||
// first-time operations
|
||||
if (bf->buffer_state != MP_BUFFER_RUNNING) {
|
||||
if ((bf->buffer_state < MP_BUFFER_PREPPED) && (cm->motion_state == MOTION_RUN)) {
|
||||
#if IN_DEBUGGER == 1
|
||||
__asm__("BKPT"); // mp_exec_move() buffer is not prepped
|
||||
// IMPORTANT: We can't rpt_exception from here!
|
||||
#endif
|
||||
// IMPORTANT: We can't rpt_exception from here!
|
||||
st_prep_null();
|
||||
return (STAT_NOOP);
|
||||
}
|
||||
@@ -267,7 +273,9 @@ stat_t mp_exec_move()
|
||||
|
||||
if (bf->buffer_state == MP_BUFFER_PREPPED) {
|
||||
if (cm->motion_state == MOTION_RUN) {
|
||||
#if IN_DEBUGGER == 1
|
||||
__asm__("BKPT"); // we are running but don't have a block planned
|
||||
#endif
|
||||
}
|
||||
// We need to have it planned. We don't want to do this here, as it
|
||||
// might already be happening in a lower interrupt.
|
||||
|
||||
@@ -199,8 +199,7 @@ stat_t mp_aline(GCodeState_t* gm_in)
|
||||
// exit if the move has zero movement. At all.
|
||||
if (fp_ZERO(length)) {
|
||||
sr_request_status_report(SR_REQUEST_TIMED_FULL); // Was SR_REQUEST_IMMEDIATE_FULL
|
||||
return (STAT_MINIMUM_LENGTH_MOVE);
|
||||
// return (STAT_OK); //+++++ test this
|
||||
return (STAT_OK); // preferred over STAT_MINIMUM_LENGTH_MOVE
|
||||
}
|
||||
|
||||
// get a cleared buffer and copy in the Gcode model state
|
||||
|
||||
@@ -34,8 +34,9 @@
|
||||
|
||||
//+++++ DIAGNOSTICS
|
||||
|
||||
#if IN_DEBUGGER < 1
|
||||
#define LOG_RETURN(msg) // LOG_RETURN with no action (production)
|
||||
/*
|
||||
#else
|
||||
#include "xio.h"
|
||||
static char logbuf[128];
|
||||
static void _logger(const char *msg, const mpBuf_t *bf) // LOG_RETURN with full state dump
|
||||
@@ -47,14 +48,17 @@ static void _logger(const char *msg, const mpBuf_t *bf) // LOG_RETURN wi
|
||||
xio_writeline(logbuf);
|
||||
}
|
||||
#define LOG_RETURN(msg) { _logger(msg, bf); }
|
||||
*/
|
||||
#endif
|
||||
|
||||
//#define TRAP_ZERO(t,m)
|
||||
#if IN_DEBUGGER < 1
|
||||
#define TRAP_ZERO(t,m)
|
||||
#else
|
||||
#define TRAP_ZERO(t, m) \
|
||||
if (fp_ZERO(t)) { \
|
||||
rpt_exception(STAT_MINIMUM_LENGTH_MOVE, m); \
|
||||
_debug_trap(m); \
|
||||
}
|
||||
#endif
|
||||
|
||||
//+++++ END DIAGNOSTICS
|
||||
|
||||
|
||||
@@ -788,6 +788,14 @@ mpBuf_t * mp_get_write_buffer() // get & clear a buffer
|
||||
q->w->buffer_state = MP_BUFFER_INITIALIZING;
|
||||
q->buffers_available--;
|
||||
return (mp_get_w(ACTIVE_Q));
|
||||
/*=======
|
||||
if (mb.w->buffer_state == MP_BUFFER_EMPTY) {
|
||||
_clear_buffer(mb.w); // ++++RG this is redundant, it was just cleared in mp_free_run_buffer
|
||||
mb.w->buffer_state = MP_BUFFER_INITIALIZING;
|
||||
mb.buffers_available--;
|
||||
return (mb.w);
|
||||
>>>>>>> refs/heads/edge
|
||||
*/
|
||||
}
|
||||
// The no buffer condition always causes a panic - invoked by the caller
|
||||
rpt_exception(STAT_FAILED_TO_GET_PLANNER_BUFFER, "mp_get_write_buffer()");
|
||||
|
||||
+10
-31
@@ -31,6 +31,8 @@
|
||||
#include "spindle.h"
|
||||
#include "text_parser.h"
|
||||
#include "pwm.h"
|
||||
#include "canonical_machine.h"
|
||||
#include "settings.h"
|
||||
|
||||
/***** PWM defines, structures and memory allocation *****/
|
||||
|
||||
@@ -38,37 +40,8 @@ pwmSingleton_t pwm;
|
||||
|
||||
|
||||
// Setup motate PWM pins
|
||||
static Motate::PWMOutputPin<Motate::kSpindle_PwmPinNumber> spindle_pwm_pin;
|
||||
static Motate::PWMOutputPin<Motate::kSpindle_Pwm2PinNumber> secondary_pwm_pin;
|
||||
|
||||
// defines common to all PWM channels
|
||||
//#define PWM_TIMER_TYPE TC1_struct // PWM uses TC1's
|
||||
#define PWM_TIMER_t TC1_t // PWM uses TC1's
|
||||
#define PWM_TIMER_DISABLE 0 // turn timer off (clock = 0 Hz)
|
||||
//#define PWM_MAX_FREQ (F_CPU/256) // max frequency with 8-bits duty cycle precision
|
||||
//#define PWM_MIN_FREQ (F_CPU/64/65536) // min frequency with supported prescaling
|
||||
|
||||
// channel specific defines
|
||||
/* CLKSEL is used to configure default PWM clock operating ranges
|
||||
* These can be changed by pwm_freq() depending on the PWM frequency selected
|
||||
*
|
||||
* The useful ranges (assuming a 32 Mhz system clock) are:
|
||||
* TC_CLKSEL_DIV1_gc - good for about 500 Hz to 125 Khz practical upper limit
|
||||
* TC_CLKSEL_DIV2_gc - good for about 250 Hz to 62 KHz
|
||||
* TC_CLKSEL_DIV4_gc - good for about 125 Hz to 31 KHz
|
||||
* TC_CLKSEL_DIV8_gc - good for about 62 Hz to 16 KHz
|
||||
* TC_CLKSEL_DIV64_gc - good for about 8 Hz to 2 Khz
|
||||
*/
|
||||
#define PWM1_CTRLA_CLKSEL TC_CLKSEL_DIV1_gc // starting clock select value
|
||||
#define PWM1_CTRLB (3 | TC0_CCBEN_bm) // single slope PWM enabled on channel B
|
||||
#define PWM1_ISR_vect TCD1_CCB_vect // must match timer assignments in system.h
|
||||
#define PWM1_INTCTRLB 0 // timer interrupt level (0=off, 1=lo, 2=med, 3=hi)
|
||||
|
||||
#define PWM2_CTRLA_CLKSEL TC_CLKSEL_DIV1_gc
|
||||
#define PWM2_CTRLB 3 // single slope PWM enabled, no output channel
|
||||
//#define PWM2_CTRLB (3 | TC0_CCBEN_bm) // single slope PWM enabled on channel B
|
||||
#define PWM2_ISR_vect TCE1_CCB_vect // must match timer assignments in system.h
|
||||
#define PWM2_INTCTRLB 0 // timer interrupt level (0=off, 1=lo, 2=med, 3=hi)
|
||||
Motate::PWMOutputPin<Motate::kSpindle_PwmPinNumber> spindle_pwm_pin {Motate::kNormal, P1_PWM_FREQUENCY};
|
||||
Motate::PWMOutputPin<Motate::kSpindle_Pwm2PinNumber> secondary_pwm_pin {Motate::kNormal, P1_PWM_FREQUENCY}; // assume the same frequency, to start with at least
|
||||
|
||||
/***** PWM code *****/
|
||||
/*
|
||||
@@ -126,8 +99,14 @@ stat_t pwm_set_duty(uint8_t chan, float duty)
|
||||
if (duty > 1.0) { return (STAT_INPUT_EXCEEDS_MAX_VALUE);}
|
||||
|
||||
if (chan == PWM_1) {
|
||||
if (spindle_pwm_pin.isNull()) {
|
||||
cm_alarm(STAT_ALARM, "attempt to turn on a non-existant spindle");
|
||||
}
|
||||
spindle_pwm_pin = duty;
|
||||
} else if (chan == PWM_2) {
|
||||
if (secondary_pwm_pin.isNull()) {
|
||||
cm_alarm(STAT_ALARM, "attempt to turn on a non-existant spindle");
|
||||
}
|
||||
secondary_pwm_pin = duty;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -491,7 +491,8 @@ void qr_request_queue_report(int8_t buffers)
|
||||
}
|
||||
|
||||
// time-throttle requests while generating arcs
|
||||
qr.motion_mode = cm_get_motion_mode(ACTIVE_MODEL);
|
||||
// qr.motion_mode = cm_get_motion_mode(ACTIVE_MODEL);
|
||||
qr.motion_mode = cm_get_motion_mode((GCodeState_t *)&(cm->gm));
|
||||
if ((qr.motion_mode == MOTION_MODE_CW_ARC) || (qr.motion_mode == MOTION_MODE_CCW_ARC)) {
|
||||
uint32_t tick = SysTickTimer_getValue();
|
||||
if (tick - qr.init_tick < MIN_ARC_QR_INTERVAL) {
|
||||
|
||||
Executable → Regular
+1
-1
@@ -87,7 +87,7 @@
|
||||
#define GCODE_DEFAULT_PLANE CANON_PLANE_XY // CANON_PLANE_XY, CANON_PLANE_XZ, or CANON_PLANE_YZ
|
||||
#define GCODE_DEFAULT_COORD_SYSTEM G54 // G54, G55, G56, G57, G58 or G59
|
||||
#define GCODE_DEFAULT_PATH_CONTROL PATH_CONTINUOUS
|
||||
#define GCODE_DEFAULT_DISTANCE_MODE ABSOLUTE_MODE
|
||||
#define GCODE_DEFAULT_DISTANCE_MODE ABSOLUTE_DISTANCE_MODE
|
||||
|
||||
|
||||
// *** motor settings ************************************************************************************
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user