mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-10-30 21:02:32 +01:00 
			
		
		
		
	Fixed broken AVR32 endpoint/pipe communications when ORDERED_EP_CONFIG compile time option is not enabled (thanks to Matthias).
Fixed broken compilation for the AVR32 devices if the NO_SOF_EVENTS compile time option was not enabled (thanks to Matthias).
This commit is contained in:
		
							parent
							
								
									eb2e883fd3
								
							
						
					
					
						commit
						b711b7d6a4
					
				| @ -9,8 +9,8 @@ | |||||||
|   *  \section Sec_ChangeLogXXXXXX Version XXXXXX |   *  \section Sec_ChangeLogXXXXXX Version XXXXXX | ||||||
|   *  <b>New:</b> |   *  <b>New:</b> | ||||||
|   *  - Core: |   *  - Core: | ||||||
|   *   - Added support for the XMEGA A3BU Xplained board. |   *   - Added support for the XMEGA A3BU Xplained board | ||||||
|   *   - Added support for the new B series XMEGA devices. |   *   - Added support for the new B series XMEGA devices | ||||||
|   *  - Library Applications: |   *  - Library Applications: | ||||||
|   *   - Added User Application APIs to the CDC and DFU class bootloaders |   *   - Added User Application APIs to the CDC and DFU class bootloaders | ||||||
|   *   - Added INVERTED_ISP_MISO compile time option to the AVRISP-MKII clone project (thanks to Chuck Rohs) |   *   - Added INVERTED_ISP_MISO compile time option to the AVRISP-MKII clone project (thanks to Chuck Rohs) | ||||||
| @ -29,6 +29,8 @@ | |||||||
|   *   - Fixed CDC class drivers not saving and sending all 16-bits of the control line states (thanks to Matthew Swabey) |   *   - Fixed CDC class drivers not saving and sending all 16-bits of the control line states (thanks to Matthew Swabey) | ||||||
|   *   - Fixed race conditions in the CDC, HID and Mass Storage class drivers when processing some control requests |   *   - Fixed race conditions in the CDC, HID and Mass Storage class drivers when processing some control requests | ||||||
|   *   - Fixed misspelled HID_KEYBOARD_MODIFIER_* macros in the HID class driver (thanks to Laszlo Monda) |   *   - Fixed misspelled HID_KEYBOARD_MODIFIER_* macros in the HID class driver (thanks to Laszlo Monda) | ||||||
|  |   *   - Fixed broken AVR32 endpoint/pipe communications when ORDERED_EP_CONFIG compile time option is not enabled (thanks to Matthias) | ||||||
|  |   *   - Fixed broken compilation for the AVR32 devices if the NO_SOF_EVENTS compile time option was not enabled (thanks to Matthias) | ||||||
|   *  - Library Applications: |   *  - Library Applications: | ||||||
|   *   - Added reliability patches to the AVRISP-MKII Clone project's PDI/TPI protocols (thanks to Justin Mattair) |   *   - Added reliability patches to the AVRISP-MKII Clone project's PDI/TPI protocols (thanks to Justin Mattair) | ||||||
|   *   - Fixed AVRISP-MKII Clone compile warning on AVR8 U4 targets even when NO_VTARGET_DETECT is enabled |   *   - Fixed AVRISP-MKII Clone compile warning on AVR8 U4 targets even when NO_VTARGET_DETECT is enabled | ||||||
|  | |||||||
| @ -45,19 +45,20 @@ volatile uint8_t* USB_Endpoint_FIFOPos[ENDPOINT_TOTAL_ENDPOINTS]; | |||||||
| bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, | bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, | ||||||
|                                     const uint32_t UECFG0Data) |                                     const uint32_t UECFG0Data) | ||||||
| { | { | ||||||
|  | 	USB_Endpoint_FIFOPos[Number] = &AVR32_USBB_SLAVE[Number * 0x10000]; | ||||||
|  | 
 | ||||||
| #if defined(CONTROL_ONLY_DEVICE) || defined(ORDERED_EP_CONFIG) | #if defined(CONTROL_ONLY_DEVICE) || defined(ORDERED_EP_CONFIG) | ||||||
| 	Endpoint_SelectEndpoint(Number); | 	Endpoint_SelectEndpoint(Number); | ||||||
| 	Endpoint_EnableEndpoint(); | 	Endpoint_EnableEndpoint(); | ||||||
| 
 | 
 | ||||||
| 	(&AVR32_USBB.uecfg0)[Number] = 0; | 	(&AVR32_USBB.uecfg0)[Number] = 0; | ||||||
| 	(&AVR32_USBB.uecfg0)[Number] = UECFG0Data; | 	(&AVR32_USBB.uecfg0)[Number] = UECFG0Data; | ||||||
| 	USB_EndpointFIFOPos[Number]  = &AVR32_USBB_SLAVE[Number * 0x10000]; |  | ||||||
| 
 | 
 | ||||||
| 	return Endpoint_IsConfigured(); | 	return Endpoint_IsConfigured(); | ||||||
| #else | #else | ||||||
| 	for (uint8_t EPNum = Number; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) | 	for (uint8_t EPNum = Number; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) | ||||||
| 	{ | 	{ | ||||||
| 		uint8_t UECFG0Temp; | 		uint32_t UECFG0Temp; | ||||||
| 
 | 
 | ||||||
| 		Endpoint_SelectEndpoint(EPNum); | 		Endpoint_SelectEndpoint(EPNum); | ||||||
| 		 | 		 | ||||||
| @ -95,7 +96,7 @@ void Endpoint_ClearEndpoints(void) | |||||||
| 		Endpoint_SelectEndpoint(EPNum); | 		Endpoint_SelectEndpoint(EPNum); | ||||||
| 		(&AVR32_USBB.uecfg0)[EPNum]    = 0; | 		(&AVR32_USBB.uecfg0)[EPNum]    = 0; | ||||||
| 		(&AVR32_USBB.uecon0clr)[EPNum] = -1; | 		(&AVR32_USBB.uecon0clr)[EPNum] = -1; | ||||||
| 		USB_EndpointFIFOPos[EPNum]     = &AVR32_USBB_SLAVE[EPNum * 0x10000]; | 		USB_Endpoint_FIFOPos[EPNum]    = &AVR32_USBB_SLAVE[EPNum * 0x10000]; | ||||||
| 		Endpoint_DisableEndpoint(); | 		Endpoint_DisableEndpoint(); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
| @ -47,6 +47,8 @@ bool Pipe_ConfigurePipe(const uint8_t Number, | |||||||
|                         const uint16_t Size, |                         const uint16_t Size, | ||||||
|                         const uint8_t Banks) |                         const uint8_t Banks) | ||||||
| { | { | ||||||
|  | 	USB_Pipe_FIFOPos[Number]     = &AVR32_USBB_SLAVE[Number * 0x10000]; | ||||||
|  | 
 | ||||||
| #if defined(ORDERED_EP_CONFIG) | #if defined(ORDERED_EP_CONFIG) | ||||||
| 	Pipe_SelectPipe(Number); | 	Pipe_SelectPipe(Number); | ||||||
| 	Pipe_EnablePipe(); | 	Pipe_EnablePipe(); | ||||||
| @ -57,7 +59,6 @@ bool Pipe_ConfigurePipe(const uint8_t Number, | |||||||
| 	                                ((uint32_t)Token << AVR32_USBB_PTOKEN_OFFSET) | | 	                                ((uint32_t)Token << AVR32_USBB_PTOKEN_OFFSET) | | ||||||
| 	                                ((uint32_t)Banks << AVR32_USBB_PBK_OFFSET)    | | 	                                ((uint32_t)Banks << AVR32_USBB_PBK_OFFSET)    | | ||||||
| 	                                ((EndpointNumber & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET)); | 	                                ((EndpointNumber & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET)); | ||||||
| 	USB_PipeFIFOPos[Number]      = &AVR32_USBB_SLAVE[Number * 0x10000]; |  | ||||||
| 
 | 
 | ||||||
| 	Pipe_SetInfiniteINRequests(); | 	Pipe_SetInfiniteINRequests(); | ||||||
| 
 | 
 | ||||||
| @ -65,7 +66,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number, | |||||||
| #else | #else | ||||||
| 	for (uint8_t PNum = Number; PNum < PIPE_TOTAL_PIPES; PNum++) | 	for (uint8_t PNum = Number; PNum < PIPE_TOTAL_PIPES; PNum++) | ||||||
| 	{ | 	{ | ||||||
| 		uint8_t UPCFG0Temp; | 		uint32_t UPCFG0Temp; | ||||||
| 
 | 
 | ||||||
| 		Pipe_SelectPipe(PNum); | 		Pipe_SelectPipe(PNum); | ||||||
| 		 | 		 | ||||||
| @ -109,7 +110,7 @@ void Pipe_ClearPipes(void) | |||||||
| 		Pipe_SelectPipe(PNum); | 		Pipe_SelectPipe(PNum); | ||||||
| 		(&AVR32_USBB.upcfg0)[PNum]    = 0; | 		(&AVR32_USBB.upcfg0)[PNum]    = 0; | ||||||
| 		(&AVR32_USBB.upcon0clr)[PNum] = -1; | 		(&AVR32_USBB.upcon0clr)[PNum] = -1; | ||||||
| 		USB_PipeFIFOPos[PNum]         = &AVR32_USBB_SLAVE[PNum * 0x10000]; | 		USB_Pipe_FIFOPos[PNum]        = &AVR32_USBB_SLAVE[PNum * 0x10000]; | ||||||
| 		Pipe_DisablePipe(); | 		Pipe_DisablePipe(); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
| @ -43,7 +43,6 @@ | |||||||
| 
 | 
 | ||||||
| 	/* Includes: */ | 	/* Includes: */ | ||||||
| 		#include "../../../../Common/Common.h" | 		#include "../../../../Common/Common.h" | ||||||
| 		#include "../Endpoint.h" |  | ||||||
| 
 | 
 | ||||||
| 	/* Enable C linkage for C++ Compilers: */ | 	/* Enable C linkage for C++ Compilers: */ | ||||||
| 		#if defined(__cplusplus) | 		#if defined(__cplusplus) | ||||||
| @ -57,6 +56,9 @@ | |||||||
| 
 | 
 | ||||||
| 	/* Private Interface - For use in library only: */ | 	/* Private Interface - For use in library only: */ | ||||||
| 	#if !defined(__DOXYGEN__) | 	#if !defined(__DOXYGEN__) | ||||||
|  | 		/* External Variables: */ | ||||||
|  | 			extern volatile uint32_t USB_Endpoint_SelectedEndpoint; | ||||||
|  | 	 | ||||||
| 		/* Enums: */ | 		/* Enums: */ | ||||||
| 			enum USB_Interrupts_t | 			enum USB_Interrupts_t | ||||||
| 			{ | 			{ | ||||||
| @ -109,7 +111,7 @@ | |||||||
| 						AVR32_USBB.UDINTESET.sofes    = true; | 						AVR32_USBB.UDINTESET.sofes    = true; | ||||||
| 						break; | 						break; | ||||||
| 					case USB_INT_RXSTPI: | 					case USB_INT_RXSTPI: | ||||||
| 						(&AVR32_USBB.UECON0SET)[USB_SelectedEndpoint].rxstpes = true; | 						(&AVR32_USBB.UECON0SET)[USB_Endpoint_SelectedEndpoint].rxstpes = true; | ||||||
| 						break; | 						break; | ||||||
| 					#endif | 					#endif | ||||||
| 					#if defined(USB_CAN_BE_HOST) | 					#if defined(USB_CAN_BE_HOST) | ||||||
| @ -162,7 +164,7 @@ | |||||||
| 						AVR32_USBB.UDINTECLR.sofec    = true; | 						AVR32_USBB.UDINTECLR.sofec    = true; | ||||||
| 						break; | 						break; | ||||||
| 					case USB_INT_RXSTPI: | 					case USB_INT_RXSTPI: | ||||||
| 						(&AVR32_USBB.UECON0CLR)[USB_SelectedEndpoint].rxstpec = true; | 						(&AVR32_USBB.UECON0CLR)[USB_Endpoint_SelectedEndpoint].rxstpec = true; | ||||||
| 						break; | 						break; | ||||||
| 					#endif | 					#endif | ||||||
| 					#if defined(USB_CAN_BE_HOST) | 					#if defined(USB_CAN_BE_HOST) | ||||||
| @ -221,7 +223,7 @@ | |||||||
| 						(void)AVR32_USBB.UDINTCLR; | 						(void)AVR32_USBB.UDINTCLR; | ||||||
| 						break; | 						break; | ||||||
| 					case USB_INT_RXSTPI: | 					case USB_INT_RXSTPI: | ||||||
| 						(&AVR32_USBB.UESTA0CLR)[USB_SelectedEndpoint].rxstpic = true; | 						(&AVR32_USBB.UESTA0CLR)[USB_Endpoint_SelectedEndpoint].rxstpic = true; | ||||||
| 						break; | 						break; | ||||||
| 					#endif | 					#endif | ||||||
| 					#if defined(USB_CAN_BE_HOST) | 					#if defined(USB_CAN_BE_HOST) | ||||||
| @ -274,7 +276,7 @@ | |||||||
| 					case USB_INT_SOFI: | 					case USB_INT_SOFI: | ||||||
| 						return AVR32_USBB.UDINTE.sofe; | 						return AVR32_USBB.UDINTE.sofe; | ||||||
| 					case USB_INT_RXSTPI: | 					case USB_INT_RXSTPI: | ||||||
| 						return (&AVR32_USBB.UECON0)[USB_SelectedEndpoint].rxstpe; | 						return (&AVR32_USBB.UECON0)[USB_Endpoint_SelectedEndpoint].rxstpe; | ||||||
| 					#endif | 					#endif | ||||||
| 					#if defined(USB_CAN_BE_HOST)					 | 					#if defined(USB_CAN_BE_HOST)					 | ||||||
| 					case USB_INT_HSOFI: | 					case USB_INT_HSOFI: | ||||||
| @ -316,7 +318,7 @@ | |||||||
| 					case USB_INT_SOFI: | 					case USB_INT_SOFI: | ||||||
| 						return AVR32_USBB.UDINT.sof; | 						return AVR32_USBB.UDINT.sof; | ||||||
| 					case USB_INT_RXSTPI: | 					case USB_INT_RXSTPI: | ||||||
| 						return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].rxstpi; | 						return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].rxstpi; | ||||||
| 					#endif | 					#endif | ||||||
| 					#if defined(USB_CAN_BE_HOST) | 					#if defined(USB_CAN_BE_HOST) | ||||||
| 					case USB_INT_HSOFI: | 					case USB_INT_HSOFI: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dean Camera
						Dean Camera