| 
														
															@@ -339,10 +339,13 @@ uint8_t txbuf1[] = "This film came out on DVD yesterday and I rushed to buy it. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		    restoration work will be needed to make the image absolutely perfect. \
 
														 | 
														
														 | 
														
															 		    restoration work will be needed to make the image absolutely perfect. \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		    But let's concentrate on the positive: This film is a summit of visual \
 
														 | 
														
														 | 
														
															 		    But let's concentrate on the positive: This film is a summit of visual \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		    splendour and its sets, costumes, colour photography, composition and lighting \
 
														 | 
														
														 | 
														
															 		    splendour and its sets, costumes, colour photography, composition and lighting \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            achieve, in every single scene, wonders of artistry, creativity and delicacy \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		    But let's concentrate on the positive: This film is a summit of visual \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		    splendour and its sets, costumes, colour photography, composition and lighting \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		    achieve, in every single scene, wonders of artistry, creativity and delicacy \
 
														 | 
														
														 | 
														
															 		    achieve, in every single scene, wonders of artistry, creativity and delicacy \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		    that will probably never be equalled. Suffice it to say that it has, \
 
														 | 
														
														 | 
														
															 		    that will probably never be equalled. Suffice it to say that it has, \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		    among many other treasures, a sunrise duel scene in the snow that still has viewers \
 
														 | 
														
														 | 
														
															 		    among many other treasures, a sunrise duel scene in the snow that still has viewers \
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		    wondering whether it was shot outdoors or in a studio and that will have them wondering forever.\r\n";
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		    wondering whether it was shot outdoors or in a studio and that will have them wondering foreverhsgkhgkshgu.\r\n";
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 uint8_t txbuf2[] = "STM32F4xx SPI Firmware Library Example: communication with an M25P SPI FLASH\r\n";
 
														 | 
														
														 | 
														
															 uint8_t txbuf2[] = "STM32F4xx SPI Firmware Library Example: communication with an M25P SPI FLASH\r\n";
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -353,30 +356,34 @@ uint8_t txbuf2[] = "STM32F4xx SPI Firmware Library Example: communication with a 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 uint8_t  rxbuf1[bufsize1] = {0};
 
														 | 
														
														 | 
														
															 uint8_t  rxbuf1[bufsize1] = {0};
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 uint8_t  rxbuf2[bufsize2] = {0};
 
														 | 
														
														 | 
														
															 uint8_t  rxbuf2[bufsize2] = {0};
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-void spi_flash_test(void) {
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+bool spi_flash_test(void) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	uint16_t i;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     if (!spi_flash_init())
 
														 | 
														
														 | 
														
															     if (!spi_flash_init())
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	return;
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	return false;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     int ret = 0, addr = 0, offset = 0;
 
														 | 
														
														 | 
														
															     int ret = 0, addr = 0, offset = 0;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    for(i = 0; i < spi_flash_desc.sector_count; i ++){
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		//spi_flash_read(i*spi_flash_desc.sector_size, rxbuf1, bufsize1, 0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		spi_flash_erase_sector(i*spi_flash_desc.sector_size,0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		//spi_flash_read(0, rxbuf1, bufsize1, 0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    spi_flash_read(0, rxbuf1, bufsize1, 0);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    spi_flash_erase_sector(0,0);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    spi_flash_read(0, rxbuf1, bufsize1, 0);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    spi_flash_write(addr, txbuf1, bufsize1, 0);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		spi_flash_write(i*spi_flash_desc.sector_size, txbuf1, bufsize1, 0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    memset(rxbuf1, 0, bufsize1);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    spi_flash_read(0, rxbuf1, bufsize1, 0);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		memset(rxbuf1, 0, bufsize1);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		spi_flash_read(i*spi_flash_desc.sector_size, rxbuf1, bufsize1, 0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    if (memcmp(txbuf1, rxbuf1, bufsize1) != 0)
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	return;
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		if (memcmp(txbuf1, rxbuf1, bufsize1) != 0)
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		return false;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    spi_flash_erase_sector(0,0);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    return true;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    /*spi_flash_erase_sector(0,0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     spi_flash_read(0, rxbuf1, bufsize1, 0);
 
														 | 
														
														 | 
														
															     spi_flash_read(0, rxbuf1, bufsize1, 0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     spi_flash_write(0, txbuf2, bufsize2, 0);
 
														 | 
														
														 | 
														
															     spi_flash_write(0, txbuf2, bufsize2, 0);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     memset(rxbuf2, 0, bufsize2);
 
														 | 
														
														 | 
														
															     memset(rxbuf2, 0, bufsize2);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    spi_flash_read(0, rxbuf2, bufsize2, 0);
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    spi_flash_read(0, rxbuf2, bufsize2, 0);*/
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /*
 
														 | 
														
														 | 
														
															 /*
 
														 |