Merge pull request #1 from enkiller/dev

整理SDK库
This commit is contained in:
燕十三 2018-10-19 17:15:56 +08:00 committed by GitHub
commit 394312b0e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 104 additions and 320 deletions

View file

@ -1,15 +1,97 @@
# RT-Thread building script for bridge # RT-Thread building script for bridge
import os import os
import rtconfig
Import ('RTT_ROOT')
from building import * from building import *
cwd = GetCurrentDir() cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list: src = []
path = os.path.join(cwd, d) cpppath = []
if os.path.isfile(os.path.join(path, 'SConscript')): cppdefines = ['CONFIG_PLATFORM_8711B', 'PLATFORM_RTTHREAD']
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs') src += ['rtthread_patch/os/rtthread_service.c']
src += ['rtthread_patch/realtek/8711b/app_start.c']
src += ['rtthread_patch/realtek/8711b/rtl8710b_startup.c']
src += ['rtthread_patch/realtek/common/wifi/wifi_conf.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_eap_config.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api/wifi/wifi_ind.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api/wifi/wifi_promisc.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api/wifi/wifi_util.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/analogin_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/dma_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/efuse_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/flash_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/gpio_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/gpio_irq_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/i2c_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/i2s_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/nfc_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/pinmap.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/pinmap_common.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/port_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/pwmout_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/rtc_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/serial_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/sleep.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/spi_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/sys_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/timer_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/us_ticker.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/us_ticker_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/wait_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b/wdt_api.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/os/os_dep/osdep_service.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/app/monitor/ram/monitor.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/app/monitor/ram/rtl_consol.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/cmsis/device/system_8195a.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/fwlib/ram_lib/rtl8710b_intfcfg.c']
src += ['sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/fwlib/ram_lib/rtl8710b_pinmapcfg.c']
cpppath += [cwd + '/rtthread_patch']
cpppath += [cwd + '/rtthread_patch/os']
cpppath += [cwd + '/rtthread_patch/realtek/8711b/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api/platform']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api/wifi']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/api/wifi/rtw_wpa_supplicant/src']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/drivers/wlan/realtek/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/drivers/wlan/realtek/src/osdep']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/drivers/wlan/realtek/wlan_ram_map/rom']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/network/ssl/polarssl-1.3.8/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/network/ssl/ssl_ram_map/rom']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/targets/hal/rtl8711b']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/hal']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/hal_ext']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/api']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/os/os_dep/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/os/freertos']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/os/freertos/freertos_v8.1.2/Source/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/cmsis']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/misc']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/fwlib/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/cmsis/device']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/swlib/rtl_lib']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/app/monitor/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/swlib/std_lib/include']
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/swlib/std_lib/libc/rom/string']
if rtconfig.CROSS_TOOL == 'gcc':
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM4F']
elif rtconfig.CROSS_TOOL == 'iar':
cpppath += [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/os/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM4F']
libs = ['lib_platform', 'lib_rtlstd', 'lib_wlan', 'lib_wps']
if rtconfig.CROSS_TOOL == 'gcc':
libpath = [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/misc/bsp/lib/common/GCC']
libs += ['lib_dct', '-lnosys']
elif rtconfig.CROSS_TOOL == 'iar':
libpath = [cwd + '/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/misc/bsp/lib/common/IAR']
cppdefines += ['__IEEE_LITTLE_ENDIAN']
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, CPPDEFINES = cppdefines, LIBS = libs, LIBPATH = libpath)
Return('group')

View file

@ -1,19 +0,0 @@
import rtconfig
from building import *
cwd = GetCurrentDir()
src = Split('''
os/rtthread_service.c
realtek/8711b/rtl8710b_startup.c
realtek/8711b/app_start.c
realtek/common/wifi/wifi_conf.c
''')
path = [cwd,
cwd + '/os',
cwd + '/realtek/8711b/include']
group = DefineGroup('rtt_patch', src, depend = [''], CPPPATH = path)
Return('group')

View file

@ -9,113 +9,7 @@
#include "ameba_soc.h" #include "ameba_soc.h"
#include "build_info.h" #include "build_info.h"
#include "rtconfig.h"
#include <rtthread.h>
#ifdef RT_USING_LWIP
#include <wlan_dev.h>
#endif
#ifndef RT_MAIN_THREAD_STACK_SIZE
#define RT_MAIN_THREAD_STACK_SIZE 2048
#endif
#ifndef RT_USING_HEAP
/* if there is not enable heap, we should use static thread and stack. */
ALIGN(8)
static rt_uint8_t main_stack[RT_MAIN_THREAD_STACK_SIZE];
struct rt_thread main_thread;
#endif
#ifdef RT_USING_LWIP
extern int amebaz_wifi_init(rt_wlan_mode_t mode);
#endif
/* the system main thread */
void main_thread_entry(void *parameter)
{
extern int main(void);
extern int $Super$$main(void);
/* RT-Thread components initialization */
#ifdef RT_USING_COMPONENTS_INIT
rt_components_init();
#endif
#ifdef RT_USING_LWIP
if(amebaz_wifi_init(WIFI_STATION) != RT_EOK)
rt_kprintf("amebaz_wifi_start failed...\n");
#endif
/* invoke system main function */
#if defined (__CC_ARM)
$Super$$main(); /* for ARMCC. */
#elif defined(__ICCARM__) || defined(__GNUC__)
main();
#endif
}
void rt_application_init(void)
{
rt_thread_t tid;
#ifdef RT_USING_HEAP
tid = rt_thread_create("main", main_thread_entry, RT_NULL,
RT_MAIN_THREAD_STACK_SIZE, RT_THREAD_PRIORITY_MAX / 3, 20);
RT_ASSERT(tid != RT_NULL);
#else
rt_err_t result;
tid = &main_thread;
result = rt_thread_init(tid, "main", main_thread_entry, RT_NULL,
main_stack, sizeof(main_stack), RT_THREAD_PRIORITY_MAX / 3, 20);
RT_ASSERT(result == RT_EOK);
/* if not define RT_USING_HEAP, using to eliminate the warning */
(void)result;
#endif
rt_thread_startup(tid);
}
int rtthread_startup(void)
{
rt_hw_interrupt_disable();
/* board level initalization
* NOTE: please initialize heap inside board initialization.
*/
rt_hw_board_init();
/* show RT-Thread version */
rt_show_version();
/* timer system initialization */
rt_system_timer_init();
/* scheduler system initialization */
rt_system_scheduler_init();
#ifdef RT_USING_SIGNALS
/* signal system initialization */
rt_system_signal_init();
#endif
/* create init_thread */
rt_application_init();
/* timer thread initialization */
rt_system_timer_thread_init();
/* idle thread initialization */
rt_thread_idle_init();
/* start scheduler */
rt_system_scheduler_start();
/* never reach here */
return 0;
}
void APP_Start(void) void APP_Start(void)
{ {
@ -139,9 +33,17 @@ void APP_Start(void)
"mov sp, r0\n" "mov sp, r0\n"
); );
/* disable interrupt first */ #ifdef RT_USING_USER_MAIN
rt_hw_interrupt_disable();
/* startup RT-Thread RTOS */ /* startup RT-Thread RTOS */
rtthread_startup(); rtthread_startup();
#else
extern int main(void);
extern int $Super$$main(void);
/* invoke system main function */
#if defined (__CC_ARM)
$Super$$main(); /* for ARMCC. */
#elif defined(__ICCARM__) || defined(__GNUC__)
main();
#endif
#endif
} }

