Skip to content

Commit 7f7e868

Browse files
committed
Move defines out of function
1 parent 50c2806 commit 7f7e868

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mdloader_common.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ INCBIN(applet, "applet-mdflash.bin");
2525
#include "mdloader_common.h"
2626
#include "mdloader_parser.h"
2727

28+
// Configure for 2048 bytes - DS60001507E-page 653
29+
#define SMARTEEPROM_TARGET_SBLK 1 // 1 block
30+
#define SMARTEEPROM_TARGET_PSZ 2 // 16 bytes
31+
2832
char verbose;
2933
char testmode;
3034
char first_device;
@@ -467,10 +471,6 @@ uint8_t write_user_row(uint32_t* data)
467471

468472
uint8_t configure_smarteeprom(void)
469473
{
470-
// Configure for 2048 bytes - DS60001507E-page 653
471-
#define TARGET_SBLK 1 // 1 block
472-
#define TARGET_PSZ 2 // 16 bytes
473-
474474
uint32_t user_row[4];
475475
for (int i = 0; i < 4; i++)
476476
{
@@ -481,7 +481,7 @@ uint8_t configure_smarteeprom(void)
481481

482482
if (verbose) printf("SmartEEPROM: config - SBLK: 0x%04x - PSZ: 0x%03x.\n", puser_row1->bit.SBLK, puser_row1->bit.PSZ);
483483

484-
if(puser_row1->bit.SBLK == TARGET_SBLK && puser_row1->bit.PSZ == TARGET_PSZ)
484+
if(puser_row1->bit.SBLK == SMARTEEPROM_TARGET_SBLK && puser_row1->bit.PSZ == SMARTEEPROM_TARGET_PSZ)
485485
{
486486
if (verbose) printf("SmartEEPROM: Configured!\n");
487487
return 1;
@@ -504,8 +504,8 @@ uint8_t configure_smarteeprom(void)
504504
}
505505

506506
// Set SmartEEPROM Virtual Size.
507-
puser_row1->bit.SBLK = TARGET_SBLK;
508-
puser_row1->bit.PSZ = TARGET_PSZ;
507+
puser_row1->bit.SBLK = SMARTEEPROM_TARGET_SBLK;
508+
puser_row1->bit.PSZ = SMARTEEPROM_TARGET_PSZ;
509509
return write_user_row(user_row);
510510
}
511511

0 commit comments

Comments
 (0)