Skip to content

Commit

Permalink
canary and debug defines
Browse files Browse the repository at this point in the history
  • Loading branch information
ypopovych committed May 1, 2024
1 parent 28ebcfc commit 82c24ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"IO_SEPROXYHAL_BUFFER_SIZE_B=128",
"HAVE_UX_FLOW",
"DEBUG=1",
"DEBUG_BUILD=1",
"HAVE_PRINTF",
"PRINTF=screen_printf",
"_DEFAULT_SOURCE"
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ VARIANT_VALUES = ERGO
# Enabling DEBUG flag will enable PRINTF and disable optimizations
#DEBUG = 1

# Enabling stack canary
HAVE_BOLOS_APP_STACK_CANARY = 1
# Enabling stack canary in debug mode and setting debug flag
ifeq ($(DEBUG), 1)
DEFINES += DEBUG_BUILD=1 HAVE_BOLOS_APP_STACK_CANARY=1
endif

########################################
# Application custom permissions #
Expand Down
2 changes: 1 addition & 1 deletion src/commands/app_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int handler_get_version() {
_Static_assert(PATCH_VERSION >= 0 && PATCH_VERSION <= UINT8_MAX,
"PATCH version must be between 0 and 255!");
uint8_t version[APPVERSION_LEN] = {MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION, 0};
#ifdef HAVE_PRINTF
#ifdef DEBUG_BUILD
version[APPVERSION_LEN - 1] = 1;
#endif

Expand Down

0 comments on commit 82c24ad

Please sign in to comment.