This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220S-LAUNCHXL: How to Edit and Rebuild SDK

Part Number: CC3220S-LAUNCHXL

I would like to use Display_vprintf(...) without a new line being inserted automatatically at the end.

  1. I want to able to print single hex values received from serial and see them all on one line.
  2. I want to add the debug level to the front of each log.

When I tried editing DisplayUart2Min_vprintf(...) in DisplayUart2.c, it didn't seem to work, and I tried cleaning and rebuilding the project. How can I accomplish my goal by either editing the SDK file or using another function? NOTE: I know I could call UART2_write() directly but I don't want to risk the semaphores of DisplayUart2Min_vprintf(...)

// An examaple adding the log level to the debug log.
void log_debug(const char *format, ...) {
  va_list args;
  va_start(args, format);
  Display_printf(display_vcom_handle, 0, 0, "Debug:   ");
  Display_vprintf(display_vcom_handle, 0, 0, message, args);
  va_end(args);
}

// SDK file I want to change. I tried commenting out '\r' anad '\n' but it didn't work
// hwAttrs->strBuf[strSize++] = '\r';
// hwAttrs->strBuf[strSize++] = '\n';
void DisplayUart2Min_vprintf(Display_Handle hDisplay, uint8_t line,
                             uint8_t column, const char *fmt, va_list va)
{
    DisplayUart2_Object  *object  = (DisplayUart2_Object  *)hDisplay->object;
    DisplayUart2_HWAttrs *hwAttrs = (DisplayUart2_HWAttrs *)hDisplay->hwAttrs;

    uint32_t strSize = 0;

    if (SemaphoreP_pend(object->mutex, hwAttrs->mutexTimeout) == SemaphoreP_OK)
    {
        SystemP_vsnprintf(hwAttrs->strBuf, hwAttrs->strBufLen - 2, fmt, va);

        strSize = strlen(hwAttrs->strBuf);
        hwAttrs->strBuf[strSize++] = '\r';
        hwAttrs->strBuf[strSize++] = '\n';

        UART2_write(object->hUart, hwAttrs->strBuf, strSize, NULL);
        SemaphoreP_post(object->mutex);
    }
}