Change the const prefix to right position.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2294 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
4d4c33680a
commit
b07bd9b030
|
@ -1,14 +1,14 @@
|
||||||
Import('rtconfig')
|
Import('rtconfig')
|
||||||
from building import *
|
from building import *
|
||||||
|
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
src = Glob('*.c')
|
src = Glob('*.c')
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
if rtconfig.CROSS_TOOL == 'keil':
|
if rtconfig.CROSS_TOOL == 'keil':
|
||||||
LINKFLAGS = ' --keep __fsym_* --keep __vsym_* '
|
LINKFLAGS = ' --keep __fsym_* --keep __vsym_* '
|
||||||
else:
|
else:
|
||||||
LINKFLAGS = ''
|
LINKFLAGS = ''
|
||||||
|
|
||||||
group = DefineGroup('finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS)
|
group = DefineGroup('finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -376,7 +376,7 @@ static long _list_device(struct rt_list_node *list)
|
||||||
{
|
{
|
||||||
struct rt_device *device;
|
struct rt_device *device;
|
||||||
struct rt_list_node *node;
|
struct rt_list_node *node;
|
||||||
const char *device_type_str[] =
|
char * const device_type_str[] =
|
||||||
{
|
{
|
||||||
"Character Device",
|
"Character Device",
|
||||||
"Block Device",
|
"Block Device",
|
||||||
|
@ -385,7 +385,7 @@ static long _list_device(struct rt_list_node *list)
|
||||||
"CAN Device",
|
"CAN Device",
|
||||||
"RTC",
|
"RTC",
|
||||||
"Sound Device",
|
"Sound Device",
|
||||||
"Graphic Device",
|
"Graphic Device",
|
||||||
"I2C Bus",
|
"I2C Bus",
|
||||||
"USB Slave Device",
|
"USB Slave Device",
|
||||||
"USB Host Bus",
|
"USB Host Bus",
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
u_char global_errno;
|
u_char global_errno;
|
||||||
|
|
||||||
static const char* finsh_error_string_table[] =
|
static const char * finsh_error_string_table[] =
|
||||||
{
|
{
|
||||||
"No error",
|
"No error",
|
||||||
"Invalid token",
|
"Invalid token",
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include "finsh_var.h"
|
#include "finsh_var.h"
|
||||||
|
|
||||||
ALIGN(RT_ALIGN_SIZE)
|
ALIGN(RT_ALIGN_SIZE)
|
||||||
u_char finsh_heap[FINSH_HEAP_MAX];
|
u_char finsh_heap[FINSH_HEAP_MAX];
|
||||||
struct finsh_block_header
|
struct finsh_block_header
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,80 +1,80 @@
|
||||||
/*
|
/*
|
||||||
* File : shell.h
|
* File : shell.h
|
||||||
* This file is part of RT-Thread RTOS
|
* This file is part of RT-Thread RTOS
|
||||||
* COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team
|
* COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
||||||
* http://www.rt-thread.org/license/LICENSE
|
* http://www.rt-thread.org/license/LICENSE
|
||||||
*
|
*
|
||||||
* Change Logs:
|
* Change Logs:
|
||||||
* Date Author Notes
|
* Date Author Notes
|
||||||
* 2011-06-02 Bernard Add finsh_get_prompt function declaration
|
* 2011-06-02 Bernard Add finsh_get_prompt function declaration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SHELL_H__
|
#ifndef __SHELL_H__
|
||||||
#define __SHELL_H__
|
#define __SHELL_H__
|
||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#define FINSH_USING_HISTORY
|
#define FINSH_USING_HISTORY
|
||||||
#ifndef FINSH_THREAD_PRIORITY
|
#ifndef FINSH_THREAD_PRIORITY
|
||||||
#define FINSH_THREAD_PRIORITY 20
|
#define FINSH_THREAD_PRIORITY 20
|
||||||
#endif
|
#endif
|
||||||
#ifndef FINSH_THREAD_STACK_SIZE
|
#ifndef FINSH_THREAD_STACK_SIZE
|
||||||
#define FINSH_THREAD_STACK_SIZE 2048
|
#define FINSH_THREAD_STACK_SIZE 2048
|
||||||
#endif
|
#endif
|
||||||
#define FINSH_CMD_SIZE 80
|
#define FINSH_CMD_SIZE 80
|
||||||
|
|
||||||
#define FINSH_OPTION_ECHO 0x01
|
#define FINSH_OPTION_ECHO 0x01
|
||||||
#if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)
|
#if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)
|
||||||
#define FINSH_PROMPT finsh_get_prompt()
|
#define FINSH_PROMPT finsh_get_prompt()
|
||||||
const char* finsh_get_prompt(void);
|
const char* finsh_get_prompt(void);
|
||||||
#else
|
#else
|
||||||
#define FINSH_PROMPT "finsh>>"
|
#define FINSH_PROMPT "finsh>>"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FINSH_USING_HISTORY
|
#ifdef FINSH_USING_HISTORY
|
||||||
enum input_stat
|
enum input_stat
|
||||||
{
|
{
|
||||||
WAIT_NORMAL,
|
WAIT_NORMAL,
|
||||||
WAIT_SPEC_KEY,
|
WAIT_SPEC_KEY,
|
||||||
WAIT_FUNC_KEY,
|
WAIT_FUNC_KEY,
|
||||||
};
|
};
|
||||||
#ifndef FINSH_HISTORY_LINES
|
#ifndef FINSH_HISTORY_LINES
|
||||||
#define FINSH_HISTORY_LINES 5
|
#define FINSH_HISTORY_LINES 5
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct finsh_shell
|
struct finsh_shell
|
||||||
{
|
{
|
||||||
struct rt_semaphore rx_sem;
|
struct rt_semaphore rx_sem;
|
||||||
|
|
||||||
enum input_stat stat;
|
enum input_stat stat;
|
||||||
|
|
||||||
rt_uint8_t echo_mode:1;
|
rt_uint8_t echo_mode:1;
|
||||||
rt_uint8_t use_history:1;
|
rt_uint8_t use_history:1;
|
||||||
|
|
||||||
#ifdef FINSH_USING_HISTORY
|
#ifdef FINSH_USING_HISTORY
|
||||||
rt_uint8_t current_history;
|
rt_uint8_t current_history;
|
||||||
rt_uint16_t history_count;
|
rt_uint16_t history_count;
|
||||||
|
|
||||||
char cmd_history[FINSH_HISTORY_LINES][FINSH_CMD_SIZE];
|
char cmd_history[FINSH_HISTORY_LINES][FINSH_CMD_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct finsh_parser parser;
|
struct finsh_parser parser;
|
||||||
|
|
||||||
char line[FINSH_CMD_SIZE];
|
char line[FINSH_CMD_SIZE];
|
||||||
rt_uint8_t line_position;
|
rt_uint8_t line_position;
|
||||||
|
|
||||||
rt_device_t device;
|
rt_device_t device;
|
||||||
};
|
};
|
||||||
|
|
||||||
void finsh_set_echo(rt_uint32_t echo);
|
void finsh_set_echo(rt_uint32_t echo);
|
||||||
rt_uint32_t finsh_get_echo(void);
|
rt_uint32_t finsh_get_echo(void);
|
||||||
|
|
||||||
void finsh_system_init(void);
|
void finsh_system_init(void);
|
||||||
void finsh_set_device(const char* device_name);
|
void finsh_set_device(const char* device_name);
|
||||||
const char* finsh_get_device(void);
|
const char* finsh_get_device(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue