added cli support

This commit is contained in:
hathach
2013-09-24 21:04:56 +07:00
parent bbfa85aa08
commit bd9af2d57b
9 changed files with 324 additions and 59 deletions

View File

@@ -103,9 +103,11 @@ int __sys_readc (void)
#elif defined __CC_ARM // keil
#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
#define retarget_putc(c) board_uart_send( (uint8_t*) &c, 1);
#define retarget_putc(c) board_uart_send( (uint8_t*) &c, 1);
#define retarget_getchar() board_uart_getchar()
#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
#define retarget_putc(c) ITM_SendChar(c)
#define retarget_putc(c) ITM_SendChar(c)
#define retarget_getchar() ITM_ReceiveChar()
#else
#error Thach, did you forget something
#endif
@@ -116,6 +118,11 @@ struct __FILE {
uint32_t handle;
};
int fgetc(FILE *f)
{
return retarget_getchar();
}
int fputc(int ch, FILE *f)
{
if (//CFG_PRINTF_NEWLINE[0] == '\r' &&