Use macros where possible

Apply `constrain`, `NOMORE`, `NOLESS` and `CRITICAL_SECTION` macros
wherever possible.
This commit is contained in:
Scott Lahteine
2016-02-21 22:17:32 -08:00
parent c8f76bb8aa
commit 209f5f21e0
8 changed files with 21 additions and 31 deletions

View File

@ -296,7 +296,7 @@ int32_t SdVolume::freeClusterCount() {
for (uint32_t lba = fatStartBlock_; todo; todo -= n, lba++) {
if (!cacheRawBlock(lba, CACHE_FOR_READ)) return -1;
if (todo < n) n = todo;
NOMORE(n, todo);
if (fatType_ == 16) {
for (uint16_t i = 0; i < n; i++) {
if (cacheBuffer_.fat16[i] == 0) free++;