Skip to content

Commit

Permalink
cleanup serial output
Browse files Browse the repository at this point in the history
  • Loading branch information
rafguevara14 committed Mar 3, 2023
1 parent f0a5803 commit 50ef137
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 0 additions & 4 deletions VCU/Phantom/Drivers/STATE_MACHINE/state_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ void NotifyStateMachine(eCarEvents event)

void NotifyStateMachineFromISR(eCarEvents event)
{
char buffer[32];
sprintf(buffer, "Event occurred: %d", event);
LogFromISR(UWHT, buffer);

HandleEventFromISR(UpdateStateMachine, event);
}

Expand Down
1 change: 1 addition & 0 deletions VCU/Phantom/Drivers/UART/Phantom_sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ void GetRuntimeStatistics(void* x)
char ptrTaskList[TASK_LIST_SIZE];
vTaskList(ptrTaskList);

UARTprintln("\n");
UARTSend(PC_UART, ptrTaskList);
UARTprintln("\r");
}
Expand Down
6 changes: 3 additions & 3 deletions VCU/Phantom/tasks/source/task_logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static uint8_t LogMessage(const char* color, const char* str, eSource source)

// queue strings to reset console position and format
char buffer[16];
sprintf(buffer, "%s\n", reset);
sprintf(buffer, "%s\n\r", reset);

return AsyncPrint(source, buffer);
}
Expand Down Expand Up @@ -165,7 +165,7 @@ uint8_t AsyncPrint(eSource source, const char* str)
{
/* Initialize tmp to copy segments into */
segment_t tmp;
memset(&tmp, ' ', SEGMENT_SIZE);
memset(&tmp, '\0', SEGMENT_SIZE);

uint16_t total_num_bytes = strlen(str);
uint8_t num_segments = total_num_bytes/SEGMENT_SIZE;
Expand All @@ -185,7 +185,7 @@ uint8_t AsyncPrint(eSource source, const char* str)
/* Queue remaining segments */
if (bytes_left != 0)
{
memset(&tmp, ' ', SEGMENT_SIZE);
memset(&tmp, '\0', SEGMENT_SIZE);
memcpy(&tmp, str + (segment_index*SEGMENT_SIZE), bytes_left);

QueueSegment(source, tmp);
Expand Down

0 comments on commit 50ef137

Please sign in to comment.