Commit Graph

12 Commits

Author SHA1 Message Date
etagle
99af086cea Add hidden Serial overflow debug options 2018-06-10 04:25:42 -05:00
etagle
d90e8fcad9 Fix XON/XOFF implementation
Pointed out by @GMagician
2018-06-10 04:25:42 -05:00
Eduardo José Tagle
d3c02410a8 [2.0.x] Small assorted collection of fixes and improvements (#10911)
* Misc fixes and improvements

- Get rid of most critical sections on the Serial port drivers for AVR and DUE. Proper usage of FIFOs should allow interrupts to stay enabled without harm to queuing and dequeuing.
  Also, with 8-bit indices (for AVR) and up to 32-bit indices (for ARM), there is no need to protect reads and writes to those indices.
- Simplify the XON/XOFF logic quite a bit. Much cleaner now (both for AVR and ARM)
- Prevent a race condition (edge case) that could happen when estimating the proper value for the stepper timer (by reading it) and writing the calculated value for the time to the next ISR by disabling interrupts in those critical and small sections of the code - The problem could lead to lost steps.
- Fix dual endstops not properly homing bug (maybe).

* Set position immediately when possible
2018-06-01 19:02:22 -05:00
etagle
0566badcef Add memory barrier, optimal interrupt on-off
Disabling an ISR on ARM has 3 instructions of latency. A Memory barrier is REQUIRED to ensure proper and predictable disabling. Memory barriers are expensive, so avoid disabling if already disabled (See https://mcuoneclipse.com/2015/10/16/nvic-disabling-interrupts-on-arm-cortex-m-and-the-need-for-a-memory-barrier-instruction/)
2018-05-20 02:39:34 -05:00
Scott Lahteine
2578996631
[2.0.x] Emergency parser for multiple serial ports (#10524) 2018-04-25 20:58:00 -05:00
Chris Pepper
2242b98248 [LPC176x] Emergency Parser Feature (#10516) 2018-04-25 06:44:26 -05:00
Eduardo José Tagle
0c428a66d9 Proper AVR preemptive interrupt handling (#10496)
Also simplify logic on all ARM-based interrupts. Now, it is REQUIRED to properly configure interrupt priority. USART should have highest priority, followed by Stepper, and then all others.
2018-04-23 22:05:07 -05:00
Scott Lahteine
649f375494
Fix: M112 calling kill from interrupt (#9923)
Fix #9906
2018-03-03 23:14:01 -06:00
Eduardo José Tagle
ac168a03c8 Fixes for the Arduino DUE HAL (Serial Port, Graphics Display, EEPROM emulation) (#8651)
* Fixing the DUE serial port assignments: Now -1 means the SAM3x USB Device emulating a serial port, and 0 means the USB to serial adapter included as a programming port

* Improving the Fast IO port access implementation on Arduino DUE

* Implemented EEPROM emulation on Due by storing data on the internal FLASH (with wear leveling)

* Implemented a Software SPI for the ST7920 graphics display for the Arduino RAMPS for DUE, as the default one in u8glib is clocking data too fast on ARM, and the display does not understand it.

* Fixing the case where the serial port selected is the USB device

* Adding configuration for the Makerparts 3D printer (www.makerparts.net)

* Tuned MakerParts acceleration on X and Y axis so it never loses steps. Also adjusted pulses per mm to match default hw configuration

* Fine tuned Maximum acceleration for MakerParts printer

* Style cleanup

* Style cleanup (2)

* Style fixes (3)

* Fixing the DUE serial port assignments: Now -1 means the SAM3x USB Device emulating a serial port, and 0 means the USB to serial adapter included as a programming port

* Improving the Fast IO port access implementation on Arduino DUE

* Implemented EEPROM emulation on Due by storing data on the internal FLASH (with wear leveling)

* Implemented a Software SPI for the ST7920 graphics display for the Arduino RAMPS for DUE, as the default one in u8glib is clocking data too fast on ARM, and the display does not understand it.

* Fixing the case where the serial port selected is the USB device

* Adding configuration for the Makerparts 3D printer (www.makerparts.net)

* Tuned MakerParts acceleration on X and Y axis so it never loses steps. Also adjusted pulses per mm to match default hw configuration

* Fine tuned Maximum acceleration for MakerParts printer

* Style cleanup

* Style changes to u8g_dev_st7920_128_64_sw_spi.cpp

* Even more improvements to the FastIO HAL for DUE. Now WRITE() is 2 ASM instructions, if value is constant, and 5 cycles if value is not constant. Previously, it was 7..8 cycles

* After some problems and debugging, seems we need to align the interrupt vector table to 256 bytes, otherwise, the program sometimes stops working

* Moved comments out of macro, otherwise, token pasting does not properly work sometimes

* Improved Software SPI implementation on DUE: Now it honors the selected speed passed to spiInit(). This allows much faster SDCARD access, improving SDCARD menus and reducing latency

* Update u8g_dev_st7920_128_64_sw_spi.cpp

* Disabling EEPROM over FLASH emulatiion if an I2C or SPI EEPROM is present
2017-12-12 17:51:36 -06:00
Scott Lahteine
c613a1ed38 Fix indentation, stepper.h dependency, etc. 2017-11-22 14:55:30 -06:00
teemuatlut
f011a32771 Board definitions for Ultratronics Pro v1.0 2017-11-22 14:55:24 -06:00
etagle
ba8dc678f5 Arduino Due XON/XOFF implementation
Alos includes emergency parser and configurable TX/RX buffers for Arduino Due.
2017-10-27 03:24:23 -05:00