fixed the mismatch of device definitions in rtdef.h and finsh shell; add line comment in finsh shell.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2136 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2012-05-30 02:42:26 +00:00
parent 2c82d4945b
commit e86bd68278
3 changed files with 15 additions and 5 deletions

View File

@ -357,6 +357,7 @@ static long _list_device(struct rt_list_node *list)
"RTC", "RTC",
"Sound Device", "Sound Device",
"Graphic Device", "Graphic Device",
"I2C Bus",
"I2C Device", "I2C Device",
"USB Slave Device", "USB Slave Device",
"USB Host Bus", "USB Host Bus",
@ -401,12 +402,10 @@ int list_module(void)
for (node = list->next; node != list; node = node->next) for (node = list->next; node != list; node = node->next)
{ {
module = (struct rt_module*)(rt_list_entry(node, struct rt_object, list)); module = (struct rt_module*)(rt_list_entry(node, struct rt_object, list));
rt_kprintf("%-16s ", module->parent.name); rt_kprintf("%-16.*s %-04d\n", RT_NAME_MAX, module->parent.name, module->nref);
rt_kprintf("%-04d \n", module->nref);
} }
return 0; return 0;
} }
FINSH_FUNCTION_EXPORT(list_module, list module in system) FINSH_FUNCTION_EXPORT(list_module, list module in system)

View File

@ -207,7 +207,17 @@ static void token_run(struct finsh_token* self)
break; break;
case '/': case '/':
ch = token_next_char(self);
if (ch == '/')
{
/* line comments, set to end of file */
self->current_token = finsh_token_type_eof;
}
else
{
token_prev_char(self);
self->current_token = finsh_token_type_div; self->current_token = finsh_token_type_div;
}
break; break;
case '<': case '<':

View File

@ -36,6 +36,7 @@ enum finsh_token_type
finsh_token_type_bitwise, /* ~ */ finsh_token_type_bitwise, /* ~ */
finsh_token_type_shl, /* << */ finsh_token_type_shl, /* << */
finsh_token_type_shr, /* >> */ finsh_token_type_shr, /* >> */
finsh_token_type_comments, /* // */
/*-- data type --*/ /*-- data type --*/
finsh_token_type_void, /* void */ finsh_token_type_void, /* void */
finsh_token_type_char, /* char */ finsh_token_type_char, /* char */