In the code CAPACITY is compared against number of logical blocks, not number of bytes, so should be expressed as 2GB in 512 blocks. This is how it's done in the F4 code.