Make the VirtualFAT firmware file read from device flash when opened by the host in the incomplete Mass Storage class bootloader.
This commit is contained in:
		
							parent
							
								
									d5d9ff73e5
								
							
						
					
					
						commit
						63e1fc6e6c
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -138,8 +138,10 @@ static void ReadBlock(const uint16_t BlockNumber)
 | 
			
		|||
		default:
 | 
			
		||||
			if ((BlockNumber >= 4) && (BlockNumber < (4 + (FIRMWARE_FILE_SIZE / SECTOR_SIZE_BYTES))))
 | 
			
		||||
			{
 | 
			
		||||
				for (uint16_t i = 0; i < 512; i++)
 | 
			
		||||
				  BlockBuffer[i] = 'A' + (i % 26);
 | 
			
		||||
				uint32_t ReadFlashAddress = (uint32_t)(BlockNumber - 4) * SECTOR_SIZE_BYTES;
 | 
			
		||||
 | 
			
		||||
				for (uint16_t i = 0; i < SECTOR_SIZE_BYTES; i++)
 | 
			
		||||
				  BlockBuffer[i] = pgm_read_byte_far(ReadFlashAddress++);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue