static void prvCheckForKeyPresses( void ) { #ifdef USE_STDIO short sIn; taskENTER_CRITICAL(); sIn = kbhit(); taskEXIT_CRITICAL(); if( sIn ) { unsigned long ulBufferLength; /* Key presses can be used to start/stop the trace utility, or end the program. */ sIn = getch(); switch( sIn ) { /* Only define keys for turning on and off the trace if the trace is being used. */ #if configUSE_TRACE_FACILITY == 1 case 't' : vTaskList( pcWriteBuffer ); vWriteMessageToDisk( pcWriteBuffer ); break; /* The legacy trace is no longer supported. Use FreeRTOS+Trace instead. case 's' : vTaskStartTrace( pcWriteBuffer, mainDEBUG_LOG_BUFFER_SIZE ); break; case 'e' : ulBufferLength = ulTaskEndTrace(); vWriteBufferToDisk( pcWriteBuffer, ulBufferLength ); break;*/ #endif default : vTaskEndScheduler(); break; } } #else ( void ) pcWriteBuffer; #endif }
static void prvCheckForKeyPresses( void ) { short sIn; taskENTER_CRITICAL(); #ifdef DEBUG_BUILD /* kbhit can be used in .exe's that are executed from the command line, but not if executed through the debugger. */ sIn = 0; #else sIn = kbhit(); #endif taskEXIT_CRITICAL(); if( sIn ) { /* Key presses can be used to start/stop the trace utility, or end the program. */ sIn = getch(); switch( sIn ) { /* Only define keys for turning on and off the trace if the trace is being used. */ #if configUSE_TRACE_FACILITY == 1 case 't' : vTaskList( pcWriteBuffer ); vWriteMessageToDisk( pcWriteBuffer ); break; /* The legacy trace is no longer supported. Use FreeRTOS+Trace instead case 's' : vTaskStartTrace( pcWriteBuffer, mainDEBUG_LOG_BUFFER_SIZE ); break; case 'e' : { unsigned long ulBufferLength; ulBufferLength = ulTaskEndTrace(); vWriteBufferToDisk( pcWriteBuffer, ulBufferLength ); } break; */ #endif default : vTaskEndScheduler(); break; } } }