mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
apps/ update from Uros
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3392 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1591,4 +1591,9 @@
|
|||||||
where the GPL driver(s) can be re-installed into the NuttX source
|
where the GPL driver(s) can be re-installed into the NuttX source
|
||||||
tree. By re-installing the driver, you agree to the GPL licsensing
|
tree. By re-installing the driver, you agree to the GPL licsensing
|
||||||
and all of its implications.
|
and all of its implications.
|
||||||
|
* Makefile, apps/Makefile, tools/configure.sh -- add logic to copy
|
||||||
|
configs/<board>/<config>/appdir to apps/.config and to simply the
|
||||||
|
application configuration logic.
|
||||||
|
* examples/nsh and apps/nshlib - Move the core NuttShell (NSH) logic
|
||||||
|
out of the exemples directory and into the apps/directory where
|
||||||
|
it belongs.
|
||||||
|
|||||||
@@ -2218,6 +2218,12 @@ nuttx-5.20 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||||||
where the GPL driver(s) can be re-installed into the NuttX source
|
where the GPL driver(s) can be re-installed into the NuttX source
|
||||||
tree. By re-installing the driver, you agree to the GPL licsensing
|
tree. By re-installing the driver, you agree to the GPL licsensing
|
||||||
and all of its implications.
|
and all of its implications.
|
||||||
|
* Makefile, apps/Makefile, tools/configure.sh -- add logic to copy
|
||||||
|
configs/<board>/<config>/appdir to apps/.config and to simply the
|
||||||
|
application configuration logic.
|
||||||
|
* examples/nsh and apps/nshlib - Move the core NuttShell (NSH) logic
|
||||||
|
out of the exemples directory and into the apps/directory where
|
||||||
|
it belongs.
|
||||||
|
|
||||||
apps-5.20 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
apps-5.20 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
|||||||
@@ -56,14 +56,49 @@
|
|||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/* Board Configuration:
|
/* Board Peripheral Assignment
|
||||||
|
*
|
||||||
|
* RS232/Power connector:
|
||||||
* - USART1, is the default bootloader and console
|
* - USART1, is the default bootloader and console
|
||||||
|
*
|
||||||
|
* Sensor Connector:
|
||||||
|
* Digital:
|
||||||
|
* - GPIOs: PB10, PB11 (or even TIM2 CH3 and CH4)
|
||||||
|
* - USART3
|
||||||
|
* - I2C2
|
||||||
|
* Analog:
|
||||||
|
* - ADC1
|
||||||
|
* Supporting Analog Circuitry (not seen outside)
|
||||||
|
* - RefTap (TIM3_CH3)
|
||||||
|
* - Power PWM Out (TIM8_CH1 / TIM3_CH1)
|
||||||
|
* - Filtered Out (TIM3_CH4)
|
||||||
|
* (TIM8 could run at lower frequency, while TIM3 must run at highest possible)
|
||||||
|
* - Gain selection muxed with SDcard I/Os.
|
||||||
|
*
|
||||||
|
* Radio connector:
|
||||||
|
* - UART3 / UART4
|
||||||
|
* - SPI2
|
||||||
|
* - I2C1 (remapped pins vs. Expansion connector)
|
||||||
|
* - CAN
|
||||||
|
* - TIM4 CH[3:4]
|
||||||
|
*
|
||||||
|
* Expansion connector:
|
||||||
|
* - WakeUp Pin
|
||||||
|
* - System Wide Reset
|
||||||
* - SPI1 is wired to expansion port
|
* - SPI1 is wired to expansion port
|
||||||
* - SPI2 is used for radio module
|
* - I2C1
|
||||||
|
* - USART2 [Rx, Tx, CTS, RTS]
|
||||||
|
* - DAC [0:1]
|
||||||
|
* - ADC2 on pins [0:7]
|
||||||
|
* - TIM2 Channels [1:4]
|
||||||
|
* - TIM5 Channels [1:4]
|
||||||
|
*
|
||||||
|
* Onboard Components:
|
||||||
* - SPI3 has direct connection with FRAM
|
* - SPI3 has direct connection with FRAM
|
||||||
* - SDCard, conencts the microSD and shares the control lines with Sensor Interface
|
* - SDCard, conencts the microSD and shares the control lines with Sensor Interface
|
||||||
* to select Amplifier Gain
|
* to select Amplifier Gain
|
||||||
* - ...
|
* - ADC3 is used also for power management (can be shared with ADC1 on sensor connector
|
||||||
|
* if not used)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Clocking *************************************************************************/
|
/* Clocking *************************************************************************/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
unsigned char romfs_img[] = {
|
unsigned char romfs_img[] = {
|
||||||
0x2d, 0x72, 0x6f, 0x6d, 0x31, 0x66, 0x73, 0x2d, 0x00, 0x00, 0x01, 0xf0,
|
0x2d, 0x72, 0x6f, 0x6d, 0x31, 0x66, 0x73, 0x2d, 0x00, 0x00, 0x02, 0x10,
|
||||||
0x38, 0x85, 0x3a, 0x23, 0x4e, 0x53, 0x48, 0x49, 0x6e, 0x69, 0x74, 0x56,
|
0x85, 0xc5, 0xa3, 0x6a, 0x4e, 0x53, 0x48, 0x49, 0x6e, 0x69, 0x74, 0x56,
|
||||||
0x6f, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49,
|
0x6f, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49,
|
||||||
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xff, 0x97,
|
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xff, 0x97,
|
||||||
0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
@@ -15,8 +15,8 @@ unsigned char romfs_img[] = {
|
|||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60,
|
||||||
0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xfe, 0xe0, 0x2e, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xfe, 0xe0, 0x2e, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f,
|
0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30,
|
||||||
0x8d, 0x9c, 0xab, 0xe7, 0x72, 0x63, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x8d, 0x9c, 0xab, 0xc6, 0x72, 0x63, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x63, 0x68, 0x6f,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x63, 0x68, 0x6f,
|
||||||
0x20, 0x22, 0x56, 0x53, 0x4e, 0x20, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x20,
|
0x20, 0x22, 0x56, 0x53, 0x4e, 0x20, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x20,
|
||||||
0x31, 0x2e, 0x32, 0x2c, 0x20, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x65, 0x74,
|
0x31, 0x2e, 0x32, 0x2c, 0x20, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x65, 0x74,
|
||||||
@@ -34,15 +34,15 @@ unsigned char romfs_img[] = {
|
|||||||
0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x46, 0x52, 0x41, 0x4d, 0x20,
|
0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x46, 0x52, 0x41, 0x4d, 0x20,
|
||||||
0x74, 0x6f, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20,
|
0x74, 0x6f, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20,
|
||||||
0x53, 0x44, 0x63, 0x61, 0x72, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x2f, 0x73,
|
0x53, 0x44, 0x63, 0x61, 0x72, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x2f, 0x73,
|
||||||
0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
|
0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x0a, 0x0a, 0x72, 0x61, 0x6d, 0x74,
|
||||||
0x20, 0x2d, 0x74, 0x20, 0x76, 0x66, 0x61, 0x74, 0x20, 0x2f, 0x64, 0x65,
|
0x72, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x33, 0x0a,
|
||||||
0x76, 0x2f, 0x6d, 0x74, 0x64, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x30, 0x20,
|
0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x2d, 0x74, 0x20, 0x76, 0x66, 0x61,
|
||||||
0x2f, 0x75, 0x73, 0x72, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x2d,
|
0x74, 0x20, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x6d, 0x74, 0x64, 0x62, 0x6c,
|
||||||
0x74, 0x20, 0x76, 0x66, 0x61, 0x74, 0x20, 0x2f, 0x64, 0x65, 0x76, 0x2f,
|
0x6f, 0x63, 0x6b, 0x30, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x0a, 0x0a, 0x73,
|
||||||
0x6d, 0x6d, 0x63, 0x73, 0x64, 0x30, 0x20, 0x2f, 0x73, 0x64, 0x63, 0x61,
|
0x64, 0x63, 0x61, 0x72, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20,
|
||||||
0x72, 0x64, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x30, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x2d, 0x74, 0x20, 0x76,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x66, 0x61, 0x74, 0x20, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x6d, 0x6d, 0x63,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x73, 0x64, 0x30, 0x20, 0x2f, 0x73, 0x64, 0x63, 0x61, 0x72, 0x64, 0x0a,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
|||||||
@@ -6,5 +6,9 @@ echo "VSN Board 1.2, www.netclamps.com"
|
|||||||
#mount -t vfat /dev/ramXXXMKRDMINORXXX XXXRDMOUNTPOUNTXXX
|
#mount -t vfat /dev/ramXXXMKRDMINORXXX XXXRDMOUNTPOUNTXXX
|
||||||
|
|
||||||
echo "Mounting FRAM to /usr and SDcard to /sdcard"
|
echo "Mounting FRAM to /usr and SDcard to /sdcard"
|
||||||
|
|
||||||
|
ramtron start 3
|
||||||
mount -t vfat /dev/mtdblock0 /usr
|
mount -t vfat /dev/mtdblock0 /usr
|
||||||
|
|
||||||
|
sdcard start 0
|
||||||
mount -t vfat /dev/mmcsd0 /sdcard
|
mount -t vfat /dev/mmcsd0 /sdcard
|
||||||
|
|||||||
@@ -544,6 +544,7 @@ CONFIG_MMCSD_HAVECARDDETECT=n
|
|||||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||||
# CONFIG_NET_BROADCAST - Broadcast support
|
# CONFIG_NET_BROADCAST - Broadcast support
|
||||||
|
# CONFIG_NET_LLH_LEN - The link level header length
|
||||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||||
#
|
#
|
||||||
CONFIG_NET=n
|
CONFIG_NET=n
|
||||||
@@ -564,6 +565,7 @@ CONFIG_NET_STATISTICS=y
|
|||||||
#CONFIG_NET_RECEIVE_WINDOW=
|
#CONFIG_NET_RECEIVE_WINDOW=
|
||||||
#CONFIG_NET_ARPTAB_SIZE=8
|
#CONFIG_NET_ARPTAB_SIZE=8
|
||||||
CONFIG_NET_BROADCAST=n
|
CONFIG_NET_BROADCAST=n
|
||||||
|
#CONFIG_NET_LLH_LEN=14
|
||||||
#CONFIG_NET_FWCACHE_SIZE=2
|
#CONFIG_NET_FWCACHE_SIZE=2
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ ASRCS =
|
|||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
CSRCS = sysclock.c boot.c leds.c buttons.c spi.c \
|
CSRCS = sysclock.c boot.c leds.c buttons.c spi.c \
|
||||||
usbdev.c sdcard.c ramtron.c power.c
|
usbdev.c power.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_EXAMPLES_NSH_ARCHINIT),y)
|
ifeq ($(CONFIG_EXAMPLES_NSH_ARCHINIT),y)
|
||||||
CSRCS += nsh.c
|
CSRCS += nsh.c
|
||||||
|
|||||||
@@ -10,13 +10,3 @@ Execution starts in the following order:
|
|||||||
- boot, performs initial chip and board initialization
|
- boot, performs initial chip and board initialization
|
||||||
- ...
|
- ...
|
||||||
- nsh, as central application last.
|
- nsh, as central application last.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JTAG options:
|
|
||||||
=============
|
|
||||||
|
|
||||||
CONFIG_STM32_JTAG_FULL_ENABLE // Complete parallel and serial
|
|
||||||
CONFIG_STM32_JTAG_NOJNTRST_ENABLE // no JNTRST pin
|
|
||||||
CONFIG_STM32_JTAG_SW_ENABLE // serial (dual pin) only (can coexist besides the FRAM on SPI3)
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@
|
|||||||
|
|
||||||
int nsh_archinitialize(void)
|
int nsh_archinitialize(void)
|
||||||
{
|
{
|
||||||
up_ramtron();
|
// up_ramtron();
|
||||||
up_sdcard();
|
// up_sdcard();
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ void board_power_off(void)
|
|||||||
|
|
||||||
// \todo
|
// \todo
|
||||||
|
|
||||||
// stop backgorund processes
|
// stop background processes
|
||||||
irqsave();
|
irqsave();
|
||||||
|
|
||||||
// switch to internal HSI and get the PD0 and PD1 as GPIO
|
// switch to internal HSI and get the PD0 and PD1 as GPIO
|
||||||
stm32_board_select_hsi();
|
sysclock_select_hsi();
|
||||||
|
|
||||||
// trigger shutdown with pull-up resistor (not push-pull!) and wait.
|
// trigger shutdown with pull-up resistor (not push-pull!) and wait.
|
||||||
stm32_gpiowrite(GPIO_PCLR, true);
|
stm32_gpiowrite(GPIO_PCLR, true);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
*
|
*
|
||||||
* \return Nothing, operation is always successful.
|
* \return Nothing, operation is always successful.
|
||||||
*/
|
*/
|
||||||
void stm32_board_select_hsi(void)
|
void sysclock_select_hsi(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ void stm32_board_select_hsi(void)
|
|||||||
* \retval -1 External clock is not provided
|
* \retval -1 External clock is not provided
|
||||||
* \retval -2 Could not lock to external clock
|
* \retval -2 Could not lock to external clock
|
||||||
*/
|
*/
|
||||||
int stm32_board_select_hse(void)
|
int sysclock_select_hse(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ int stm32_board_select_hse(void)
|
|||||||
* so spawn a task for that... once cc1101 is restarted signal an event
|
* so spawn a task for that... once cc1101 is restarted signal an event
|
||||||
* to restart clock.
|
* to restart clock.
|
||||||
*/
|
*/
|
||||||
void stm32_board_hse_lost(void)
|
void sysclock_hse_lost(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,5 +181,5 @@ void stm32_board_hse_lost(void)
|
|||||||
*/
|
*/
|
||||||
void stm32_board_clockconfig(void)
|
void stm32_board_clockconfig(void)
|
||||||
{
|
{
|
||||||
stm32_board_select_hsi();
|
sysclock_select_hsi();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -333,16 +333,6 @@ extern int nsh_execapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
|||||||
FAR char *argv[]);
|
FAR char *argv[]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* I/O interfaces */
|
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NSH_CONSOLE
|
|
||||||
extern int nsh_consolemain(int argc, char *argv[]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NSH_TELNET
|
|
||||||
extern int nsh_telnetmain(int argc, char *argv[]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Working directory support */
|
/* Working directory support */
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON)
|
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <nuttx/nuttapp.h>
|
#include <apps/apps.h>
|
||||||
|
|
||||||
#include "nsh.h"
|
#include "nsh.h"
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS
|
#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS
|
||||||
# include <nuttx/nuttapp.h>
|
# include <apps/apps.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <apps/nsh.h>
|
||||||
|
|
||||||
#include "nsh.h"
|
#include "nsh.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/nuttx/nuttapp.h
|
* include/apps/apps.h
|
||||||
*
|
*
|
||||||
* Copyright(C) 2011 Uros Platise. All rights reserved.
|
* Copyright(C) 2011 Uros Platise. All rights reserved.
|
||||||
* Author: Uros Platise <uros.platise@isotel.eu>
|
* Author: Uros Platise <uros.platise@isotel.eu>
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __NUTTX_NUTTAPP_H
|
#ifndef __INCLUDE_APPS_APPS_H
|
||||||
#define __NUTTX_NUTTAPP_H
|
#define __INCLUDE_APPS_APPS_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -72,7 +72,6 @@ extern "C" {
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: check for availability of builtin NuttX application
|
* Name: check for availability of builtin NuttX application
|
||||||
*
|
*
|
||||||
@@ -91,7 +90,6 @@ extern "C" {
|
|||||||
|
|
||||||
EXTERN int nuttapp_isavail(FAR const char *appname);
|
EXTERN int nuttapp_isavail(FAR const char *appname);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: get name of built-in application
|
* Name: get name of built-in application
|
||||||
*
|
*
|
||||||
@@ -110,7 +108,6 @@ EXTERN int nuttapp_isavail(FAR const char *appname);
|
|||||||
|
|
||||||
EXTERN const char * nuttapp_getname(int index);
|
EXTERN const char * nuttapp_getname(int index);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: execute builtin NuttX application
|
* Name: execute builtin NuttX application
|
||||||
*
|
*
|
||||||
@@ -131,9 +128,8 @@ EXTERN const char * nuttapp_getname(int index);
|
|||||||
|
|
||||||
EXTERN int exec_nuttapp(FAR const char *appname, FAR const char *argv[]);
|
EXTERN int exec_nuttapp(FAR const char *appname, FAR const char *argv[]);
|
||||||
|
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* __NUTTX_NUTAPP_H */
|
#endif /* __INCLUDE_APPS_APPS_H */
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* include/apps/nsh.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __INCLUDE_APPS_NSHLIB_H
|
||||||
|
#define __INCLUDE_APPS_NSHLIB_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-Processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define EXTERN extern "C"
|
||||||
|
extern "C" {
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Interfaces needed to initialize and execute the NuttShell (NSH).
|
||||||
|
*
|
||||||
|
* nsh_initialize() - This function function should be called one during
|
||||||
|
* application start-up prior to executing nsh_consolemain() or
|
||||||
|
* nsh_telnetmain().
|
||||||
|
*/
|
||||||
|
|
||||||
|
EXTERN void nsh_initialize(void);
|
||||||
|
|
||||||
|
/* The following interfaces maybe to called or started with task_start to
|
||||||
|
* start an NSH instance.
|
||||||
|
*
|
||||||
|
* nsh_consolemain() starts NSH on the console (/dev/console).
|
||||||
|
* nsh_telnetmain() starts a telnet daemon that will allow multiple
|
||||||
|
* connections via telnet.
|
||||||
|
*
|
||||||
|
* These functions do not return.
|
||||||
|
*/
|
||||||
|
|
||||||
|
EXTERN int nsh_consolemain(int argc, char *argv[]);
|
||||||
|
EXTERN int nsh_telnetmain(int argc, char *argv[]);
|
||||||
|
|
||||||
|
#undef EXTERN
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __INCLUDE_APPS_NSHLIB_H */
|
||||||
+23
-2
@@ -120,7 +120,10 @@
|
|||||||
|
|
||||||
int os_bringup(void)
|
int os_bringup(void)
|
||||||
{
|
{
|
||||||
int init_taskid;
|
#if defined(CONFIG_BUILTIN_APPS) && defined(CONFIG_BUILTIN_APP_START)
|
||||||
|
static const char *argv[3] = {NULL, "init", NULL};
|
||||||
|
#endif
|
||||||
|
int init_taskid;
|
||||||
|
|
||||||
/* Start the page fill worker thread that will resolve page faults.
|
/* Start the page fill worker thread that will resolve page faults.
|
||||||
* This should always be the first thread started because it may
|
* This should always be the first thread started because it may
|
||||||
@@ -154,8 +157,14 @@ int os_bringup(void)
|
|||||||
svdbg("Starting init thread\n");
|
svdbg("Starting init thread\n");
|
||||||
|
|
||||||
#if defined(CONFIG_BUILTIN_APPS) && defined(CONFIG_BUILTIN_APP_START)
|
#if defined(CONFIG_BUILTIN_APPS) && defined(CONFIG_BUILTIN_APP_START)
|
||||||
init_taskid = exec_nuttapp(CONFIG_BUILTIN_APP_START, (const char **)NULL);
|
/* Start the built-in application, passing an "init" argument, so that
|
||||||
|
* application can distinguish different run-levels
|
||||||
|
*/
|
||||||
|
|
||||||
|
init_taskid = exec_nuttapp(CONFIG_BUILTIN_APP_START, argv);
|
||||||
#else
|
#else
|
||||||
|
/* Start the default application at user_start() */
|
||||||
|
|
||||||
init_taskid = START_TASK("init", SCHED_PRIORITY_DEFAULT,
|
init_taskid = START_TASK("init", SCHED_PRIORITY_DEFAULT,
|
||||||
CONFIG_USERMAIN_STACKSIZE,
|
CONFIG_USERMAIN_STACKSIZE,
|
||||||
(main_t)user_start, (const char **)NULL);
|
(main_t)user_start, (const char **)NULL);
|
||||||
@@ -165,3 +174,15 @@ int os_bringup(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Index: sched/os_bringup.c
|
||||||
|
===================================================================
|
||||||
|
--- sched/os_bringup.c (revision 3388)
|
||||||
|
+++ sched/os_bringup.c (working copy)
|
||||||
|
@@ -154,7 +154,14 @@
|
||||||
|
svdbg("Starting init thread\n");
|
||||||
|
|
||||||
|
#if defined(CONFIG_BUILTIN_APPS_NUTTX) && defined(CONFIG_BUILTIN_APP_START)
|
||||||
|
- init_taskid = exec_nuttapp(CONFIG_BUILTIN_APP_START, (const char **)NULL);
|
||||||
|
#else
|
||||||
|
init_taskid = START_TASK("init", SCHED_PRIORITY_DEFAULT,
|
||||||
|
CONFIG_USERMAIN_STACKSIZE,
|
||||||
|
|||||||
Reference in New Issue
Block a user