Applied suggested astyle fixes

pull/9539/head
Russ Butler 2019-01-29 15:45:18 -06:00
parent 5867e99bc9
commit f8864ae307
11 changed files with 60 additions and 45 deletions

View File

@ -47,12 +47,30 @@ public:
const char *get_serial_desc_string();
const char *get_iproduct_desc_string();
const char *get_iinterface_desc_string();
uint32_t get_reset_count() const { return reset_count; }
uint32_t get_suspend_count() const { return suspend_count; }
uint32_t get_resume_count() const { return resume_count; }
void clear_reset_count() { reset_count = 0; }
void clear_suspend_count() { suspend_count = 0; }
void clear_resume_count() { resume_count = 0; }
uint32_t get_reset_count() const
{
return reset_count;
}
uint32_t get_suspend_count() const
{
return suspend_count;
}
uint32_t get_resume_count() const
{
return resume_count;
}
void clear_reset_count()
{
reset_count = 0;
}
void clear_suspend_count()
{
suspend_count = 0;
}
void clear_resume_count()
{
resume_count = 0;
}
private:

View File

@ -73,7 +73,8 @@ bool EndpointResolver::valid()
return _valid && (_cost <= _table->resources);
}
void EndpointResolver::reset() {
void EndpointResolver::reset()
{
_cost = 0;
_used = 0;
_valid = true;

View File

@ -64,8 +64,7 @@ bool USBDevice::_request_get_descriptor()
printf("get descr: type: %d\r\n", DESCRIPTOR_TYPE(_transfer.setup.wValue));
#endif
switch (DESCRIPTOR_TYPE(_transfer.setup.wValue)) {
case DEVICE_DESCRIPTOR:
{
case DEVICE_DESCRIPTOR: {
if (device_desc() != NULL) {
if ((device_desc()[0] == DEVICE_DESCRIPTOR_LENGTH) \
&& (device_desc()[1] == DEVICE_DESCRIPTOR)) {
@ -80,8 +79,7 @@ bool USBDevice::_request_get_descriptor()
}
break;
}
case CONFIGURATION_DESCRIPTOR:
{
case CONFIGURATION_DESCRIPTOR: {
const uint8_t idx = DESCRIPTOR_INDEX(_transfer.setup.wValue);
if (configuration_desc(idx) != NULL) {
if ((configuration_desc(idx)[0] == CONFIGURATION_DESCRIPTOR_LENGTH) \
@ -100,8 +98,7 @@ bool USBDevice::_request_get_descriptor()
}
break;
}
case STRING_DESCRIPTOR:
{
case STRING_DESCRIPTOR: {
#ifdef DEBUG
printf("str descriptor\r\n");
#endif
@ -163,23 +160,20 @@ bool USBDevice::_request_get_descriptor()
}
break;
}
case INTERFACE_DESCRIPTOR:
{
case INTERFACE_DESCRIPTOR: {
#ifdef DEBUG
printf("interface descr\r\n");
#endif
break;
}
case ENDPOINT_DESCRIPTOR:
{
case ENDPOINT_DESCRIPTOR: {
#ifdef DEBUG
printf("endpoint descr\r\n");
#endif
/* TODO: Support is optional, not implemented here */
break;
}
default:
{
default: {
#ifdef DEBUG
printf("ERROR\r\n");
#endif
@ -1589,7 +1583,8 @@ void USBDevice::assert_locked()
MBED_ASSERT(_locked > 0);
}
void USBDevice::_change_state(DeviceState new_state) {
void USBDevice::_change_state(DeviceState new_state)
{
assert_locked();
DeviceState old_state = _device.state;

View File

@ -68,8 +68,7 @@
*
* @note Synchronization level: Thread safe
*/
class USBMouseKeyboard: public USBHID, public mbed::Stream
{
class USBMouseKeyboard: public USBHID, public mbed::Stream {
public:
/**

View File

@ -181,7 +181,8 @@ private:
};
// Bulk-only CBW
typedef MBED_PACKED(struct) {
typedef MBED_PACKED(struct)
{
uint32_t Signature;
uint32_t Tag;
uint32_t DataLength;
@ -192,7 +193,8 @@ private:
} CBW;
// Bulk-only CSW
typedef MBED_PACKED(struct) {
typedef MBED_PACKED(struct)
{
uint32_t Signature;
uint32_t Tag;
uint32_t DataResidue;