unsigned short NandFlashModel_GetDeviceSizeInBlocks(const struct NandFlashModel *model) { #if !defined(OP_BOOTSTRAP_on) return ((1024) / model->blockSizeInKBytes) * model->deviceSizeInMegaBytes; #else unsigned int pow; pow = CALPOW((1024 * model->deviceSizeInMegaBytes), model->blockSizeInKBytes); return (0x1 << pow); #endif }