DataFlash: fixed a semaphore bug in APM1 dataflash code

This commit is contained in:
Andrew Tridgell 2013-01-08 15:26:34 +11:00 committed by geermc4
parent 8cf4cbf611
commit 44285cfbad

View File

@ -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...