diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-09-27 00:51:11 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-09-27 00:51:11 -0400 |
commit | 994f1f1e36aad7351328822981421d16060ac688 (patch) | |
tree | ccb50651725863835c32fa5fd720bd2a9ab49f43 /wirish/comm/HardwareSerial.cpp | |
parent | 753f89de354eff212d84f3f2aff41146865da342 (diff) | |
download | librambutan-994f1f1e36aad7351328822981421d16060ac688.tar.gz librambutan-994f1f1e36aad7351328822981421d16060ac688.zip |
cleanups
Diffstat (limited to 'wirish/comm/HardwareSerial.cpp')
-rw-r--r-- | wirish/comm/HardwareSerial.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/wirish/comm/HardwareSerial.cpp b/wirish/comm/HardwareSerial.cpp index 902b160..425c610 100644 --- a/wirish/comm/HardwareSerial.cpp +++ b/wirish/comm/HardwareSerial.cpp @@ -1,4 +1,4 @@ -/* ***************************************************************************** +/****************************************************************************** * The MIT License * * Copyright (c) 2010 Perry Hung. @@ -20,12 +20,12 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. - * ****************************************************************************/ + *****************************************************************************/ /** - * @file HardwareSerial.cpp + * @file HardwareSerial.cpp * - * @brief Wiring-like serial api + * @brief Wiring-like serial api */ #include "wirish.h" @@ -68,18 +68,18 @@ void HardwareSerial::write(unsigned char ch) { } void HardwareSerial::begin(uint32 baud) { - if (baud > max_baud) { - return; - } + if (baud > max_baud) { + return; + } - gpio_set_mode(gpio_port, tx_pin, GPIO_MODE_AF_OUTPUT_PP); - gpio_set_mode(gpio_port, rx_pin, GPIO_MODE_INPUT_FLOATING); + gpio_set_mode(gpio_port, tx_pin, GPIO_MODE_AF_OUTPUT_PP); + gpio_set_mode(gpio_port, rx_pin, GPIO_MODE_INPUT_FLOATING); - if ((usart_num == USART1) || - (usart_num == USART2)) { - /* turn off any pwm if there's a conflict on this usart */ - timer_set_mode(timer_num, compare_num, TIMER_DISABLED); - } + if ((usart_num == USART1) || + (usart_num == USART2)) { + /* turn off any pwm if there's a conflict on this usart */ + timer_set_mode(timer_num, compare_num, TIMER_DISABLED); + } usart_init(usart_num, baud); } |