Skip to content

Commit

Permalink
Add "production" release switch, to enable proper feature set
Browse files Browse the repository at this point in the history
In "production" release the eeprom protection is enabled.
Other features, including bootloader and serial print, are disabled.

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
  • Loading branch information
szszszsz committed Jul 19, 2018
1 parent 3f08c5c commit 14b064e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion firmware/inc/app.h
Expand Up @@ -53,15 +53,26 @@
// comment out this if using bootloader
//#define U2F_USING_BOOTLOADER

// Uncomment this to make configuration firmware
// Uncomment this to make configuration firmware (stage 1 firmware)
//#define ATECC_SETUP_DEVICE

// Uncomment to make a production firmware release, with selected flags
//#define _PRODUCTION_RELEASE

// Touch button test function
//#define __BUTTON_TEST__ // Button drives directly the LED. Minimal required press time is determined by BUTTON_MIN_PRESS_T_MS

//#define U2F_PRINT
//#define U2F_BLINK_ERRORS

#ifdef _PRODUCTION_RELEASE
#undef U2F_PRINT
#undef U2F_BLINK_ERRORS
#undef __BUTTON_TEST__
#undef U2F_USING_BOOTLOADER
#define _SECURE_EEPROM
#endif

// efm8ub1 application eeprom memory mappings
#define U2F_KEY_HEADER_ADDR 0xF800
#define U2F_EEPROM_CONFIG (U2F_KEY_HEADER_ADDR + 128)
Expand Down
2 changes: 2 additions & 0 deletions firmware/src/main.c
Expand Up @@ -73,7 +73,9 @@ static void init(struct APP_DATA* ap)
u2f_hid_init();
smb_init();
atecc_idle();
#ifdef _SECURE_EEPROM
eeprom_init();
#endif

state = APP_NOTHING;
error = ERROR_NOTHING;
Expand Down

0 comments on commit 14b064e

Please sign in to comment.