Rewrite of the serial port to support both 1 and 0