Skip to content

Commit 717651e

Browse files
author
Rohit Grover
committed
add better comments to the #if blocks guarding KSDK2 support
1 parent 0bbac41 commit 717651e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K64F/storage_driver.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const uint8_t *currentOperatingData;
156156
#define OPTIMAL_PROGRAM_UNIT (1024UL)
157157
#define PROGRAM_PHRASE_SIZEOF_INLINE_DATA (8)
158158
#define SIZEOF_DOUBLE_PHRASE (FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT)
159-
#else
159+
#else /* ifdef USING_KSDK2 */
160160
#define ERASE_UNIT (4096)
161161
#define BLOCK1_START_ADDR (0x80000UL)
162162
#define BLOCK1_SIZE (0x80000UL)
@@ -288,9 +288,9 @@ static inline bool failedWithAccessError(void)
288288

289289
/* checking access error */
290290
return registerValue & FTFx_FSTAT_ACCERR_MASK;
291-
#else
291+
#else /* ifdef USING_KSDK2 */
292292
return BR_FTFE_FSTAT_ACCERR(FTFE);
293-
#endif
293+
#endif /* ifdef USING_KSDK2 */
294294
}
295295

296296
static inline bool failedWithProtectionError()
@@ -301,9 +301,9 @@ static inline bool failedWithProtectionError()
301301

302302
/* checking protection error */
303303
return registerValue & FTFx_FSTAT_FPVIOL_MASK;
304-
#else
304+
#else /* ifdef USING_KSDK2 */
305305
return BR_FTFE_FSTAT_FPVIOL(FTFE);
306-
#endif
306+
#endif /* ifdef USING_KSDK2 */
307307
}
308308

309309
static inline bool failedWithRunTimeError()
@@ -314,9 +314,9 @@ static inline bool failedWithRunTimeError()
314314

315315
/* checking MGSTAT0 non-correctable error */
316316
return registerValue & FTFx_FSTAT_MGSTAT0_MASK;
317-
#else
317+
#else /* ifdef USING_KSDK2 */
318318
return BR_FTFE_FSTAT_MGSTAT0(FTFE);
319-
#endif
319+
#endif /* ifdef USING_KSDK2 */
320320
}
321321

322322
static inline void clearAccessError(void)
@@ -415,7 +415,7 @@ static inline void setupAddressInCCOB123(uint64_t addr)
415415
BW_FTFE_FCCOB2_CCOBn((uintptr_t)FTFE, (addr >> 8) & 0xFFUL); /* bits [15:8] of the address. */
416416
BW_FTFE_FCCOB3_CCOBn((uintptr_t)FTFE, (addr >> 0) & 0xFFUL); /* bits [7:0] of the address. */
417417
}
418-
#endif
418+
#endif /* ifndef USING_KSDK2 */
419419

420420
static inline void setupEraseSector(uint64_t addr)
421421
{
@@ -446,7 +446,7 @@ static inline void setup8ByteWrite(uint64_t addr, const void *data)
446446
/* Program 8 bytes of data into FCCOB(4..11)_CCOBn */
447447
kFCCOBx[1] = ((const uint32_t *)data)[0];
448448
kFCCOBx[2] = ((const uint32_t *)data)[1];
449-
#else
449+
#else /* ifdef USING_KSDK2 */
450450
BW_FTFE_FCCOB0_CCOBn((uintptr_t)FTFE, PGM8);
451451
setupAddressInCCOB123(addr);
452452

@@ -458,7 +458,7 @@ static inline void setup8ByteWrite(uint64_t addr, const void *data)
458458
BW_FTFE_FCCOB9_CCOBn((uintptr_t)FTFE, ((const uint8_t *)data)[6]); /* byte 6 of program value. */
459459
BW_FTFE_FCCOBA_CCOBn((uintptr_t)FTFE, ((const uint8_t *)data)[5]); /* byte 5 of program value. */
460460
BW_FTFE_FCCOBB_CCOBn((uintptr_t)FTFE, ((const uint8_t *)data)[4]); /* byte 4 of program value. */
461-
#endif
461+
#endif /* ifdef USING_KSDK2 */
462462
}
463463

464464
static inline void setupProgramSection(uint64_t addr, const void *data, size_t cnt)
@@ -469,7 +469,7 @@ static inline void setupProgramSection(uint64_t addr, const void *data, size_t c
469469

470470
kFCCOBx[0] = BYTES_JOIN_TO_WORD_1_3(PGMSEC, addr);
471471
kFCCOBx[1] = BYTES_JOIN_TO_WORD_2_2(cnt >> 4, 0xFFFFU);
472-
#else
472+
#else /* ifdef USING_KSDK2 */
473473
static const uintptr_t FlexRAMBase = 0x14000000;
474474
memcpy((void *)FlexRAMBase, (const uint8_t *)data, cnt);
475475

@@ -478,7 +478,7 @@ static inline void setupProgramSection(uint64_t addr, const void *data, size_t c
478478

479479
BW_FTFE_FCCOB4_CCOBn((uintptr_t)FTFE, ((((uint32_t)(cnt >> 4)) & (0x0000FF00)) >> 8)); /* number of 128-bits to program [15:8] */
480480
BW_FTFE_FCCOB5_CCOBn((uintptr_t)FTFE, (((uint32_t)(cnt >> 4)) & (0x000000FF))); /* number of 128-bits to program [7:0] */
481-
#endif
481+
#endif /* ifdef USING_KSDK2 */
482482
}
483483

484484
/**
@@ -760,7 +760,7 @@ static int32_t initialize(ARM_Storage_Callback_t callback)
760760
if (rc != kStatus_FLASH_Success) {
761761
return ARM_DRIVER_ERROR;
762762
}
763-
#endif
763+
#endif /* ifdef USING_KSDK2 */
764764

765765
if (controllerCurrentlyBusy()) {
766766
/* The user cannot initiate any further FTFE commands until notified that the

0 commit comments

Comments
 (0)