Skip to content

Commit

Permalink
Sync files across demos
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Smith committed Jul 30, 2024
1 parent e845593 commit 491597f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/uart_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ void HAL_UART_MspInit(UART_HandleTypeDef *uart) {
* @param buffer: Source string.
* @param length: String character count.
*/
void log_uart_output(char* buffer) {
void log_uart_output(const char* buffer) {

static char uart_buffer[UART_LOG_TIMESTAMP_MAX_LEN_B + LOG_MESSAGE_MAX_LEN_B + 3] = {0};
static char uart_buffer[UART_LOG_TIMESTAMP_MAX_LEN_B + UART_LOG_MESSAGE_MAX_LEN_B + 3] = {0};

uint64_t usec = 0;
time_t sec = 0;
Expand All @@ -102,7 +102,7 @@ void log_uart_output(char* buffer) {
strftime(uart_buffer, 64, "%F %T.XXX ", gmtime(&sec));
// Insert the millisecond time over the XXX
sprintf(&uart_buffer[20], "%03u ", (unsigned)(msec % 1000));
uint32_t length = strlen(uart_buffer);
const uint32_t length = strlen(uart_buffer);

// Write the timestamp to the message
sprintf(&uart_buffer[length], "%s\n", buffer);
Expand Down
4 changes: 2 additions & 2 deletions app/uart_logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* CONSTANTS
*/
#define UART_LOG_TIMESTAMP_MAX_LEN_B 64
#define UART_LOG_MESSAGE_MAX_LEN_B 64
#define UART_LOG_MESSAGE_MAX_LEN_B 1024


#ifdef __cplusplus
Expand All @@ -26,7 +26,7 @@ extern "C" {
* PROTOTYPES
*/
bool log_uart_init(void);
void log_uart_output(char* buffer);
void log_uart_output(const char* buffer);


#ifdef __cplusplus
Expand Down

0 comments on commit 491597f

Please sign in to comment.