Skip to content
Permalink
Browse files
messages: fix size of msg_tiny and add static_assert
  • Loading branch information
jhoenicke authored and prusnak committed Mar 20, 2018
1 parent 559a700 commit d6f41dba9e41ba49780878dadf157939d2eeb101
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
@@ -314,7 +314,16 @@ const uint8_t *msg_debug_out_data(void)

#endif

CONFIDENTIAL uint8_t msg_tiny[64];
CONFIDENTIAL uint8_t msg_tiny[128];
_Static_assert(sizeof(msg_tiny) >= sizeof(Cancel), "msg_tiny too tiny");
_Static_assert(sizeof(msg_tiny) >= sizeof(Initialize), "msg_tiny too tiny");
_Static_assert(sizeof(msg_tiny) >= sizeof(PassphraseAck), "msg_tiny too tiny");
_Static_assert(sizeof(msg_tiny) >= sizeof(ButtonAck), "msg_tiny too tiny");
_Static_assert(sizeof(msg_tiny) >= sizeof(PinMatrixAck), "msg_tiny too tiny");
#if DEBUG_LINK
_Static_assert(sizeof(msg_tiny) >= sizeof(DebugLinkDecision), "msg_tiny too tiny");
_Static_assert(sizeof(msg_tiny) >= sizeof(DebugLinkGetState), "msg_tiny too tiny");
#endif
uint16_t msg_tiny_id = 0xFFFF;

void msg_read_tiny(const uint8_t *buf, int len)
@@ -47,7 +47,7 @@ bool msg_write_common(char type, uint16_t msg_id, const void *msg_ptr);

void msg_read_tiny(const uint8_t *buf, int len);
void msg_debug_read_tiny(const uint8_t *buf, int len);
extern uint8_t msg_tiny[64];
extern uint8_t msg_tiny[128];
extern uint16_t msg_tiny_id;

#endif

0 comments on commit d6f41db

Please sign in to comment.