From 6b3ea6dff94f138ca223a19553683cff969306c7 Mon Sep 17 00:00:00 2001 From: wuyangyong Date: Thu, 25 Feb 2010 16:17:46 +0000 Subject: [PATCH] chage SPI_FLASH timeout git-svn-id: https://rt-thread.googlecode.com/svn/trunk@449 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/stm32_radio/spi_flash.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bsp/stm32_radio/spi_flash.c b/bsp/stm32_radio/spi_flash.c index 2489a1367f..eded43dda4 100644 --- a/bsp/stm32_radio/spi_flash.c +++ b/bsp/stm32_radio/spi_flash.c @@ -1,5 +1,6 @@ #include #include "spi_flash.h" +#include "rtthread.h" extern unsigned char SPI_WriteByte(unsigned char data); @@ -77,13 +78,17 @@ static unsigned char AT45DB_StatusRegisterRead(void) static void wait_busy(void) { unsigned int i=0; - while (i++<2000) + while (i++<3000) { if (AT45DB_StatusRegisterRead()&0x80) { break; } } + if( !(i<3000) ) + { + rt_kprintf("\r\nSPI_FLASH timeout!!!"); + } } static void read_page(unsigned int page,unsigned char * pHeader) -- GitLab