rayddteam

Untitled

Dec 5th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. diff -r a7c552e1ed7f head/sys/dev/flash/mx25l.c
  2. --- a/head/sys/dev/flash/mx25l.c Wed Dec 05 12:37:28 2012 +0200
  3. +++ b/head/sys/dev/flash/mx25l.c Wed Dec 05 13:39:08 2012 +0200
  4. @@ -231,7 +231,7 @@
  5. uint8_t txBuf[4];//, rxBuf[4];
  6. uint8_t status;
  7. struct spi_command cmd;
  8. - int err;
  9. + int err, timeout;
  10.  
  11. sc = device_get_softc(dev);
  12.  
  13. @@ -248,7 +248,14 @@
  14.  
  15. status = mx25l_get_status(dev);
  16.  
  17. - if (writable && !(status & STATUS_WEL))
  18. + timeout = 1000;
  19. + while (timeout--) {
  20. + if (writable && (status & STATUS_WEL))
  21. + break;
  22. + if (!writable && !(status & STATUS_WEL))
  23. + break;
  24. + }
  25. + if (timeout == 0)
  26. device_printf(dev, "%s - fail\n", __func__);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment