From owner-p4-projects@FreeBSD.ORG Thu Jun 29 20:49:01 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CBDAD16A417; Thu, 29 Jun 2006 20:49:01 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6DF016A407 for ; Thu, 29 Jun 2006 20:49:01 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33CE343DB5 for ; Thu, 29 Jun 2006 20:48:56 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5TKmuF0020071 for ; Thu, 29 Jun 2006 20:48:56 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5TKmuaQ020068 for perforce@freebsd.org; Thu, 29 Jun 2006 20:48:56 GMT (envelope-from imp@freebsd.org) Date: Thu, 29 Jun 2006 20:48:56 GMT Message-Id: <200606292048.k5TKmuaQ020068@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 100313 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2006 20:49:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=100313 Change 100313 by imp@imp_lighthouse on 2006/06/29 20:48:51 Set number of stop bits correctly, or at least more correctly, rather than always setting it to 2. We note that it appears that the only time 1.5 stop bits were used was on 5-bit BAUDOT, so if 2 stop bits are requested, use 1.5 bits for 5-bit characters. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#32 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#32 (text+ko) ==== @@ -160,16 +160,19 @@ } /* - * Or in the stop bits. Note: The hardware supports - * 1.5 stop bits in async mode, but there's no way to - * specify that AFAICT. + * Or in the stop bits. Note: The hardware supports 1.5 stop + * bits in async mode, but there's no way to specify that + * AFAICT. Instead, rely on the convention documented at + * http://www.lammertbies.nl/comm/info/RS-232_specs.html which + * states that 1.5 stop bits are used for 5 bit bytes and + * 2 stop bits only for longer bytes. */ - if (stopbits > 1) + if (stopbits == 1) + mr |= USART_MR_NBSTOP_1; + else if (databits > 5) mr |= USART_MR_NBSTOP_2; else - mr |= USART_MR_NBSTOP_2; - /* else if (stopbits == 1.5) - mr |= USART_MR_NBSTOP_1_5; */ + mr |= USART_MR_NBSTOP_1_5; /* * We want normal plumbing mode too, none of this fancy