projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CI: Build on Arch (bleeding-ege) and Ubuntu (stable) AVR-GCC toolchains.
[pub/USBasp.git]
/
LUFA
/
Drivers
/
USB
/
Core
/
DeviceStandardReq.c
diff --git
a/LUFA/Drivers/USB/Core/DeviceStandardReq.c
b/LUFA/Drivers/USB/Core/DeviceStandardReq.c
index
3176e15
..
45b43c2
100644
(file)
--- a/
LUFA/Drivers/USB/Core/DeviceStandardReq.c
+++ b/
LUFA/Drivers/USB/Core/DeviceStandardReq.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
3
.
+ Copyright (C) Dean Camera, 201
8
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
3
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
8
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-152,8
+152,8
@@
static void USB_Device_SetConfiguration(void)
#define MemoryAddressSpace MEMSPACE_FLASH
#elif defined(USE_EEPROM_DESCRIPTORS)
#define MemoryAddressSpace MEMSPACE_EEPROM
#define MemoryAddressSpace MEMSPACE_FLASH
#elif defined(USE_EEPROM_DESCRIPTORS)
#define MemoryAddressSpace MEMSPACE_EEPROM
- #elif defined(USE_
S
RAM_DESCRIPTORS)
- #define MemoryAddressSpace MEMSPACE_
S
RAM
+ #elif defined(USE_RAM_DESCRIPTORS)
+ #define MemoryAddressSpace MEMSPACE_RAM
#else
uint8_t MemoryAddressSpace;
#endif
#else
uint8_t MemoryAddressSpace;
#endif
@@
-292,6
+292,7
@@
static void USB_Device_GetStatus(void)
switch (USB_ControlRequest.bmRequestType)
{
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE):
switch (USB_ControlRequest.bmRequestType)
{
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE):
+ {
#if !defined(NO_DEVICE_SELF_POWER)
if (USB_Device_CurrentlySelfPowered)
CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
#if !defined(NO_DEVICE_SELF_POWER)
if (USB_Device_CurrentlySelfPowered)
CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
@@
-302,9
+303,16
@@
static void USB_Device_GetStatus(void)
CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
#endif
break;
CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
#endif
break;
+ }
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):
+ {
#if !defined(CONTROL_ONLY_DEVICE)
#if !defined(CONTROL_ONLY_DEVICE)
- Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
+ uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
+
+ if (EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS)
+ return;
+
+ Endpoint_SelectEndpoint(EndpointIndex);
CurrentStatus = Endpoint_IsStalled();
CurrentStatus = Endpoint_IsStalled();
@@
-312,6
+320,7
@@
static void USB_Device_GetStatus(void)
#endif
break;
#endif
break;
+ }
default:
return;
}
default:
return;
}
@@
-330,20
+339,23
@@
static void USB_Device_ClearSetFeature(void)
{
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
case REQREC_DEVICE:
{
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
case REQREC_DEVICE:
+ {
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup)
USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature);
else
return;
break;
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup)
USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature);
else
return;
break;
+ }
#endif
#if !defined(CONTROL_ONLY_DEVICE)
case REQREC_ENDPOINT:
#endif
#if !defined(CONTROL_ONLY_DEVICE)
case REQREC_ENDPOINT:
+ {
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt)
{
uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt)
{
uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
- if (EndpointIndex == ENDPOINT_CONTROLEP)
+ if (EndpointIndex == ENDPOINT_CONTROLEP
|| EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS
)
return;
Endpoint_SelectEndpoint(EndpointIndex);
return;
Endpoint_SelectEndpoint(EndpointIndex);
@@
-364,6
+376,7
@@
static void USB_Device_ClearSetFeature(void)
}
break;
}
break;
+ }
#endif
default:
return;
#endif
default:
return;