Merge pull request #1481 from cr1901/msp430-misopt-fix
msp430x5xx: Add fix for possible bug in msp430-elf-gcc 9.3.0.
This commit is contained in:
		@@ -631,7 +631,18 @@ void dcd_int_handler(uint8_t rhport)
 | 
			
		||||
    handle_setup_packet();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  uint16_t curr_vector = USBVECINT;
 | 
			
		||||
  // Workaround possible bug in MSP430 GCC 9.3.0 where volatile variable
 | 
			
		||||
  // USBVECINT is read from twice when only once is intended. The second
 | 
			
		||||
  // (garbage) read seems to be triggered by certain switch statement
 | 
			
		||||
  // configurations.
 | 
			
		||||
  uint16_t curr_vector;
 | 
			
		||||
  #if __GNUC__ > 9 || (__GNUC__ == 9 && __GNUC_MINOR__ > 2)
 | 
			
		||||
    asm volatile ("mov %1, %0"
 | 
			
		||||
                  : "=r" (curr_vector)
 | 
			
		||||
                  : "m" (USBVECINT));
 | 
			
		||||
  #else
 | 
			
		||||
    curr_vector = USBVECINT;
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  switch(curr_vector)
 | 
			
		||||
  {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user