View file

@ -268,7 +268,7 @@
#undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
#define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
#undef CONFIG_LWIP_LAYER #undef CONFIG_LWIP_LAYER
#define CONFIG_LWIP_LAYER 1 #define CONFIG_LWIP_LAYER 0
#undef CONFIG_BSD_TCP #undef CONFIG_BSD_TCP
#define CONFIG_BSD_TCP 1 #define CONFIG_BSD_TCP 1

View file

@ -1,15 +0,0 @@
# RT-Thread building script for bridge
import os
from building import *
cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')

View file

@ -1,15 +0,0 @@
# RT-Thread building script for bridge
import os
from building import *
cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')

View file

@ -1,15 +0,0 @@
# RT-Thread building script for bridge
import os
from building import *
cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')

View file

@ -1,31 +0,0 @@
import rtconfig
Import('RTT_ROOT')
from building import *
# get current directory
cwd = GetCurrentDir()
# The set of source files associated with this SConscript file.
path =[cwd + '/platform',
cwd + '/']
src = []
if GetDepend(['RT_USING_LWIP']):
src += Split('''
wifi/wifi_ind.c
wifi/wifi_util.c
wifi/wifi_promisc.c
wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_eap_config.c
''')
path += [cwd + '/wifi',
cwd + '/wifi/rtw_wpa_supplicant/src',
cwd + '/../drivers/wlan/realtek/include',
cwd + '/../drivers/wlan/realtek/src/osdep',
cwd + '/../drivers/wlan/realtek/wlan_ram_map/rom',
cwd + '/../network/ssl/polarssl-1.3.8/include',
cwd + '/../network/ssl/ssl_ram_map/rom']
group = DefineGroup('ameba_wifi', src, depend = [], CPPPATH = path)
Return('group')

View file

