Merge pull request #7722 from tcm0116/2.0.x-warnings
Cleanup 2.0.x compiler warnings
This commit is contained in:
commit
ac41eb5871
|
@ -352,8 +352,8 @@ script:
|
||||||
- opt_enable FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY
|
- opt_enable FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY
|
||||||
- opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
|
- opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
|
||||||
- opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY
|
- opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY
|
||||||
- opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER
|
- opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER
|
||||||
- opt_enable_adv ADVANCED_PAUSE_FEATURE LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA
|
- opt_enable_adv ADVANCED_PAUSE_FEATURE LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA PARK_HEAD_ON_PAUSE
|
||||||
- opt_set_adv I2C_SLAVE_ADDRESS 63
|
- opt_set_adv I2C_SLAVE_ADDRESS 63
|
||||||
- opt_set ABL_GRID_POINTS_X 16
|
- opt_set ABL_GRID_POINTS_X 16
|
||||||
- opt_set ABL_GRID_POINTS_Y 16
|
- opt_set ABL_GRID_POINTS_Y 16
|
||||||
|
@ -388,7 +388,7 @@ script:
|
||||||
# Mixing Extruder
|
# Mixing Extruder
|
||||||
#
|
#
|
||||||
- restore_configs
|
- restore_configs
|
||||||
- opt_enable MIXING_EXTRUDER
|
- opt_enable MIXING_EXTRUDER DIRECT_MIXING_IN_G1
|
||||||
- opt_set MIXING_STEPPERS 2
|
- opt_set MIXING_STEPPERS 2
|
||||||
- build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
|
- build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
|
||||||
#
|
#
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
UNUSED(response);
|
UNUSED(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void spiSend(const uint8_t* buf, size_t n) {
|
void spiSend(const uint8_t* buf, size_t n) {
|
||||||
uint8_t response;
|
uint8_t response;
|
||||||
if (n == 0) return;
|
if (n == 0) return;
|
||||||
for (uint16_t i = 0; i < n; i++) {
|
for (uint16_t i = 0; i < n; i++) {
|
||||||
|
|
|
@ -346,7 +346,6 @@ extern "C" {
|
||||||
void UART0_IRQHandler (void)
|
void UART0_IRQHandler (void)
|
||||||
{
|
{
|
||||||
uint8_t IIRValue, LSRValue;
|
uint8_t IIRValue, LSRValue;
|
||||||
uint8_t Dummy = Dummy;
|
|
||||||
|
|
||||||
IIRValue = LPC_UART0->IIR;
|
IIRValue = LPC_UART0->IIR;
|
||||||
|
|
||||||
|
@ -354,59 +353,59 @@ void UART0_IRQHandler (void)
|
||||||
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
||||||
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
||||||
{
|
{
|
||||||
LSRValue = LPC_UART0->LSR;
|
LSRValue = LPC_UART0->LSR;
|
||||||
/* Receive Line Status */
|
/* Receive Line Status */
|
||||||
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
||||||
{
|
{
|
||||||
/* There are errors or break interrupt */
|
/* There are errors or break interrupt */
|
||||||
/* Read LSR will clear the interrupt */
|
/* Read LSR will clear the interrupt */
|
||||||
UART0Status = LSRValue;
|
UART0Status = LSRValue;
|
||||||
Dummy = LPC_UART0->RBR; /* Dummy read on RX to clear
|
dummy = LPC_UART0->RBR; /* Dummy read on RX to clear
|
||||||
interrupt, then bail out */
|
interrupt, then bail out */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
||||||
{
|
{
|
||||||
/* If no error on RLS, normal ready, save into the data buffer. */
|
/* If no error on RLS, normal ready, save into the data buffer. */
|
||||||
/* Note: read RBR will clear the interrupt */
|
/* Note: read RBR will clear the interrupt */
|
||||||
if ((UART0RxQueueWritePos+1) % UARTRXQUEUESIZE != UART0RxQueueReadPos)
|
if ((UART0RxQueueWritePos+1) % UARTRXQUEUESIZE != UART0RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART0Buffer[UART0RxQueueWritePos] = LPC_UART0->RBR;
|
UART0Buffer[UART0RxQueueWritePos] = LPC_UART0->RBR;
|
||||||
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dummy = LPC_UART0->RBR;;
|
dummy = LPC_UART0->RBR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
||||||
{
|
{
|
||||||
/* Receive Data Available */
|
/* Receive Data Available */
|
||||||
if ((UART0RxQueueWritePos+1) % UARTRXQUEUESIZE != UART0RxQueueReadPos)
|
if ((UART0RxQueueWritePos+1) % UARTRXQUEUESIZE != UART0RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART0Buffer[UART0RxQueueWritePos] = LPC_UART0->RBR;
|
UART0Buffer[UART0RxQueueWritePos] = LPC_UART0->RBR;
|
||||||
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dummy = LPC_UART1->RBR;;
|
dummy = LPC_UART1->RBR;
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
||||||
{
|
{
|
||||||
/* Character Time-out indicator */
|
/* Character Time-out indicator */
|
||||||
UART0Status |= 0x100; /* Bit 9 as the CTI error */
|
UART0Status |= 0x100; /* Bit 9 as the CTI error */
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
||||||
{
|
{
|
||||||
/* THRE interrupt */
|
/* THRE interrupt */
|
||||||
LSRValue = LPC_UART0->LSR; /* Check status in the LSR to see if
|
LSRValue = LPC_UART0->LSR; /* Check status in the LSR to see if
|
||||||
valid data in U0THR or not */
|
valid data in U0THR or not */
|
||||||
if ( LSRValue & LSR_THRE )
|
if ( LSRValue & LSR_THRE )
|
||||||
{
|
{
|
||||||
UART0TxEmpty = 1;
|
UART0TxEmpty = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UART0TxEmpty = 0;
|
UART0TxEmpty = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +421,6 @@ void UART0_IRQHandler (void)
|
||||||
void UART1_IRQHandler (void)
|
void UART1_IRQHandler (void)
|
||||||
{
|
{
|
||||||
uint8_t IIRValue, LSRValue;
|
uint8_t IIRValue, LSRValue;
|
||||||
uint8_t Dummy = Dummy;
|
|
||||||
|
|
||||||
IIRValue = LPC_UART1->IIR;
|
IIRValue = LPC_UART1->IIR;
|
||||||
|
|
||||||
|
@ -430,61 +428,60 @@ void UART1_IRQHandler (void)
|
||||||
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
||||||
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
||||||
{
|
{
|
||||||
LSRValue = LPC_UART1->LSR;
|
LSRValue = LPC_UART1->LSR;
|
||||||
/* Receive Line Status */
|
/* Receive Line Status */
|
||||||
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
||||||
{
|
{
|
||||||
/* There are errors or break interrupt */
|
/* There are errors or break interrupt */
|
||||||
/* Read LSR will clear the interrupt */
|
/* Read LSR will clear the interrupt */
|
||||||
UART1Status = LSRValue;
|
UART1Status = LSRValue;
|
||||||
Dummy = LPC_UART1->RBR; /* Dummy read on RX to clear
|
dummy = LPC_UART1->RBR; /* Dummy read on RX to clear
|
||||||
interrupt, then bail out */
|
interrupt, then bail out */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
||||||
{
|
{
|
||||||
/* If no error on RLS, normal ready, save into the data buffer. */
|
/* If no error on RLS, normal ready, save into the data buffer. */
|
||||||
/* Note: read RBR will clear the interrupt */
|
/* Note: read RBR will clear the interrupt */
|
||||||
if ((UART1RxQueueWritePos+1) % UARTRXQUEUESIZE != UART1RxQueueReadPos)
|
if ((UART1RxQueueWritePos+1) % UARTRXQUEUESIZE != UART1RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART1Buffer[UART1RxQueueWritePos] = LPC_UART1->RBR;
|
UART1Buffer[UART1RxQueueWritePos] = LPC_UART1->RBR;
|
||||||
UART1RxQueueWritePos =(UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART1RxQueueWritePos =(UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dummy = LPC_UART1->RBR;;
|
dummy = LPC_UART1->RBR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
||||||
{
|
{
|
||||||
/* Receive Data Available */
|
/* Receive Data Available */
|
||||||
if ((UART1RxQueueWritePos+1) % UARTRXQUEUESIZE != UART1RxQueueReadPos)
|
if ((UART1RxQueueWritePos+1) % UARTRXQUEUESIZE != UART1RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART1Buffer[UART1RxQueueWritePos] = LPC_UART1->RBR;
|
UART1Buffer[UART1RxQueueWritePos] = LPC_UART1->RBR;
|
||||||
UART1RxQueueWritePos = (UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART1RxQueueWritePos = (UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dummy = LPC_UART1->RBR;;
|
dummy = LPC_UART1->RBR;
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
||||||
{
|
{
|
||||||
/* Character Time-out indicator */
|
/* Character Time-out indicator */
|
||||||
UART1Status |= 0x100; /* Bit 9 as the CTI error */
|
UART1Status |= 0x100; /* Bit 9 as the CTI error */
|
||||||
|
}
|
||||||
|
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
||||||
|
{
|
||||||
|
/* THRE interrupt */
|
||||||
|
LSRValue = LPC_UART1->LSR; /* Check status in the LSR to see if
|
||||||
|
valid data in U0THR or not */
|
||||||
|
if ( LSRValue & LSR_THRE )
|
||||||
|
{
|
||||||
|
UART1TxEmpty = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UART1TxEmpty = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
|
||||||
{
|
|
||||||
/* THRE interrupt */
|
|
||||||
LSRValue = LPC_UART1->LSR; /* Check status in the LSR to see if
|
|
||||||
valid data in U0THR or not */
|
|
||||||
if ( LSRValue & LSR_THRE )
|
|
||||||
{
|
|
||||||
UART1TxEmpty = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UART1TxEmpty = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
** Function name: UART2_IRQHandler
|
** Function name: UART2_IRQHandler
|
||||||
|
@ -498,7 +495,6 @@ void UART1_IRQHandler (void)
|
||||||
void UART2_IRQHandler (void)
|
void UART2_IRQHandler (void)
|
||||||
{
|
{
|
||||||
uint8_t IIRValue, LSRValue;
|
uint8_t IIRValue, LSRValue;
|
||||||
uint8_t Dummy = Dummy;
|
|
||||||
|
|
||||||
IIRValue = LPC_UART2->IIR;
|
IIRValue = LPC_UART2->IIR;
|
||||||
|
|
||||||
|
@ -506,57 +502,57 @@ void UART2_IRQHandler (void)
|
||||||
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
||||||
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
||||||
{
|
{
|
||||||
LSRValue = LPC_UART2->LSR;
|
LSRValue = LPC_UART2->LSR;
|
||||||
/* Receive Line Status */
|
/* Receive Line Status */
|
||||||
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
||||||
{
|
{
|
||||||
/* There are errors or break interrupt */
|
/* There are errors or break interrupt */
|
||||||
/* Read LSR will clear the interrupt */
|
/* Read LSR will clear the interrupt */
|
||||||
UART2Status = LSRValue;
|
UART2Status = LSRValue;
|
||||||
Dummy = LPC_UART2->RBR; /* Dummy read on RX to clear
|
dummy = LPC_UART2->RBR; /* Dummy read on RX to clear
|
||||||
interrupt, then bail out */
|
interrupt, then bail out */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
||||||
{
|
{
|
||||||
/* If no error on RLS, normal ready, save into the data buffer. */
|
/* If no error on RLS, normal ready, save into the data buffer. */
|
||||||
/* Note: read RBR will clear the interrupt */
|
/* Note: read RBR will clear the interrupt */
|
||||||
if ((UART2RxQueueWritePos+1) % UARTRXQUEUESIZE != UART2RxQueueReadPos)
|
if ((UART2RxQueueWritePos+1) % UARTRXQUEUESIZE != UART2RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART2Buffer[UART2RxQueueWritePos] = LPC_UART2->RBR;
|
UART2Buffer[UART2RxQueueWritePos] = LPC_UART2->RBR;
|
||||||
UART2RxQueueWritePos = (UART2RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART2RxQueueWritePos = (UART2RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
||||||
{
|
{
|
||||||
/* Receive Data Available */
|
/* Receive Data Available */
|
||||||
if ((UART2RxQueueWritePos+1) % UARTRXQUEUESIZE != UART2RxQueueReadPos)
|
if ((UART2RxQueueWritePos+1) % UARTRXQUEUESIZE != UART2RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART2Buffer[UART2RxQueueWritePos] = LPC_UART2->RBR;
|
UART2Buffer[UART2RxQueueWritePos] = LPC_UART2->RBR;
|
||||||
UART2RxQueueWritePos = (UART2RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART2RxQueueWritePos = (UART2RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dummy = LPC_UART2->RBR;;
|
dummy = LPC_UART2->RBR;
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
||||||
{
|
{
|
||||||
/* Character Time-out indicator */
|
/* Character Time-out indicator */
|
||||||
UART2Status |= 0x100; /* Bit 9 as the CTI error */
|
UART2Status |= 0x100; /* Bit 9 as the CTI error */
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
||||||
{
|
{
|
||||||
/* THRE interrupt */
|
/* THRE interrupt */
|
||||||
LSRValue = LPC_UART2->LSR; /* Check status in the LSR to see if
|
LSRValue = LPC_UART2->LSR; /* Check status in the LSR to see if
|
||||||
valid data in U0THR or not */
|
valid data in U0THR or not */
|
||||||
if ( LSRValue & LSR_THRE )
|
if ( LSRValue & LSR_THRE )
|
||||||
{
|
{
|
||||||
UART2TxEmpty = 1;
|
UART2TxEmpty = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UART2TxEmpty = 0;
|
UART2TxEmpty = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
@ -571,7 +567,6 @@ void UART2_IRQHandler (void)
|
||||||
void UART3_IRQHandler (void)
|
void UART3_IRQHandler (void)
|
||||||
{
|
{
|
||||||
uint8_t IIRValue, LSRValue;
|
uint8_t IIRValue, LSRValue;
|
||||||
uint8_t Dummy = Dummy;
|
|
||||||
|
|
||||||
IIRValue = LPC_UART3->IIR;
|
IIRValue = LPC_UART3->IIR;
|
||||||
|
|
||||||
|
@ -579,57 +574,57 @@ void UART3_IRQHandler (void)
|
||||||
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
IIRValue &= 0x07; /* check bit 1~3, interrupt identification */
|
||||||
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
if ( IIRValue == IIR_RLS ) /* Receive Line Status */
|
||||||
{
|
{
|
||||||
LSRValue = LPC_UART3->LSR;
|
LSRValue = LPC_UART3->LSR;
|
||||||
/* Receive Line Status */
|
/* Receive Line Status */
|
||||||
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) )
|
||||||
{
|
{
|
||||||
/* There are errors or break interrupt */
|
/* There are errors or break interrupt */
|
||||||
/* Read LSR will clear the interrupt */
|
/* Read LSR will clear the interrupt */
|
||||||
UART3Status = LSRValue;
|
UART3Status = LSRValue;
|
||||||
Dummy = LPC_UART3->RBR; /* Dummy read on RX to clear
|
dummy = LPC_UART3->RBR; /* Dummy read on RX to clear
|
||||||
interrupt, then bail out */
|
interrupt, then bail out */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
if ( LSRValue & LSR_RDR ) /* Receive Data Ready */
|
||||||
{
|
{
|
||||||
/* If no error on RLS, normal ready, save into the data buffer. */
|
/* If no error on RLS, normal ready, save into the data buffer. */
|
||||||
/* Note: read RBR will clear the interrupt */
|
/* Note: read RBR will clear the interrupt */
|
||||||
if ((UART3RxQueueWritePos+1) % UARTRXQUEUESIZE != UART3RxQueueReadPos)
|
if ((UART3RxQueueWritePos+1) % UARTRXQUEUESIZE != UART3RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART3Buffer[UART3RxQueueWritePos] = LPC_UART3->RBR;
|
UART3Buffer[UART3RxQueueWritePos] = LPC_UART3->RBR;
|
||||||
UART3RxQueueWritePos = (UART3RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART3RxQueueWritePos = (UART3RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
||||||
{
|
{
|
||||||
/* Receive Data Available */
|
/* Receive Data Available */
|
||||||
if ((UART3RxQueueWritePos+1) % UARTRXQUEUESIZE != UART3RxQueueReadPos)
|
if ((UART3RxQueueWritePos+1) % UARTRXQUEUESIZE != UART3RxQueueReadPos)
|
||||||
{
|
{
|
||||||
UART3Buffer[UART3RxQueueWritePos] = LPC_UART3->RBR;
|
UART3Buffer[UART3RxQueueWritePos] = LPC_UART3->RBR;
|
||||||
UART3RxQueueWritePos = (UART3RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
UART3RxQueueWritePos = (UART3RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dummy = LPC_UART3->RBR;;
|
dummy = LPC_UART3->RBR;
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
||||||
{
|
{
|
||||||
/* Character Time-out indicator */
|
/* Character Time-out indicator */
|
||||||
UART3Status |= 0x100; /* Bit 9 as the CTI error */
|
UART3Status |= 0x100; /* Bit 9 as the CTI error */
|
||||||
}
|
}
|
||||||
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
else if ( IIRValue == IIR_THRE ) /* THRE, transmit holding register empty */
|
||||||
{
|
{
|
||||||
/* THRE interrupt */
|
/* THRE interrupt */
|
||||||
LSRValue = LPC_UART3->LSR; /* Check status in the LSR to see if
|
LSRValue = LPC_UART3->LSR; /* Check status in the LSR to see if
|
||||||
valid data in U0THR or not */
|
valid data in U0THR or not */
|
||||||
if ( LSRValue & LSR_THRE )
|
if ( LSRValue & LSR_THRE )
|
||||||
{
|
{
|
||||||
UART3TxEmpty = 1;
|
UART3TxEmpty = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UART3TxEmpty = 0;
|
UART3TxEmpty = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,9 +147,11 @@
|
||||||
bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
|
bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
|
||||||
|
|
||||||
void Servo::move(const int value) {
|
void Servo::move(const int value) {
|
||||||
|
constexpr uint16_t servo_delay[] = SERVO_DELAY;
|
||||||
|
static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||||
if (this->attach(0) >= 0) { // notice the pin number is zero here
|
if (this->attach(0) >= 0) { // notice the pin number is zero here
|
||||||
this->write(value);
|
this->write(value);
|
||||||
delay(SERVO_DELAY);
|
delay(servo_delay[this->servoIndex]);
|
||||||
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||||||
this->detach();
|
this->detach();
|
||||||
LPC1768_PWM_detach_pin(servo_info[this->servoIndex].Pin.nbr); // shut down the PWM signal
|
LPC1768_PWM_detach_pin(servo_info[this->servoIndex].Pin.nbr); // shut down the PWM signal
|
||||||
|
|
|
@ -292,10 +292,10 @@ void SoftwareSerial::begin(long speed)
|
||||||
|
|
||||||
void SoftwareSerial::setRxIntMsk(bool enable)
|
void SoftwareSerial::setRxIntMsk(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
if (enable)
|
||||||
GpioEnableInt(_receivePort,_receivePin,CHANGE);
|
GpioEnableInt(_receivePort,_receivePin,CHANGE);
|
||||||
else
|
else
|
||||||
GpioDisableInt(_receivePort,_receivePin);
|
GpioDisableInt(_receivePort,_receivePin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoftwareSerial::end()
|
void SoftwareSerial::end()
|
||||||
|
|
|
@ -71,12 +71,12 @@ private:
|
||||||
static SoftwareSerial *active_object;
|
static SoftwareSerial *active_object;
|
||||||
|
|
||||||
// private methods
|
// private methods
|
||||||
void recv() __attribute__((__always_inline__));
|
void recv();
|
||||||
uint32_t rx_pin_read();
|
uint32_t rx_pin_read();
|
||||||
void tx_pin_write(uint8_t pin_state) __attribute__((__always_inline__));
|
void tx_pin_write(uint8_t pin_state);
|
||||||
void setTX(uint8_t transmitPin);
|
void setTX(uint8_t transmitPin);
|
||||||
void setRX(uint8_t receivePin);
|
void setRX(uint8_t receivePin);
|
||||||
void setRxIntMsk(bool enable) __attribute__((__always_inline__));
|
void setRxIntMsk(bool enable);
|
||||||
|
|
||||||
// private static method for timing
|
// private static method for timing
|
||||||
static inline void tunedDelay(uint32_t delay);
|
static inline void tunedDelay(uint32_t delay);
|
||||||
|
|
|
@ -62,9 +62,9 @@ void delayMicroseconds(uint32_t us) {
|
||||||
while (loops > 0) --loops;
|
while (loops > 0) --loops;
|
||||||
}
|
}
|
||||||
else { // poll systick, more accurate through interrupts
|
else { // poll systick, more accurate through interrupts
|
||||||
int32_t start = SysTick->VAL;
|
uint32_t start = SysTick->VAL;
|
||||||
int32_t load = SysTick->LOAD;
|
uint32_t load = SysTick->LOAD;
|
||||||
int32_t end = start - (load / 1000) * us;
|
uint32_t end = start - (load / 1000) * us;
|
||||||
|
|
||||||
if (end >> 31)
|
if (end >> 31)
|
||||||
while (!(SysTick->VAL > start && SysTick->VAL < (load + end))) __NOP();
|
while (!(SysTick->VAL > start && SysTick->VAL < (load + end))) __NOP();
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
|
|
||||||
#if ENABLED(MIXING_EXTRUDER)
|
#if ENABLED(MIXING_EXTRUDER)
|
||||||
|
|
||||||
|
#if ENABLED(DIRECT_MIXING_IN_G1)
|
||||||
|
#include "../gcode/parser.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
float mixing_factor[MIXING_STEPPERS]; // Reciprocal of mix proportion. 0.0 = off, otherwise >= 1.0.
|
float mixing_factor[MIXING_STEPPERS]; // Reciprocal of mix proportion. 0.0 = off, otherwise >= 1.0.
|
||||||
|
|
||||||
#if MIXING_VIRTUAL_TOOLS > 1
|
#if MIXING_VIRTUAL_TOOLS > 1
|
||||||
|
|
|
@ -52,21 +52,23 @@ static float resume_position[XYZE];
|
||||||
static bool sd_print_paused = false;
|
static bool sd_print_paused = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void filament_change_beep(const int8_t max_beep_count, const bool init=false) {
|
#if HAS_BUZZER
|
||||||
static millis_t next_buzz = 0;
|
static void filament_change_beep(const int8_t max_beep_count, const bool init=false) {
|
||||||
static int8_t runout_beep = 0;
|
static millis_t next_buzz = 0;
|
||||||
|
static int8_t runout_beep = 0;
|
||||||
|
|
||||||
if (init) next_buzz = runout_beep = 0;
|
if (init) next_buzz = runout_beep = 0;
|
||||||
|
|
||||||
const millis_t ms = millis();
|
const millis_t ms = millis();
|
||||||
if (ELAPSED(ms, next_buzz)) {
|
if (ELAPSED(ms, next_buzz)) {
|
||||||
if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to
|
if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to
|
||||||
next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 2500 : 400);
|
next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 2500 : 400);
|
||||||
BUZZ(300, 2000);
|
BUZZ(300, 2000);
|
||||||
runout_beep++;
|
runout_beep++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
|
|
||||||
static void ensure_safe_temperature() {
|
static void ensure_safe_temperature() {
|
||||||
bool heaters_heating = true;
|
bool heaters_heating = true;
|
||||||
|
|
|
@ -79,8 +79,8 @@ char* top_of_stack() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count the number of test bytes at the specified location.
|
// Count the number of test bytes at the specified location.
|
||||||
inline int16_t count_test_bytes(const char * const ptr) {
|
inline int32_t count_test_bytes(const char * const ptr) {
|
||||||
for (uint16_t i = 0; i < 32000; i++)
|
for (uint32_t i = 0; i < 32000; i++)
|
||||||
if (((char) ptr[i]) != TEST_BYTE)
|
if (((char) ptr[i]) != TEST_BYTE)
|
||||||
return i - 1;
|
return i - 1;
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ inline int check_for_free_memory_corruption(const char * const title) {
|
||||||
int block_cnt = 0;
|
int block_cnt = 0;
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
if (ptr[i] == TEST_BYTE) {
|
if (ptr[i] == TEST_BYTE) {
|
||||||
int16_t j = count_test_bytes(ptr + i);
|
int32_t j = count_test_bytes(ptr + i);
|
||||||
if (j > 8) {
|
if (j > 8) {
|
||||||
// SERIAL_ECHOPAIR("Found ", j);
|
// SERIAL_ECHOPAIR("Found ", j);
|
||||||
// SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(ptr + i));
|
// SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(ptr + i));
|
||||||
|
@ -215,14 +215,14 @@ inline int check_for_free_memory_corruption(const char * const title) {
|
||||||
* Return the number of free bytes in the memory pool,
|
* Return the number of free bytes in the memory pool,
|
||||||
* with other vital statistics defining the pool.
|
* with other vital statistics defining the pool.
|
||||||
*/
|
*/
|
||||||
inline void free_memory_pool_report(char * const ptr, const int16_t size) {
|
inline void free_memory_pool_report(char * const ptr, const int32_t size) {
|
||||||
int16_t max_cnt = -1, block_cnt = 0;
|
int32_t max_cnt = -1, block_cnt = 0;
|
||||||
char *max_addr = NULL;
|
char *max_addr = NULL;
|
||||||
// Find the longest block of test bytes in the buffer
|
// Find the longest block of test bytes in the buffer
|
||||||
for (int16_t i = 0; i < size; i++) {
|
for (int32_t i = 0; i < size; i++) {
|
||||||
char *addr = ptr + i;
|
char *addr = ptr + i;
|
||||||
if (*addr == TEST_BYTE) {
|
if (*addr == TEST_BYTE) {
|
||||||
const int16_t j = count_test_bytes(addr);
|
const int32_t j = count_test_bytes(addr);
|
||||||
if (j > 8) {
|
if (j > 8) {
|
||||||
SERIAL_ECHOPAIR("Found ", j);
|
SERIAL_ECHOPAIR("Found ", j);
|
||||||
SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr));
|
SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr));
|
||||||
|
@ -249,13 +249,13 @@ inline void free_memory_pool_report(char * const ptr, const int16_t size) {
|
||||||
* Corrupt <num> locations in the free memory pool and report the corrupt addresses.
|
* Corrupt <num> locations in the free memory pool and report the corrupt addresses.
|
||||||
* This is useful to check the correctness of the M100 D and the M100 F commands.
|
* This is useful to check the correctness of the M100 D and the M100 F commands.
|
||||||
*/
|
*/
|
||||||
inline void corrupt_free_memory(char *ptr, const uint16_t size) {
|
inline void corrupt_free_memory(char *ptr, const uint32_t size) {
|
||||||
ptr += 8;
|
ptr += 8;
|
||||||
const uint16_t near_top = top_of_stack() - ptr - 250, // -250 to avoid interrupt activity that's altered the stack.
|
const uint32_t near_top = top_of_stack() - ptr - 250, // -250 to avoid interrupt activity that's altered the stack.
|
||||||
j = near_top / (size + 1);
|
j = near_top / (size + 1);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
|
SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
|
||||||
for (uint16_t i = 1; i <= size; i++) {
|
for (uint32_t i = 1; i <= size; i++) {
|
||||||
char * const addr = ptr + i * j;
|
char * const addr = ptr + i * j;
|
||||||
*addr = i;
|
*addr = i;
|
||||||
SERIAL_ECHOPAIR("\nCorrupting address: ", hex_address(addr));
|
SERIAL_ECHOPAIR("\nCorrupting address: ", hex_address(addr));
|
||||||
|
@ -268,7 +268,7 @@ inline void free_memory_pool_report(char * const ptr, const int16_t size) {
|
||||||
* M100 I
|
* M100 I
|
||||||
* Init memory for the M100 tests. (Automatically applied on the first M100.)
|
* Init memory for the M100 tests. (Automatically applied on the first M100.)
|
||||||
*/
|
*/
|
||||||
inline void init_free_memory(char *ptr, int16_t size) {
|
inline void init_free_memory(char *ptr, int32_t size) {
|
||||||
SERIAL_ECHOLNPGM("Initializing free memory block.\n\n");
|
SERIAL_ECHOLNPGM("Initializing free memory block.\n\n");
|
||||||
|
|
||||||
size -= 250; // -250 to avoid interrupt activity that's altered the stack.
|
size -= 250; // -250 to avoid interrupt activity that's altered the stack.
|
||||||
|
@ -284,7 +284,7 @@ inline void init_free_memory(char *ptr, int16_t size) {
|
||||||
SERIAL_ECHO(size);
|
SERIAL_ECHO(size);
|
||||||
SERIAL_ECHOLNPGM(" bytes of memory initialized.\n");
|
SERIAL_ECHOLNPGM(" bytes of memory initialized.\n");
|
||||||
|
|
||||||
for (int16_t i = 0; i < size; i++) {
|
for (int32_t i = 0; i < size; i++) {
|
||||||
if (ptr[i] != TEST_BYTE) {
|
if (ptr[i] != TEST_BYTE) {
|
||||||
SERIAL_ECHOPAIR("? address : ", hex_address(ptr + i));
|
SERIAL_ECHOPAIR("? address : ", hex_address(ptr + i));
|
||||||
SERIAL_ECHOLNPAIR("=", hex_byte(ptr[i]));
|
SERIAL_ECHOLNPAIR("=", hex_byte(ptr[i]));
|
||||||
|
|
|
@ -141,15 +141,16 @@ inline void servo_probe_test() {
|
||||||
|
|
||||||
SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times");
|
SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times");
|
||||||
SET_INPUT_PULLUP(PROBE_TEST_PIN);
|
SET_INPUT_PULLUP(PROBE_TEST_PIN);
|
||||||
|
uint8_t i = 0;
|
||||||
bool deploy_state, stow_state;
|
bool deploy_state, stow_state;
|
||||||
for (uint8_t i = 0; i < 4; i++) {
|
do {
|
||||||
MOVE_SERVO(probe_index, z_servo_angle[0]); //deploy
|
MOVE_SERVO(probe_index, z_servo_angle[0]); //deploy
|
||||||
safe_delay(500);
|
safe_delay(500);
|
||||||
deploy_state = READ(PROBE_TEST_PIN);
|
deploy_state = READ(PROBE_TEST_PIN);
|
||||||
MOVE_SERVO(probe_index, z_servo_angle[1]); //stow
|
MOVE_SERVO(probe_index, z_servo_angle[1]); //stow
|
||||||
safe_delay(500);
|
safe_delay(500);
|
||||||
stow_state = READ(PROBE_TEST_PIN);
|
stow_state = READ(PROBE_TEST_PIN);
|
||||||
}
|
} while (++i < 4);
|
||||||
if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
|
if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
|
||||||
|
|
||||||
gcode.refresh_cmd_timeout();
|
gcode.refresh_cmd_timeout();
|
||||||
|
@ -167,7 +168,6 @@ inline void servo_probe_test() {
|
||||||
#if ENABLED(BLTOUCH)
|
#if ENABLED(BLTOUCH)
|
||||||
SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true.");
|
SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
else { // measure active signal length
|
else { // measure active signal length
|
||||||
MOVE_SERVO(probe_index, z_servo_angle[0]); // deploy
|
MOVE_SERVO(probe_index, z_servo_angle[0]); // deploy
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "../../gcode.h"
|
#include "../../gcode.h"
|
||||||
#include "../../parser.h"
|
#include "../../parser.h"
|
||||||
#include "../../../feature/pause.h"
|
#include "../../../feature/pause.h"
|
||||||
|
#include "../../../module/motion.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* M125: Store current position and move to filament change position.
|
* M125: Store current position and move to filament change position.
|
||||||
|
|
|
@ -36,6 +36,10 @@ GcodeSuite gcode;
|
||||||
#include "../module/printcounter.h"
|
#include "../module/printcounter.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(DIRECT_MIXING_IN_G1)
|
||||||
|
#include "../feature/mixing.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../Marlin.h" // for idle()
|
#include "../Marlin.h" // for idle()
|
||||||
|
|
||||||
uint8_t GcodeSuite::target_extruder;
|
uint8_t GcodeSuite::target_extruder;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "../Marlin.h"
|
#include "../Marlin.h"
|
||||||
|
|
||||||
#if ENABLED(DEBUG_GCODE_PARSER)
|
#if ENABLED(DEBUG_GCODE_PARSER)
|
||||||
#include "../../libs/hex_print_routines.h"
|
#include "../libs/hex_print_routines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Must be declared for allocation and to satisfy the linker
|
// Must be declared for allocation and to satisfy the linker
|
||||||
|
|
|
@ -2693,7 +2693,6 @@ void kill_screen(const char* lcd_msg) {
|
||||||
void lcd_delta_settings() {
|
void lcd_delta_settings() {
|
||||||
START_MENU();
|
START_MENU();
|
||||||
MENU_BACK(MSG_DELTA_CALIBRATE);
|
MENU_BACK(MSG_DELTA_CALIBRATE);
|
||||||
float Tz = 0.00;
|
|
||||||
MENU_ITEM_EDIT(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, DELTA_DIAGONAL_ROD - 5.0, DELTA_DIAGONAL_ROD + 5.0);
|
MENU_ITEM_EDIT(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, DELTA_DIAGONAL_ROD - 5.0, DELTA_DIAGONAL_ROD + 5.0);
|
||||||
_delta_height = DELTA_HEIGHT + home_offset[Z_AXIS];
|
_delta_height = DELTA_HEIGHT + home_offset[Z_AXIS];
|
||||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &_delta_height, _delta_height - 10.0, _delta_height + 10.0, _lcd_set_delta_height);
|
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &_delta_height, _delta_height - 10.0, _delta_height + 10.0, _lcd_set_delta_height);
|
||||||
|
|
|
@ -21,41 +21,46 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../inc/MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
#include "../gcode/parser.h"
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(DEBUG_GCODE_PARSER)
|
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(DEBUG_GCODE_PARSER)
|
||||||
|
|
||||||
#include "hex_print_routines.h"
|
#include "hex_print_routines.h"
|
||||||
|
|
||||||
#ifdef CPU_32_BIT
|
#ifdef CPU_32_BIT
|
||||||
constexpr int byte_start = 0;
|
|
||||||
static char _hex[] = "0x0000";
|
|
||||||
#else
|
|
||||||
constexpr int byte_start = 4;
|
constexpr int byte_start = 4;
|
||||||
static char _hex[] = "0x00000000";
|
static char _hex[] = "0x00000000";
|
||||||
|
#else
|
||||||
|
constexpr int byte_start = 0;
|
||||||
|
static char _hex[] = "0x0000";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char* hex_byte(const uint8_t b) {
|
char* hex_byte(const uint8_t b) {
|
||||||
_hex[byte_start + 4] = hex_nybble(b >> 4);
|
_hex[byte_start + 4] = hex_nybble(b >> 4);
|
||||||
_hex[byte_start + 5] = hex_nybble(b);
|
_hex[byte_start + 5] = hex_nybble(b);
|
||||||
return &_hex[byte_start];
|
return &_hex[byte_start + 4];
|
||||||
}
|
}
|
||||||
|
|
||||||
char* hex_word(const uint16_t w) {
|
inline void _hex_word(const uint16_t w) {
|
||||||
_hex[byte_start + 2] = hex_nybble(w >> 12);
|
_hex[byte_start + 2] = hex_nybble(w >> 12);
|
||||||
_hex[byte_start + 3] = hex_nybble(w >> 8);
|
_hex[byte_start + 3] = hex_nybble(w >> 8);
|
||||||
_hex[byte_start + 4] = hex_nybble(w >> 4);
|
_hex[byte_start + 4] = hex_nybble(w >> 4);
|
||||||
_hex[byte_start + 5] = hex_nybble(w);
|
_hex[byte_start + 5] = hex_nybble(w);
|
||||||
return &_hex[byte_start - 2];
|
}
|
||||||
|
|
||||||
|
char* hex_word(const uint16_t w) {
|
||||||
|
_hex_word(w);
|
||||||
|
return &_hex[byte_start + 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CPU_32_BIT
|
#ifdef CPU_32_BIT
|
||||||
char* hex_long(const uint32_t w) {
|
char* hex_long(const uint32_t l) {
|
||||||
_hex[byte_start - 2] = hex_nybble(w >> 28);
|
_hex[2] = hex_nybble(l >> 28);
|
||||||
_hex[byte_start - 1] = hex_nybble(w >> 24);
|
_hex[3] = hex_nybble(l >> 24);
|
||||||
_hex[byte_start + 0] = hex_nybble(w >> 20);
|
_hex[4] = hex_nybble(l >> 20);
|
||||||
_hex[byte_start + 1] = hex_nybble(w >> 16);
|
_hex[5] = hex_nybble(l >> 16);
|
||||||
(void)hex_word((uint16_t)(w & 0xFFFF));
|
_hex_word((uint16_t)(l & 0xFFFF));
|
||||||
return &_hex[byte_start - 6];
|
return &_hex[2];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
#include "../module/motion.h"
|
#include "../module/motion.h"
|
||||||
#include "point_t.h"
|
#include "point_t.h"
|
||||||
|
|
||||||
|
#if ENABLED(DELTA)
|
||||||
|
#include "../module/delta.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Stroke clean pattern
|
* @brief Stroke clean pattern
|
||||||
* @details Wipes the nozzle back and forth in a linear movement
|
* @details Wipes the nozzle back and forth in a linear movement
|
||||||
|
|
|
@ -135,9 +135,9 @@ volatile uint32_t Stepper::step_events_completed = 0; // The number of step even
|
||||||
* This fix isn't perfect and may lose steps - but better than locking up completely
|
* This fix isn't perfect and may lose steps - but better than locking up completely
|
||||||
* in future the planner should slow down if advance stepping rate would be too high
|
* in future the planner should slow down if advance stepping rate would be too high
|
||||||
*/
|
*/
|
||||||
FORCE_INLINE uint16_t adv_rate(const int steps, const uint16_t timer, const uint8_t loops) {
|
FORCE_INLINE HAL_TIMER_TYPE adv_rate(const int steps, const HAL_TIMER_TYPE timer, const uint8_t loops) {
|
||||||
if (steps) {
|
if (steps) {
|
||||||
const uint16_t rate = (timer * loops) / abs(steps);
|
const HAL_TIMER_TYPE rate = (timer * loops) / abs(steps);
|
||||||
//return constrain(rate, 1, ADV_NEVER - 1)
|
//return constrain(rate, 1, ADV_NEVER - 1)
|
||||||
return rate ? rate : 1;
|
return rate ? rate : 1;
|
||||||
}
|
}
|
||||||
|
@ -815,8 +815,8 @@ void Stepper::isr() {
|
||||||
#if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
|
#if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
|
||||||
#ifdef CPU_32_BIT
|
#ifdef CPU_32_BIT
|
||||||
// Make sure stepper interrupt does not monopolise CPU by adjusting count to give about 8 us room
|
// Make sure stepper interrupt does not monopolise CPU by adjusting count to give about 8 us room
|
||||||
uint32_t stepper_timer_count = HAL_timer_get_count(STEP_TIMER_NUM),
|
HAL_TIMER_TYPE stepper_timer_count = HAL_timer_get_count(STEP_TIMER_NUM),
|
||||||
stepper_timer_current_count = HAL_timer_get_current_count(STEP_TIMER_NUM) + 8 * HAL_TICKS_PER_US;
|
stepper_timer_current_count = HAL_timer_get_current_count(STEP_TIMER_NUM) + 8 * HAL_TICKS_PER_US;
|
||||||
HAL_timer_set_count(STEP_TIMER_NUM, max(stepper_timer_count, stepper_timer_current_count));
|
HAL_timer_set_count(STEP_TIMER_NUM, max(stepper_timer_count, stepper_timer_current_count));
|
||||||
#else
|
#else
|
||||||
NOLESS(OCR1A, TCNT1 + 16);
|
NOLESS(OCR1A, TCNT1 + 16);
|
||||||
|
|
|
@ -1744,8 +1744,8 @@ void Temperature::isr() {
|
||||||
|
|
||||||
// Macros for Slow PWM timer logic
|
// Macros for Slow PWM timer logic
|
||||||
#define _SLOW_PWM_ROUTINE(NR, src) \
|
#define _SLOW_PWM_ROUTINE(NR, src) \
|
||||||
soft_pwm_ ##NR = src; \
|
soft_pwm_count_ ##NR = src; \
|
||||||
if (soft_pwm_ ##NR > 0) { \
|
if (soft_pwm_count_ ##NR > 0) { \
|
||||||
if (state_timer_heater_ ##NR == 0) { \
|
if (state_timer_heater_ ##NR == 0) { \
|
||||||
if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \
|
if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \
|
||||||
state_heater_ ##NR = 1; \
|
state_heater_ ##NR = 1; \
|
||||||
|
@ -1762,7 +1762,7 @@ void Temperature::isr() {
|
||||||
#define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm_amount[n])
|
#define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm_amount[n])
|
||||||
|
|
||||||
#define PWM_OFF_ROUTINE(NR) \
|
#define PWM_OFF_ROUTINE(NR) \
|
||||||
if (soft_pwm_ ##NR < slow_pwm_count) { \
|
if (soft_pwm_count_ ##NR < slow_pwm_count) { \
|
||||||
if (state_timer_heater_ ##NR == 0) { \
|
if (state_timer_heater_ ##NR == 0) { \
|
||||||
if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \
|
if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \
|
||||||
state_heater_ ##NR = 0; \
|
state_heater_ ##NR = 0; \
|
||||||
|
|
|
@ -286,8 +286,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
||||||
#else // !DUAL_X_CARRIAGE
|
#else // !DUAL_X_CARRIAGE
|
||||||
|
|
||||||
#if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder
|
#if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder
|
||||||
const float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
|
float z_raise = PARKING_EXTRUDER_SECURITY_RAISE;
|
||||||
float z_raise = 0;
|
|
||||||
if (!no_move) {
|
if (!no_move) {
|
||||||
|
|
||||||
const float parkingposx[] = PARKING_EXTRUDER_PARKING_X,
|
const float parkingposx[] = PARKING_EXTRUDER_PARKING_X,
|
||||||
|
@ -310,7 +309,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
||||||
SERIAL_ECHOLNPGM("Starting Autopark");
|
SERIAL_ECHOLNPGM("Starting Autopark");
|
||||||
if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position);
|
if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position);
|
||||||
#endif
|
#endif
|
||||||
z_raise = PARKING_EXTRUDER_SECURITY_RAISE;
|
|
||||||
current_position[Z_AXIS] += z_raise;
|
current_position[Z_AXIS] += z_raise;
|
||||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
SERIAL_ECHOLNPGM("(1) Raise Z-Axis ");
|
SERIAL_ECHOLNPGM("(1) Raise Z-Axis ");
|
||||||
|
|
|
@ -1388,7 +1388,7 @@ bool SdBaseFile::rmdir() {
|
||||||
* the value zero, false, is returned for failure.
|
* the value zero, false, is returned for failure.
|
||||||
*/
|
*/
|
||||||
bool SdBaseFile::rmRfStar() {
|
bool SdBaseFile::rmRfStar() {
|
||||||
uint16_t index;
|
uint32_t index;
|
||||||
SdBaseFile f;
|
SdBaseFile f;
|
||||||
rewind();
|
rewind();
|
||||||
while (curPosition_ < fileSize_) {
|
while (curPosition_ < fileSize_) {
|
||||||
|
|
|
@ -115,7 +115,7 @@ void NVIC_SCBDeInit(void)
|
||||||
SCB->SCR = 0x00000000;
|
SCB->SCR = 0x00000000;
|
||||||
SCB->CCR = 0x00000000;
|
SCB->CCR = 0x00000000;
|
||||||
|
|
||||||
for (tmp = 0; tmp < 32; tmp++) {
|
for (tmp = 0; tmp < (sizeof(SCB->SHP) / sizeof(SCB->SHP[0])); tmp++) {
|
||||||
SCB->SHP[tmp] = 0x00;
|
SCB->SHP[tmp] = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue