Browse Source

DataFlash: fixed a semaphore bug in APM1 dataflash code

master
Andrew Tridgell 12 years ago committed by geermc4
parent
commit
44285cfbad
  1. 3
      libraries/DataFlash/DataFlash_APM1.cpp

3
libraries/DataFlash/DataFlash_APM1.cpp

@ -166,9 +166,10 @@ uint16_t DataFlash_APM1::PageSize() @@ -166,9 +166,10 @@ uint16_t DataFlash_APM1::PageSize()
if (!_spi_sem->take(5))
return 0;
return(528-((ReadStatusReg()&0x01) << 4)); // if first bit 1 trhen 512 else 528 bytes
uint16_t ret = 528-((ReadStatusReg()&0x01) << 4); // if first bit 1 trhen 512 else 528 bytes
_spi_sem->give();
return ret;
}
// Wait until DataFlash is in ready state...

Loading…
Cancel
Save