@ -28,7 +28,7 @@
extern "C" { extern "C" {
#endif #endif
#include "lwip/tcpip.h" // #include "tcpip.h"
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include <platform/platform_stdlib.h> #include <platform/platform_stdlib.h>
#include "platform_opts.h" #include "platform_opts.h"

View file

@ -1,7 +1,7 @@
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "main.h" #include "main.h"
#include "lwip/tcpip.h" // #include "tcpip.h"
#include "wifi/wifi_conf.h" #include "wifi/wifi_conf.h"
#ifndef CONFIG_WLAN #ifndef CONFIG_WLAN

View file

@ -1,42 +0,0 @@
import rtconfig
Import('RTT_ROOT')
from building import *
# get current directory
cwd = GetCurrentDir()
# The set of source files associated with this SConscript file.
src = Split('''
targets/hal/rtl8711b/analogin_api.c
targets/hal/rtl8711b/dma_api.c
targets/hal/rtl8711b/efuse_api.c
targets/hal/rtl8711b/flash_api.c
targets/hal/rtl8711b/gpio_api.c
targets/hal/rtl8711b/gpio_irq_api.c
targets/hal/rtl8711b/i2c_api.c
targets/hal/rtl8711b/i2s_api.c
targets/hal/rtl8711b/nfc_api.c
targets/hal/rtl8711b/pinmap.c
targets/hal/rtl8711b/pinmap_common.c
targets/hal/rtl8711b/port_api.c
targets/hal/rtl8711b/pwmout_api.c
targets/hal/rtl8711b/rtc_api.c
targets/hal/rtl8711b/serial_api.c
targets/hal/rtl8711b/sleep.c
targets/hal/rtl8711b/spi_api.c
targets/hal/rtl8711b/sys_api.c
targets/hal/rtl8711b/timer_api.c
targets/hal/rtl8711b/us_ticker.c
targets/hal/rtl8711b/us_ticker_api.c
targets/hal/rtl8711b/wait_api.c
targets/hal/rtl8711b/wdt_api.c
''')
path = [cwd + '/targets/hal/rtl8711b',
cwd + '/hal',
cwd + '/hal_ext',
cwd + '/api']
group = DefineGroup('mbed', src, depend = [], CPPPATH = path,)
Return('group')

View file

@ -1,24 +0,0 @@
import rtconfig
Import('RTT_ROOT')
from building import *
# get current directory
cwd = GetCurrentDir()
# The set of source files associated with this SConscript file.
src = Split('''
os_dep/osdep_service.c
''')
path = [cwd + '/os_dep/include',
cwd + '/freertos',
cwd + '/freertos/freertos_v8.1.2/Source/include']
if rtconfig.CROSS_TOOL == 'gcc':
path += [cwd + '/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM4F']
elif rtconfig.CROSS_TOOL == 'iar':
path += [cwd + '/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM4F']
group = DefineGroup('os_dep', src, depend = [''], CPPPATH = path)
Return('group')

View file

@ -1,39 +0,0 @@
import rtconfig
Import('RTT_ROOT')
from building import *
# get current directory
cwd = GetCurrentDir()
# The set of source files associated with this SConscript file.
src = Split("""
realtek/8711b/cmsis/device/system_8195a.c
realtek/8711b/fwlib/ram_lib/rtl8710b_pinmapcfg.c
realtek/8711b/fwlib/ram_lib/rtl8710b_intfcfg.c
realtek/8711b/app/monitor/ram/rtl_consol.c
realtek/8711b/app/monitor/ram/monitor.c
""")
path = [cwd,
cwd + '/realtek/8711b/cmsis',
cwd + '/realtek/8711b/misc',
cwd + '/realtek/8711b/fwlib/include',
cwd + '/realtek/8711b/cmsis/device',
cwd + '/realtek/8711b/swlib/rtl_lib',
cwd + '/realtek/8711b/app/monitor/include',
cwd + '/realtek/8711b/swlib/std_lib/include',
cwd + '/realtek/8711b/swlib/std_lib/libc/rom/string']
CPPDEFINES = ['CONFIG_PLATFORM_8711B']
LIB = ['lib_platform', 'lib_rtlstd', 'lib_wlan', 'lib_wps']
if rtconfig.CROSS_TOOL == 'gcc':
LIB_PATH = [cwd + '/realtek/8711b/misc/bsp/lib/common/GCC']
LIB += ['lib_dct', '-lnosys']
elif rtconfig.CROSS_TOOL == 'iar':
LIB_PATH = [cwd + '/realtek/8711b/misc/bsp/lib/common/IAR']
CPPDEFINES += ['__IEEE_LITTLE_ENDIAN']
group = DefineGroup('soc_8711b', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES, LIBS = LIB, LIBPATH = LIB_PATH)
Return('group')