document updated 7 years ago, on Jan 16, 2017
The read-character routines are:
GETCHAR()
debug_getchar() / debug_scanf()
VirtualCom_ReceiveDataBlocking()
However they're blocking. Is there any way to do a non-blocking version?
examples/frdmkl82z/demo_apps/power_manager_rtos_demo/task_lpm.c has something that might be promising?
/*!
* @brief get input charater.
*
*/
char getInput()
{
char ch;
/* We use GETCHAR() for BM and UART Blocking technic for other RTOS. */
#if (defined FSL_RTOS_BM) || ((defined FSL_RTOS_MQX)&&(MQX_COMMON_CONFIG != MQX_LITE_CONFIG))
ch = GETCHAR();
#else
LPUART_DRV_ReceiveDataBlocking(BOARD_DEBUG_UART_INSTANCE,(uint8_t*)(&ch),1,OSA_WAIT_FOREVER);
#endif // FSL_RTOS_BM
return ch;
}
But in that case both are blocking, right?
Just use the physical buttons! Or if really necessary, plug some additional buttons into the headers.