Skip to content

Commit

Permalink
Remove serial debugging saves about 20k
Browse files Browse the repository at this point in the history
  • Loading branch information
jr3cermak committed Jul 22, 2017
1 parent 8314a35 commit 4472730
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
11 changes: 11 additions & 0 deletions localtoolchain/fwtests/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Standard behavior must be included here
SOURCE_PATH=/Users/cermak/Documents/src/fwtests
INCLUDE_DIRS += $(SOURCE_PATH)/$(USRSRC) # add user sources to include path
CPPSRC += $(call target_files,$(USRSRC_SLASH),*.cpp)
CSRC += $(call target_files,$(USRSRC_SLASH),*.c)

APPSOURCES=$(call target_files,$(USRSRC_SLASH),*.cpp)
APPSOURCES+=$(call target_files,$(USRSRC_SLASH),*.c)

# Custom stuff can be added here
INCLUDE_DIRS += $(SOURCE_PATH)/inc
21 changes: 21 additions & 0 deletions localtoolchain/fwtests/src/fwtests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Particle firmware tests
// What structures to we have access to in the Particle firmware.

#include "application.h"

time_t testtime_t;
int runonce = 0;

void setup() {
Serial.begin(9600);

testtime_t = Time.now();

}

void loop() {
if (runonce == 0) {
Serial.printlnf("time_t = %d", testtime_t);
runonce = 1;
}
}
2 changes: 1 addition & 1 deletion localtoolchain/wolfiot/inc/wolfssl/wolfcrypt/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ WOLFSSL_API int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);
#define WOLFSSL_LEAVE(m, r)
#define WOLFSSL_STUB(m)

#define WOLFSSL_MSG(m) Serial.println(m)
#define WOLFSSL_MSG(m)
#define WOLFSSL_BUFFER(b, l)

#endif /* DEBUG_WOLFSSL */
Expand Down
4 changes: 2 additions & 2 deletions localtoolchain/wolfiot/inc/wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ src/aes.cpp:2189: undefined reference to `CRYP_KeyStructInit'
/* #define WOLFSSL_EROAD */

/* Uncomment next line if building for IAR EWARM */
#define WOLFSSL_PARTICLE_ARM
#define WOLFSSL_IAR_ARM
#define TIME_OVERRIDES
#define WOLFSSL_PARTICLE_ARM
// Disable some encryption methods
#define NO_SHA512
#define NO_DSA
Expand All @@ -121,7 +121,7 @@ src/aes.cpp:2189: undefined reference to `CRYP_KeyStructInit'
#define NO_DES3
#define NO_OLD_TLS
#define NO_SESSION_CACHE
#define USE_CERT_BUFFERS_1024
//#define USE_CERT_BUFFERS_1024

/* Uncomment next line if building for Rowley CrossWorks ARM */
/* #define WOLFSSL_ROWLEY_ARM */
Expand Down
2 changes: 2 additions & 0 deletions localtoolchain/wolfiot/src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static void wolfssl_log(const int logLevel, const char *const logMessage)
if (loggingEnabled) {
#ifdef THREADX
dc_log_printf("%s\n", logMessage);
#elif defined(WOLFSSL_PARTICLE_ARM)
Serial.println(logMessage);
#elif defined(MICRIUM)
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
NetSecure_TraceOut((CPU_CHAR *)logMessage);
Expand Down

0 comments on commit 4472730

Please sign in to comment.