diff --git a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp index cd76e8f704..6e3acb9e30 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp @@ -102,7 +102,7 @@ void HardwareSerial::begin(uint32_t baudrate) { // Initialize eripheral with given to corresponding parameter UART_Init(UARTx, &UARTConfigStruct); - + // Enable and reset the TX and RX FIFOs UART_FIFOConfigStructInit(&FIFOConfig); UART_FIFOConfig(UARTx, &FIFOConfig); @@ -113,7 +113,7 @@ void HardwareSerial::begin(uint32_t baudrate) { // Configure Interrupts UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); UART_IntConfig(UARTx, UART_INTCFG_RLS, ENABLE); - + if (UARTx == LPC_UART0) NVIC_EnableIRQ(UART0_IRQn); else if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) @@ -135,13 +135,13 @@ int HardwareSerial::peek() { /* Temporarily lock out UART receive interrupts during this read so the UART receive interrupt won't cause problems with the index values */ UART_IntConfig(UARTx, UART_INTCFG_RBR, DISABLE); - + if (RxQueueReadPos != RxQueueWritePos) byte = RxBuffer[RxQueueReadPos]; /* Re-enable UART interrupts */ UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); - + return byte; } @@ -151,7 +151,7 @@ int HardwareSerial::read() { /* Temporarily lock out UART receive interrupts during this read so the UART receive interrupt won't cause problems with the index values */ UART_IntConfig(UARTx, UART_INTCFG_RBR, DISABLE); - + if (RxQueueReadPos != RxQueueWritePos) { byte = RxBuffer[RxQueueReadPos]; RxQueueReadPos = (RxQueueReadPos + 1) % RX_BUFFER_SIZE; @@ -159,7 +159,7 @@ int HardwareSerial::read() { /* Re-enable UART interrupts */ UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); - + return byte; } @@ -170,7 +170,7 @@ size_t HardwareSerial::write(uint8_t send) { /* If the Tx Buffer is full, wait for space to clear */ if ((TxQueueWritePos+1) % TX_BUFFER_SIZE == TxQueueReadPos) flushTX(); - + /* Temporarily lock out UART transmit interrupts during this read so the UART transmit interrupt won't cause problems with the index values */ UART_IntConfig(UARTx, UART_INTCFG_THRE, DISABLE); @@ -180,7 +180,7 @@ size_t HardwareSerial::write(uint8_t send) { fifolvl = *(reinterpret_cast(&((LPC_UART1_TypeDef *) UARTx)->FIFOLVL)); else fifolvl = *(reinterpret_cast(&UARTx->FIFOLVL)); - + /* If the queue is empty and there's space in the FIFO, immediately send the byte */ if (TxQueueWritePos == TxQueueReadPos && fifolvl < UART_TX_FIFO_SIZE) { bytes = UART_Send(UARTx, &send, 1, BLOCKING); @@ -191,10 +191,10 @@ size_t HardwareSerial::write(uint8_t send) { TxQueueWritePos = (TxQueueWritePos+1) % TX_BUFFER_SIZE; bytes++; } - + /* Re-enable the TX Interrupt */ UART_IntConfig(UARTx, UART_INTCFG_THRE, ENABLE); - + return bytes; #else return UART_Send(UARTx, &send, 1, BLOCKING); @@ -251,7 +251,7 @@ void HardwareSerial::IRQHandler() { return; } } - + if ( IIRValue == UART_IIR_INTID_RDA ) /* Receive Data Available */ { /* Clear the FIFO */ @@ -278,7 +278,7 @@ void HardwareSerial::IRQHandler() { /* Wait for FIFO buffer empty */ while (UART_CheckBusy(UARTx) == SET); - + /* Transfer up to UART_TX_FIFO_SIZE bytes of data */ for (int i = 0; i < UART_TX_FIFO_SIZE && TxQueueWritePos != TxQueueReadPos; i++) { /* Move a piece of data into the transmit FIFO */ @@ -287,7 +287,7 @@ void HardwareSerial::IRQHandler() { else break; } - + /* If there is no more data to send, disable the transmit interrupt - else enable it or keep it enabled */ if (TxQueueWritePos == TxQueueReadPos) UART_IntConfig(UARTx, UART_INTCFG_THRE, DISABLE); diff --git a/Marlin/src/HAL/HAL_LPC1768/pinmapping.h b/Marlin/src/HAL/HAL_LPC1768/pinmapping.h index a514b83363..2547480ad0 100644 --- a/Marlin/src/HAL/HAL_LPC1768/pinmapping.h +++ b/Marlin/src/HAL/HAL_LPC1768/pinmapping.h @@ -163,7 +163,7 @@ constexpr bool INTERRUPT_PIN(const pin_t p) { #define NUM_ANALOG_INPUTS 8 #endif -constexpr pin_t adc_pin_table[] = { +constexpr pin_t adc_pin_table[] = { P0_23, P0_24, P0_25, P0_26, P1_30, P1_31, #if SERIAL_PORT != 0 P0_3, P0_2 @@ -214,5 +214,5 @@ const pin_t pin_map[] = { int16_t GET_PIN_MAP_INDEX(pin_t pin); int16_t PARSED_PIN_INDEX(char code, int16_t dval = 0); - + #endif // __HAL_PINMAPPING_H__ diff --git a/Marlin/src/feature/Max7219_Debug_LEDs.cpp b/Marlin/src/feature/Max7219_Debug_LEDs.cpp index ece730e1d2..a57c7a0f4d 100644 --- a/Marlin/src/feature/Max7219_Debug_LEDs.cpp +++ b/Marlin/src/feature/Max7219_Debug_LEDs.cpp @@ -329,23 +329,22 @@ void Max7219_idle_tasks() { #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) static millis_t next_blink = 0; - if (ELAPSED(millis(), next_blink)) { - Max7219_LED_Toggle(7, 7); - next_blink = millis() + 750; + Max7219_LED_Toggle(7, 7); + next_blink = millis() + 750; } #endif #ifdef MAX7219_DEBUG_STEPPER_HEAD static int16_t last_head_cnt=0; if (last_head_cnt != head) { - if ( last_head_cnt < 8) + if (last_head_cnt < 8) Max7219_LED_Off( last_head_cnt, MAX7219_DEBUG_STEPPER_HEAD); else Max7219_LED_Off( last_head_cnt-8, MAX7219_DEBUG_STEPPER_HEAD+1); last_head_cnt = head; - if ( head < 8) + if (head < 8) Max7219_LED_On(head, MAX7219_DEBUG_STEPPER_HEAD); else Max7219_LED_On(head-8, MAX7219_DEBUG_STEPPER_HEAD+1); @@ -355,13 +354,13 @@ void Max7219_idle_tasks() { #ifdef MAX7219_DEBUG_STEPPER_TAIL static int16_t last_tail_cnt=0; if (last_tail_cnt != tail) { - if ( last_tail_cnt < 8) + if (last_tail_cnt < 8) Max7219_LED_Off( last_tail_cnt, MAX7219_DEBUG_STEPPER_TAIL); else Max7219_LED_Off( last_tail_cnt-8, MAX7219_DEBUG_STEPPER_TAIL+1); last_tail_cnt = tail; - if ( tail < 8) + if (tail < 8) Max7219_LED_On(tail, MAX7219_DEBUG_STEPPER_TAIL); else Max7219_LED_On(tail-8, MAX7219_DEBUG_STEPPER_TAIL+1); @@ -381,10 +380,10 @@ void Max7219_idle_tasks() { en = max(current_depth, last_depth); if (current_depth < last_depth) for (uint8_t i = st; i <= en; i++) // clear the highest order LEDs - Max7219_LED_Off(i/2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1)); + Max7219_LED_Off(i/2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1)); else - for (uint8_t i = st; i <= en; i++) // set the LEDs to current depth - Max7219_LED_On(i/2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1)); + for (uint8_t i = st; i <= en; i++) // set the LEDs to current depth + Max7219_LED_On(i/2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1)); last_depth = current_depth; } diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index ca036563a0..51a8412a13 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -3749,9 +3749,9 @@ void kill_screen(const char* lcd_msg) { void lcd_sdcard_menu() { ENCODER_DIRECTION_MENUS(); - + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - if (ELAPSED(millis(), assume_print_finished)) { // if the printer has been busy printing, lcd_sdcard_menu() should not + if (ELAPSED(millis(), assume_print_finished)) { // if the printer has been busy printing, lcd_sdcard_menu() should not lcdDrawUpdate = LCDVIEW_REDRAW_NOW; // have been active for 5 seconds. In this case, restore the previous encoderPosition = saved_encoderPosition; // encoderPosition to the last selected item. assume_print_finished = millis() + 5000; @@ -3759,7 +3759,7 @@ void kill_screen(const char* lcd_msg) { saved_encoderPosition = encoderPosition; defer_return_to_status = true; #endif - + const uint16_t fileCnt = card.getnrfilenames(); START_MENU(); MENU_BACK(MSG_MAIN); @@ -4780,7 +4780,7 @@ void lcd_update() { if (currentScreen == lcd_status_screen || defer_return_to_status) #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) if (currentScreen != lcd_sdcard_menu) // lcd_sdcard_menu() does not time out if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; // When the printer finishes a file, it will wait with the file selected for + return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; // When the printer finishes a file, it will wait with the file selected for #else // a re-print. return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; #endif diff --git a/Marlin/src/pins/pins_AZSMZ_MINI.h b/Marlin/src/pins/pins_AZSMZ_MINI.h index 39dedd8f4a..60c3676f6c 100644 --- a/Marlin/src/pins/pins_AZSMZ_MINI.h +++ b/Marlin/src/pins/pins_AZSMZ_MINI.h @@ -39,7 +39,7 @@ // Servos // #define SERVO0_PIN 53 - + // // Limit Switches //