Fix logging issue causing mangled new lines (#391)

* Fix logging issue caused by using \n as the default newline character

* Update the other demos

* Fix accidentally changed NETWORK_INTERFACE

* Set \r\n as default instead

* Update sources to reflect \r\n change

* Get rid of configLOGGING_NEW_LINE altogether

Co-authored-by: abhidixi11 <44424462+abhidixi11@users.noreply.github.com>
This commit is contained in:
Oscar Michael Abrina 2020-11-08 21:27:53 -08:00 committed by GitHub
parent 54d549cd0e
commit 52d7c47cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 238 additions and 278 deletions

View file

@ -187,11 +187,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */

View file

@ -286,7 +286,7 @@ void vLoggingPrintf( const char * pcFormat,
pcTaskName = pcNoTask; pcTaskName = pcNoTask;
} }
if( strcmp( pcFormat, "\n" ) != 0 ) if( strcmp( pcFormat, "\r\n" ) != 0 )
{ {
xLength = snprintf( cPrintString, dlMAX_PRINT_STRING_LENGTH, "%lu %lu [%s] ", xLength = snprintf( cPrintString, dlMAX_PRINT_STRING_LENGTH, "%lu %lu [%s] ",
xMessageNumber++, xMessageNumber++,

View file

@ -153,11 +153,11 @@ int main( void )
* vApplicationIPNetworkEventHook() below). The address values passed in here * vApplicationIPNetworkEventHook() below). The address values passed in here
* are used if ipconfigUSE_DHCP is set to 0, or if ipconfigUSE_DHCP is set to 1 * are used if ipconfigUSE_DHCP is set to 0, or if ipconfigUSE_DHCP is set to 1
* but a DHCP server cannot be contacted. */ * but a DHCP server cannot be contacted. */
FreeRTOS_debug_printf( ( "FreeRTOS_IPInit\n" ) ); FreeRTOS_debug_printf( ( "FreeRTOS_IPInit\r\n" ) );
FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress ); FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
/* Start the RTOS scheduler. */ /* Start the RTOS scheduler. */
FreeRTOS_debug_printf( ( "vTaskStartScheduler\n" ) ); FreeRTOS_debug_printf( ( "vTaskStartScheduler\r\n" ) );
vTaskStartScheduler(); vTaskStartScheduler();
/* If all is well, the scheduler will now be running, and the following /* If all is well, the scheduler will now be running, and the following
@ -196,7 +196,7 @@ void vAssertCalled( const char * pcFile,
( void ) pcFileName; ( void ) pcFileName;
( void ) ulLineNumber; ( void ) ulLineNumber;
FreeRTOS_debug_printf( ( "vAssertCalled( %s, %ld\n", pcFile, ulLine ) ); FreeRTOS_debug_printf( ( "vAssertCalled( %s, %ld\r\n", pcFile, ulLine ) );
/* Setting ulBlockVariable to a non-zero value in the debugger will allow /* Setting ulBlockVariable to a non-zero value in the debugger will allow
* this function to be exited. */ * this function to be exited. */
@ -307,9 +307,9 @@ static void prvMiscInitialisation( void )
/* Seed the random number generator. */ /* Seed the random number generator. */
time( &xTimeNow ); time( &xTimeNow );
FreeRTOS_debug_printf( ( "Seed for randomiser: %lu\n", xTimeNow ) ); FreeRTOS_debug_printf( ( "Seed for randomiser: %lu\r\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow ); prvSRand( ( uint32_t ) xTimeNow );
FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) ); FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\r\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/

View file

@ -187,11 +187,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */

View file

@ -189,11 +189,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */

View file

@ -189,11 +189,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */

View file

@ -187,11 +187,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */

View file

@ -189,11 +189,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */

View file

@ -189,11 +189,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */

View file

@ -187,11 +187,6 @@
/* The UDP port to which print messages are sent. */ /* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 ) #define configPRINT_PORT ( 15000 )
/* Task pool definitions for the demos of IoT Libraries. */
#define configTASKPOOL_ENABLE_ASSERTS 1
#define configTASKPOOL_NUMBER_OF_WORKERS 1
#define configTASKPOOL_WORKER_PRIORITY tskIDLE_PRIORITY
#define configTASKPOOL_WORKER_STACK_SIZE_BYTES 2048
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) ) #if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */ /* Map to Windows names. */