diff options
| author | bernard <[email protected]> | 2017-11-30 23:56:52 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2017-11-30 23:56:52 +0800 |
| commit | ae7237dc53540897a9ea40e145122276bd0b9ddc (patch) | |
| tree | d49a61e59202c15390260732482cf6464358ba6a /bsp | |
| parent | 2a83353e5f0ff1888feb528689bd4c9e2edeb566 (diff) | |
[BSP] Fix the WIN32 compiling issue.
rename _errno to __rt_errno for conflict in WIN32.
Diffstat (limited to 'bsp')
| -rwxr-xr-x | bsp/simulator/applications/application.c | 10 | ||||
| -rw-r--r-- | bsp/simulator/applications/mnt.c | 4 | ||||
| -rw-r--r-- | bsp/simulator/applications/platform.c | 9 | ||||
| -rw-r--r-- | bsp/simulator/applications/startup.c | 24 | ||||
| -rwxr-xr-x | bsp/simulator/rtconfig.h | 2 | ||||
| -rwxr-xr-x | bsp/simulator/rtconfig.py | 6 |
6 files changed, 34 insertions, 21 deletions
diff --git a/bsp/simulator/applications/application.c b/bsp/simulator/applications/application.c index a16d731295..c899baaa3d 100755 --- a/bsp/simulator/applications/application.c +++ b/bsp/simulator/applications/application.c @@ -26,13 +26,15 @@ #include <stdio.h> #include <board.h> +extern int platform_init(void); +extern int mnt_init(void); + void rt_init_thread_entry(void *parameter) { -#ifdef RT_USING_COMPONENTS_INIT - rt_components_init(); -#endif - rt_kprintf("Hello RT-Thread!\n"); + + platform_init(); + mnt_init(); } int rt_application_init() diff --git a/bsp/simulator/applications/mnt.c b/bsp/simulator/applications/mnt.c index 3a0628e985..e8fc562840 100644 --- a/bsp/simulator/applications/mnt.c +++ b/bsp/simulator/applications/mnt.c @@ -15,6 +15,8 @@ int mnt_init(void) { + dfs_init(); + #ifdef RT_USING_DFS_WINSHAREDIR dfs_win32_init(); rt_win_sharedir_init("wshare"); @@ -47,7 +49,7 @@ int mnt_init(void) } #endif + return 0; } -INIT_ENV_EXPORT(mnt_init); #endif diff --git a/bsp/simulator/applications/platform.c b/bsp/simulator/applications/platform.c index f79bd6143f..00d4a1b6a0 100644 --- a/bsp/simulator/applications/platform.c +++ b/bsp/simulator/applications/platform.c @@ -1,8 +1,12 @@ #include <rtthread.h> #include "board.h" -void platform_init(void) +#include <shell.h> + +int platform_init(void) { + finsh_system_init(); + #ifdef RT_USING_LWIP #ifdef RT_USING_TAPNETIF tap_netif_hw_init(); @@ -24,5 +28,6 @@ void platform_init(void) #endif #endif /* RT_USING_DFS */ + + return 0; } -INIT_DEVICE_EXPORT(platform_init); diff --git a/bsp/simulator/applications/startup.c b/bsp/simulator/applications/startup.c index 9745def978..cc2144d64f 100644 --- a/bsp/simulator/applications/startup.c +++ b/bsp/simulator/applications/startup.c @@ -1,11 +1,21 @@ /* * File : startup.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Develop Team + * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes @@ -24,12 +34,8 @@ /*@{*/ extern int rt_application_init(void); -#ifdef RT_USING_FINSH -extern int finsh_system_init(void); -extern void finsh_set_device(const char *device); -#endif - extern rt_uint8_t *heap; + /** * This function will startup RT-Thread RTOS. */ diff --git a/bsp/simulator/rtconfig.h b/bsp/simulator/rtconfig.h index 2b048a19e0..4a045637bd 100755 --- a/bsp/simulator/rtconfig.h +++ b/bsp/simulator/rtconfig.h @@ -99,7 +99,7 @@ // <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" /> // #define RT_USING_PTHREADS // <bool name="RT_USING_COMPONENTS_INIT" description="Using automatically component initialization." default="true" /> -#define RT_USING_COMPONENTS_INIT +// #define RT_USING_COMPONENTS_INIT // <bool name="RT_USING_MODULE" description="Enable Moudle Application" default="true" /> // #define RT_USING_MODULE // </section> diff --git a/bsp/simulator/rtconfig.py b/bsp/simulator/rtconfig.py index 4aefff78ab..c62b24ea93 100755 --- a/bsp/simulator/rtconfig.py +++ b/bsp/simulator/rtconfig.py @@ -67,7 +67,7 @@ if PLATFORM == 'gcc': POST_ACTION = '' elif PLATFORM == 'mingw': - # toolchains + # toolchains PREFIX = '' CC = PREFIX + 'gcc' CXX = PREFIX + 'g++' @@ -79,11 +79,9 @@ elif PLATFORM == 'mingw': OBJDUMP = PREFIX + 'objdump' OBJCPY = PREFIX + 'objcopy' -# DEVICE = ' -ffunction-sections -fdata-sections' DEVICE = '' CFLAGS = DEVICE + ' -D_Win32 -DNO_OLDNAMES -fno-pic -fno-builtin -fno-exceptions -fno-omit-frame-pointer' - AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' LFLAGS = DEVICE + ' -static-libgcc -Wl,--gc-sections,-Map=rtthread-win32.map -T mingw.ld ' CPATH = '' @@ -117,7 +115,7 @@ elif PLATFORM == 'cl': CFLAGS += ' /MT' LFLAGS += '' - CFLAGS += ' /Zi /Od /W 3 /WL ' + CFLAGS += ' /Zi /Od /W 3 /WL /D_Win32' LFLAGS += ' /SUBSYSTEM:CONSOLE /MACHINE:X86 /INCREMENTAL:NO' CPATH = '' |
