@@ -25,6 +25,10 @@ INCBIN(applet, "applet-mdflash.bin");
25
25
#include "mdloader_common.h"
26
26
#include "mdloader_parser.h"
27
27
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
+
28
32
char verbose ;
29
33
char testmode ;
30
34
char first_device ;
@@ -467,10 +471,6 @@ uint8_t write_user_row(uint32_t* data)
467
471
468
472
uint8_t configure_smarteeprom (void )
469
473
{
470
- // Configure for 2048 bytes - DS60001507E-page 653
471
- #define TARGET_SBLK 1 // 1 block
472
- #define TARGET_PSZ 2 // 16 bytes
473
-
474
474
uint32_t user_row [4 ];
475
475
for (int i = 0 ; i < 4 ; i ++ )
476
476
{
@@ -481,7 +481,7 @@ uint8_t configure_smarteeprom(void)
481
481
482
482
if (verbose ) printf ("SmartEEPROM: config - SBLK: 0x%04x - PSZ: 0x%03x.\n" , puser_row1 -> bit .SBLK , puser_row1 -> bit .PSZ );
483
483
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 )
485
485
{
486
486
if (verbose ) printf ("SmartEEPROM: Configured!\n" );
487
487
return 1 ;
@@ -504,8 +504,8 @@ uint8_t configure_smarteeprom(void)
504
504
}
505
505
506
506
// 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 ;
509
509
return write_user_row (user_row );
510
510
}
511
511
0 commit comments