nxstyle fixes

This commit is contained in:
Gregory Nutt 2020-05-28 10:53:16 -06:00 committed by patacongo
parent 560ba3adcd
commit 5a9f7927ee
2 changed files with 31 additions and 49 deletions

View file

@ -828,16 +828,10 @@ static int ft232r_setdivisor(uint32_t *divisor, uint32_t baud)
} }
else else
{ {
int divfrac[9] = {0, int divfrac[9] =
500, {
250, 0, 500, 250, 125, 375, 625, 750, 875, 1000
125, };
375,
625,
750,
875,
1000
};
double frac = (double)USBHOST_FT232R_MAX_BAUD / (double)baud; double frac = (double)USBHOST_FT232R_MAX_BAUD / (double)baud;

View file

@ -1,44 +1,30 @@
/************************************************************************************ /************************************************************************************
* include/nuttx/usb/usbhost.h * include/nuttx/usb/usbhost.h
* *
* Copyright (C) 2010-2015 Gregory Nutt. All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more
* Author: Gregory Nutt <gnutt@nuttx.org> * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* *
* References: * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
************************************************************************************/
/* References:
* "Universal Serial Bus Mass Storage Class, Specification Overview," * "Universal Serial Bus Mass Storage Class, Specification Overview,"
* Revision 1.2, USB Implementer's Forum, June 23, 2003. * Revision 1.2, USB Implementer's Forum, June 23, 2003.
* *
* "Universal Serial Bus Mass Storage Class, Bulk-Only Transport," * "Universal Serial Bus Mass Storage Class, Bulk-Only Transport,"
* Revision 1.0, USB Implementer's Forum, September 31, 1999. * Revision 1.0, USB Implementer's Forum, September 31, 1999.
* */
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_USBHOST_H #ifndef __INCLUDE_NUTTX_USB_USBHOST_H
#define __INCLUDE_NUTTX_USB_USBHOST_H #define __INCLUDE_NUTTX_USB_USBHOST_H
@ -687,6 +673,7 @@ typedef FAR void *usbhost_ep_t;
* represented by struct usbhost_driver_s. Connected to the HCD are one * represented by struct usbhost_driver_s. Connected to the HCD are one
* or more hubs. At a minimum, the root hub is always present. Each hub * or more hubs. At a minimum, the root hub is always present. Each hub
* has from 1 to 4 ports. * has from 1 to 4 ports.
*/
/* Every class connects to the host controller driver (HCD) via a port on a /* Every class connects to the host controller driver (HCD) via a port on a
* hub. That hub may be an external hub or the internal, root hub. The * hub. That hub may be an external hub or the internal, root hub. The
@ -760,11 +747,12 @@ struct usbhost_class_s
struct usbhost_epdesc_s struct usbhost_epdesc_s
{ {
FAR struct usbhost_hubport_s *hport; /* Hub port that supports the endpoint */ FAR struct usbhost_hubport_s *hport; /* Hub port that supports the endpoint */
uint8_t addr; /* Endpoint address */ uint8_t addr; /* Endpoint address */
bool in; /* Direction: true->IN */ bool in; /* Direction: true->IN */
uint8_t xfrtype; /* Transfer type. See USB_EP_ATTR_XFER_* in usb.h */ uint8_t xfrtype; /* Transfer type. See USB_EP_ATTR_XFER_*
uint8_t interval; /* Polling interval */ * in usb.h */
uint16_t mxpacketsize; /* Max packetsize */ uint8_t interval; /* Polling interval */
uint16_t mxpacketsize; /* Max packetsize */
}; };
/* struct usbhost_connection_s provides as interface between platform-specific /* struct usbhost_connection_s provides as interface between platform-specific
@ -938,7 +926,7 @@ extern "C"
#endif #endif
/************************************************************************************ /************************************************************************************
* Public Functions * Public Function Prototypes
************************************************************************************/ ************************************************************************************/
/************************************************************************************ /************************************************************************************
@ -987,7 +975,7 @@ const struct usbhost_registry_s *
usbhost_findclass(FAR const struct usbhost_id_s *id); usbhost_findclass(FAR const struct usbhost_id_s *id);
#ifdef CONFIG_USBHOST_HUB #ifdef CONFIG_USBHOST_HUB
/*********************************************************************************** /************************************************************************************
* Name: usbhost_hub_initialize * Name: usbhost_hub_initialize
* *
* Description: * Description: