Skip to content

Commit

Permalink
Merge branch 'bugfix-2.0.x' into 2.0.x-Sapphire-Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
petrzmax committed Mar 26, 2020
2 parents dcddbf1 + 54a12ee commit fc87e19
Show file tree
Hide file tree
Showing 243 changed files with 13,363 additions and 13,098 deletions.
6 changes: 2 additions & 4 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
/**
* Select the serial port on the board to use for communication with the host.
* This allows the connection of wireless adapters (for instance) to non-default port pins.
* Serial port -1 is the USB emulated serial port, if available.
* Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader.
*
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
Expand All @@ -107,9 +108,6 @@

/**
* Select a secondary serial port on the board to use for communication with the host.
* This allows the connection of wireless adapters (for instance) to non-default port pins.
* Serial port -1 is the USB emulated serial port, if available.
*
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
#define SERIAL_PORT_2 1
Expand Down Expand Up @@ -475,7 +473,7 @@
#if ENABLED(PIDTEMP)
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
//#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
Expand Down
5 changes: 2 additions & 3 deletions Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <stdint.h>

// Define MYSERIAL0/1 before MarlinSerial includes!
#if SERIAL_PORT == -1
#if SERIAL_PORT == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL0 customizedSerial1
#elif SERIAL_PORT == 0
#define MYSERIAL0 Serial
Expand All @@ -56,7 +56,7 @@
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#elif SERIAL_PORT_2 == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL1 customizedSerial2
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial
Expand Down Expand Up @@ -94,7 +94,6 @@
#endif
#endif


#include "MarlinSerial.h"
#include "MarlinSerialUSB.h"

Expand Down
20 changes: 5 additions & 15 deletions Marlin/src/HAL/DUE/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,23 +629,13 @@ void MarlinSerial<Cfg>::printFloat(double number, uint8_t digits) {

// If not using the USB port as serial port
#if SERIAL_PORT >= 0

// Preinstantiate
template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT>>;

// Instantiate
MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;

template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT>>; // Define
MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1; // Instantiate
#endif

#ifdef SERIAL_PORT_2

// Preinstantiate
template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>>;

// Instantiate
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2;

#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0
template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>>; // Define
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2; // Instantiate
#endif

#endif // ARDUINO_ARCH_SAM
8 changes: 2 additions & 6 deletions Marlin/src/HAL/DUE/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,9 @@ struct MarlinSerialCfg {
};

#if SERIAL_PORT >= 0

extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;
#endif

#endif // SERIAL_PORT >= 0

#ifdef SERIAL_PORT_2

#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0
extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2;

#endif
12 changes: 8 additions & 4 deletions Marlin/src/HAL/DUE/MarlinSerialUSB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "../../inc/MarlinConfig.h"

#if SERIAL_PORT == -1
#if HAS_USB_SERIAL

#include "MarlinSerialUSB.h"

Expand Down Expand Up @@ -283,8 +283,12 @@ void MarlinSerialUSB::printFloat(double number, uint8_t digits) {
}

// Preinstantiate
MarlinSerialUSB customizedSerial1;

#endif // SERIAL_PORT == -1
#if SERIAL_PORT == -1
MarlinSerialUSB customizedSerial1;
#endif
#if SERIAL_PORT_2 == -1
MarlinSerialUSB customizedSerial2;
#endif

#endif // HAS_USB_SERIAL
#endif // ARDUINO_ARCH_SAM
12 changes: 9 additions & 3 deletions Marlin/src/HAL/DUE/MarlinSerialUSB.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "../../inc/MarlinConfig.h"

#if SERIAL_PORT == -1
#if HAS_USB_SERIAL

#include <WString.h>

Expand Down Expand Up @@ -88,6 +88,12 @@ class MarlinSerialUSB {
static void printFloat(double, uint8_t);
};

extern MarlinSerialUSB customizedSerial1;
#if SERIAL_PORT == -1
extern MarlinSerialUSB customizedSerial1;
#endif

#if SERIAL_PORT_2 == -1
extern MarlinSerialUSB customizedSerial2;
#endif

#endif // SERIAL_PORT == -1
#endif // HAS_USB_SERIAL
155 changes: 108 additions & 47 deletions Marlin/src/HAL/DUE/fastio/G2_PWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,31 @@

#include "G2_PWM.h"

#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
#define G2_PWM_X 1
#else
#define G2_PWM_X 0
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
#define G2_PWM_Y 1
#else
#define G2_PWM_Y 0
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define G2_PWM_Z 1
#else
#define G2_PWM_Z 0
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#define G2_PWM_E 1
#else
#define G2_PWM_E 0
#endif
#define G2_MASK_X(V) (G2_PWM_X * (V))
#define G2_MASK_Y(V) (G2_PWM_Y * (V))
#define G2_MASK_Z(V) (G2_PWM_Z * (V))
#define G2_MASK_E(V) (G2_PWM_E * (V))

volatile uint32_t *SODR_A = &PIOA->PIO_SODR,
*SODR_B = &PIOB->PIO_SODR,
*CODR_A = &PIOA->PIO_CODR,
Expand All @@ -55,10 +80,18 @@ PWM_map ISR_table[NUM_PWMS] = PWM_MAP_INIT;

void Stepper::digipot_init() {

OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0); // init pins
OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0); // init pins
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
#endif
#if G2_PWM_Z
OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
#endif
#if G2_PWM_E
OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
#endif

#define WPKEY (0x50574D << 8) // “PWM” in ASCII
#define WPCMD_DIS_SW 0 // command to disable Write Protect SW
Expand All @@ -71,30 +104,51 @@ void Stepper::digipot_init() {
PWM->PWM_WPCR = WPKEY | WPRG_ALL | WPCMD_DIS_SW; // enable setting of all PWM registers
PWM->PWM_CLK = PWM_CLOCK_F; // enable CLK_A and set it to 1MHz, leave CLK_B disabled
PWM->PWM_CH_NUM[0].PWM_CMR = 0b1011; // set channel 0 to Clock A input & to left aligned
PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011; // set channel 1 to Clock A input & to left aligned
PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011; // set channel 2 to Clock A input & to left aligned
PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011; // set channel 3 to Clock A input & to left aligned
PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011; // set channel 4 to Clock A input & to left aligned
if (G2_PWM_X) PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011; // set channel 1 to Clock A input & to left aligned
if (G2_PWM_Y) PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011; // set channel 2 to Clock A input & to left aligned
if (G2_PWM_Z) PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011; // set channel 3 to Clock A input & to left aligned
if (G2_PWM_E) PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011; // set channel 4 to Clock A input & to left aligned

PWM->PWM_CH_NUM[0].PWM_CPRD = PWM_PERIOD_US; // set channel 0 Period

PWM->PWM_IER2 = PWM_IER1_CHID0; // generate interrupt when counter0 overflows
PWM->PWM_IER2 = PWM_IER2_CMPM0 | PWM_IER2_CMPM1 | PWM_IER2_CMPM2 | PWM_IER2_CMPM3 | PWM_IER2_CMPM4; // generate interrupt on compare event

PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive

PWM->PWM_CMP[1].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_CMP[2].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_CMP[3].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_CMP[4].PWM_CMPM = 0x0001; // enable compare event

PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0 | PWM_SCM_SYNC1 | PWM_SCM_SYNC2 | PWM_SCM_SYNC3 | PWM_SCM_SYNC4; // sync 1-4 with 0, use mode 0 for updates

PWM->PWM_ENA = PWM_ENA_CHID0 | PWM_ENA_CHID1 | PWM_ENA_CHID2 | PWM_ENA_CHID3 | PWM_ENA_CHID4; // enable the channels used by G2
PWM->PWM_IER1 = PWM_IER1_CHID0 | PWM_IER1_CHID1 | PWM_IER1_CHID2 | PWM_IER1_CHID3 | PWM_IER1_CHID4; // enable interrupts for the channels used by G2
PWM->PWM_IER2 = PWM_IER2_CMPM0
| G2_MASK_X(PWM_IER2_CMPM1)
| G2_MASK_Y(PWM_IER2_CMPM2)
| G2_MASK_Z(PWM_IER2_CMPM3)
| G2_MASK_E(PWM_IER2_CMPM4)
; // generate interrupt on compare event

if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive

if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPM = 0x0001; // enable compare event
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPM = 0x0001; // enable compare event
if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPM = 0x0001; // enable compare event
if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPM = 0x0001; // enable compare event

PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0
| G2_MASK_X(PWM_SCM_SYNC1)
| G2_MASK_Y(PWM_SCM_SYNC2)
| G2_MASK_Z(PWM_SCM_SYNC3)
| G2_MASK_E(PWM_SCM_SYNC4)
; // sync 1-4 with 0, use mode 0 for updates

PWM->PWM_ENA = PWM_ENA_CHID0
| G2_MASK_X(PWM_ENA_CHID1)
| G2_MASK_Y(PWM_ENA_CHID2)
| G2_MASK_Z(PWM_ENA_CHID3)
| G2_MASK_E(PWM_ENA_CHID4)
; // enable channels used by G2

PWM->PWM_IER1 = PWM_IER1_CHID0
| G2_MASK_X(PWM_IER1_CHID1)
| G2_MASK_Y(PWM_IER1_CHID2)
| G2_MASK_Z(PWM_IER1_CHID3)
| G2_MASK_E(PWM_IER1_CHID4)
; // enable interrupts for channels used by G2

NVIC_EnableIRQ(PWM_IRQn); // Enable interrupt handler
NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0)); // normal priority for PWM module (can stand some jitter on the Vref signals)
Expand All @@ -105,20 +159,27 @@ void Stepper::digipot_current(const uint8_t driver, const int16_t current) {
if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init(); // Init PWM system if needed

switch (driver) {
case 0: PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update X & Y
PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
case 1: PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update Z
PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
default:PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update E
PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
case 0:
if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update X & Y
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001; // enable compare event
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001; // enable compare event
if (G2_PWM_X || G2_PWM_Y) PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
case 1:
if (G2_PWM_Z) {
PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update Z
PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
}
break;
default:
if (G2_PWM_E) {
PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update E
PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
}
break;
}
}

Expand All @@ -127,17 +188,17 @@ volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS;
void PWM_Handler() {
PWM_ISR1_STATUS = PWM->PWM_ISR1;
PWM_ISR2_STATUS = PWM->PWM_ISR2;
if (PWM_ISR1_STATUS & PWM_IER1_CHID0) { // CHAN_0 interrupt
*ISR_table[0].set_register = ISR_table[0].write_mask; // set X to active
*ISR_table[1].set_register = ISR_table[1].write_mask; // set Y to active
*ISR_table[2].set_register = ISR_table[2].write_mask; // set Z to active
*ISR_table[3].set_register = ISR_table[3].write_mask; // set E to active
if (PWM_ISR1_STATUS & PWM_IER1_CHID0) { // CHAN_0 interrupt
if (G2_PWM_X) *ISR_table[0].set_register = ISR_table[0].write_mask; // set X to active
if (G2_PWM_Y) *ISR_table[1].set_register = ISR_table[1].write_mask; // set Y to active
if (G2_PWM_Z) *ISR_table[2].set_register = ISR_table[2].write_mask; // set Z to active
if (G2_PWM_E) *ISR_table[3].set_register = ISR_table[3].write_mask; // set E to active
}
else {
if (PWM_ISR2_STATUS & PWM_IER2_CMPM1) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive
if (PWM_ISR2_STATUS & PWM_IER2_CMPM2) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive
if (PWM_ISR2_STATUS & PWM_IER2_CMPM3) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive
if (PWM_ISR2_STATUS & PWM_IER2_CMPM4) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive
if (G2_PWM_X && (PWM_ISR2_STATUS & PWM_IER2_CMPM1)) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive
if (G2_PWM_Y && (PWM_ISR2_STATUS & PWM_IER2_CMPM2)) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive
if (G2_PWM_Z && (PWM_ISR2_STATUS & PWM_IER2_CMPM3)) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive
if (G2_PWM_E && (PWM_ISR2_STATUS & PWM_IER2_CMPM4)) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive
}
return;
}
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/HAL/LPC1768/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) {
return ind > -1 ? ind : dval;
}

void flashFirmware(int16_t value) {
NVIC_SystemReset();
}
void flashFirmware(const int16_t) { NVIC_SystemReset(); }

void HAL_clear_reset_source(void) {
#if ENABLED(USE_WATCHDOG)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
void HAL_idletask();

#define PLATFORM_M997_SUPPORT
void flashFirmware(int16_t value);
void flashFirmware(const int16_t);

/**
* set_pwm_frequency
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRe

uint16_t HAL_adc_get_result() { return HAL_adc_result; }

void flashFirmware(int16_t) { NVIC_SystemReset(); }
void flashFirmware(const int16_t) { NVIC_SystemReset(); }

#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,4 @@ uint16_t HAL_adc_get_result();
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)

#define PLATFORM_M997_SUPPORT
void flashFirmware(int16_t value);
void flashFirmware(const int16_t);
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,6 @@ void analogWrite(pin_t pin, int pwm_val8) {
analogWrite(uint8_t(pin), pwm_val8);
}

void flashFirmware(int16_t value) { nvic_sys_reset(); }
void flashFirmware(const int16_t) { nvic_sys_reset(); }

#endif // __STM32F1__
3 changes: 2 additions & 1 deletion Marlin/src/HAL/STM32F1/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ void HAL_idletask();

#ifndef digitalPinHasPWM
#define digitalPinHasPWM(P) (PIN_MAP[P].timer_device != nullptr)
#define NO_COMPILE_TIME_PWM
#endif

#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); (void)__iCliRetVal()
Expand Down Expand Up @@ -287,4 +288,4 @@ void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!?
#define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE)

#define PLATFORM_M997_SUPPORT
void flashFirmware(int16_t value);
void flashFirmware(const int16_t);
Loading

0 comments on commit fc87e19

Please sign in to comment.