From eadb9515b3c26b74679255ced5bfa2d0a385b0c8 Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen Date: Sun, 5 Sep 2021 00:43:37 +0800 Subject: [PATCH] Cleanups, minor fixes/updates * Removed some unused/noisy debug messages * Declare global variables as static when suitable * Replace more with * plat-msp430: raise instead of toggle the counter GPIO signal, so that detection is more reliable --- common/plat-linux.cpp | 3 +-- common/plat-msp430.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/common/plat-linux.cpp b/common/plat-linux.cpp index cc1357d..a06a0db 100644 --- a/common/plat-linux.cpp +++ b/common/plat-linux.cpp @@ -25,7 +25,7 @@ /* data on NVM, made persistent via mmap() with a file */ uint8_t *nvm; -uint32_t shutdown_counter = UINT32_MAX; +static uint32_t shutdown_counter = UINT32_MAX; static uint64_t nvm_writes = 0; Counters *counters() { @@ -127,7 +127,6 @@ void my_memcpy_ex(void* dest, const void* src, size_t n, uint8_t write_to_nvm) { Model* model = &model_vm; counters()->dma_invocations[model->layer_idx]++; counters()->dma_bytes[model->layer_idx] += n; - // my_printf_debug("%s copied %zu bytes" NEWLINE, __func__, n); // Not using memcpy here so that it is more likely that power fails during // memcpy, which is the case for external FRAM uint8_t *dest_u = reinterpret_cast(dest); diff --git a/common/plat-msp430.cpp b/common/plat-msp430.cpp index b684a87..cd5ef6e 100644 --- a/common/plat-msp430.cpp +++ b/common/plat-msp430.cpp @@ -5,7 +5,7 @@ #elif defined(__MSP432__) #include #endif -#include +#include #include #include "intermittent-cnn.h" #include "cnn_common.h" @@ -109,7 +109,6 @@ void read_from_nvm(void* vm_buffer, uint32_t nvm_offset, size_t n) { SPI_ADDR addr; addr.L = nvm_offset; SPI_READ(&addr, reinterpret_cast(vm_buffer), n); - my_printf_debug("%d words read from NVM offset %d" NEWLINE, n, nvm_offset); } void write_to_nvm(const void* vm_buffer, uint32_t nvm_offset, size_t n, uint16_t timer_delay) { @@ -118,7 +117,6 @@ void write_to_nvm(const void* vm_buffer, uint32_t nvm_offset, size_t n, uint16_t check_nvm_write_address(nvm_offset, n); MY_ASSERT(n <= 1024); SPI_WRITE2(&addr, reinterpret_cast(vm_buffer), n, timer_delay); - my_printf_debug("%d words written to NVM offset %d" NEWLINE, n, nvm_offset); } uint64_t get_nvm_writes(void) {