mirror of
https://github.com/armink/FlashDB.git
synced 2025-01-29 04:32:53 +08:00
[fdb] Improve FDB_ALIGN_DOWN macro. The align input parameter NOT depends on 2^N align number.
This commit is contained in:
parent
5ebf8e6e8f
commit
cb84e2c41d
@ -36,7 +36,7 @@
|
||||
* Return the down number of aligned at specified width. RT_ALIGN_DOWN(13, 4)
|
||||
* would return 12.
|
||||
*/
|
||||
#define FDB_ALIGN_DOWN(size, align) ((size) & ~((align) - 1))
|
||||
#define FDB_ALIGN_DOWN(size, align) (((size) / (align)) * (align))
|
||||
/* align down by write granularity */
|
||||
#define FDB_WG_ALIGN_DOWN(size) (FDB_ALIGN_DOWN(size, (FDB_WRITE_GRAN + 7)/8))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user