Protect MarlinSerial against interrupts
by shielding the CRITICAL_SECTIONs
Now with a test if RX_BUFFER_SIZE is in the required range.
Code in peek() and read() is now optimized for readability and showing the similarity between the two.
Maybe a bit overprotected in checkRx() and store_char(), but now some days without detected errors from this source.
- Add BIT and TEST macros
- Add _APPLY_ macros to stepper.cpp to help with consolidation
- Consolidate code in stepper.cpp using macros
- Apply standards in stepper.cpp
- Use >= 0 instead of > -1 as a better semantic
- Replace DUAL_Y_CARRIAGE with Y_DUAL_STEPPER_DRIVERS
Stop redefining MOTHERBOARD and #define AT90USB instead. Also put #ifndef AT90USB around the HardwareSerial_h trick, so now Printrboard / Brainwave support compiles on Arduino 1.0.2 as well.
This change makes the choice of serial port configurable so that
wireless capability can be easily added by connecting Bluetooth modules
(such as BlueSmirf or JY-MCU) to the expansion port pins.