jobytaffey/bus-ninja — pull request #7 by pfalcon (2012-04-19 23:31:20+00:00)
Title: Use proper formula to calculate baud rate, use doublespeed mode if needed

Formula as given on page 174 of atmega168 datasheet (doc2545) of course
assumes real numbers and proper rounding. Using integers and truncation
makes 57600 the last working speed for Arduino Duemilanove, while proper
formula allows to work with 230400 (can't get higher due to Linux ft232
driver limitation).

Also, on higher baud rates, switch to double-speed mode to improve match
between atmega baud rate and standard baud rate values (see page 198),
otherwise 230400 doesn't really work due to high error.

Finally, allow to override baud rate from command line/*.mk file.