mirror of
https://github.com/flyingcys/realtek_ameba.git
synced 2024-11-01 01:44:16 +00:00
update wifi driver
This commit is contained in:
parent
f93445dfa6
commit
7f4971152a
5 changed files with 12 additions and 8 deletions
|
@ -11,7 +11,9 @@
|
||||||
#include "build_info.h"
|
#include "build_info.h"
|
||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
#ifdef RT_USING_LWIP
|
||||||
#include <wlan_dev.h>
|
#include <wlan_dev.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef RT_MAIN_THREAD_STACK_SIZE
|
#ifndef RT_MAIN_THREAD_STACK_SIZE
|
||||||
#define RT_MAIN_THREAD_STACK_SIZE 2048
|
#define RT_MAIN_THREAD_STACK_SIZE 2048
|
||||||
|
@ -24,7 +26,9 @@ static rt_uint8_t main_stack[RT_MAIN_THREAD_STACK_SIZE];
|
||||||
struct rt_thread main_thread;
|
struct rt_thread main_thread;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef RT_USING_LWIP
|
||||||
extern int amebaz_wifi_init(rt_wlan_mode_t mode);
|
extern int amebaz_wifi_init(rt_wlan_mode_t mode);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* the system main thread */
|
/* the system main thread */
|
||||||
void main_thread_entry(void *parameter)
|
void main_thread_entry(void *parameter)
|
||||||
|
@ -37,8 +41,10 @@ void main_thread_entry(void *parameter)
|
||||||
rt_components_init();
|
rt_components_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef RT_USING_LWIP
|
||||||
if(amebaz_wifi_init(WIFI_STATION) != RT_EOK)
|
if(amebaz_wifi_init(WIFI_STATION) != RT_EOK)
|
||||||
rt_kprintf("amebaz_wifi_start failed...\n");
|
rt_kprintf("amebaz_wifi_start failed...\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* invoke system main function */
|
/* invoke system main function */
|
||||||
#if defined (__CC_ARM)
|
#if defined (__CC_ARM)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <wifi/wifi_conf.h>
|
#include <wifi/wifi_conf.h>
|
||||||
#include <wifi/wifi_util.h>
|
#include <wifi/wifi_util.h>
|
||||||
#include <wifi/wifi_ind.h>
|
#include <wifi/wifi_ind.h>
|
||||||
#include "tcpip.h"
|
#include "lwip/tcpip.h"
|
||||||
#include <osdep_service.h>
|
#include <osdep_service.h>
|
||||||
|
|
||||||
#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT || CONFIG_JD_SMART
|
#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT || CONFIG_JD_SMART
|
||||||
|
@ -413,6 +413,7 @@ int wifi_connect(
|
||||||
u8 wep_pwd[14] = {0};
|
u8 wep_pwd[14] = {0};
|
||||||
|
|
||||||
if(rtw_join_status & JOIN_SIMPLE_CONFIG || rtw_join_status & JOIN_AIRKISS){
|
if(rtw_join_status & JOIN_SIMPLE_CONFIG || rtw_join_status & JOIN_AIRKISS){
|
||||||
|
printf("%s %d\r\n", __FUNCTION__, __LINE__);
|
||||||
return RTW_ERROR;
|
return RTW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,6 +535,7 @@ int wifi_connect(
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
if(wifi_is_connected_to_ap( ) != RTW_SUCCESS) {
|
if(wifi_is_connected_to_ap( ) != RTW_SUCCESS) {
|
||||||
|
printf("%s %d\r\n", __FUNCTION__, __LINE__);
|
||||||
result = RTW_ERROR;
|
result = RTW_ERROR;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -553,6 +555,7 @@ int wifi_connect(
|
||||||
rtw_free(join_result->network_info.password);
|
rtw_free(join_result->network_info.password);
|
||||||
}
|
}
|
||||||
if(wifi_is_connected_to_ap( ) != RTW_SUCCESS) {
|
if(wifi_is_connected_to_ap( ) != RTW_SUCCESS) {
|
||||||
|
printf("%s %d\r\n", __FUNCTION__, __LINE__);
|
||||||
result = RTW_ERROR;
|
result = RTW_ERROR;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,11 +26,6 @@ if GetDepend(['RT_USING_LWIP']):
|
||||||
cwd + '/../network/ssl/polarssl-1.3.8/include',
|
cwd + '/../network/ssl/polarssl-1.3.8/include',
|
||||||
cwd + '/../network/ssl/ssl_ram_map/rom']
|
cwd + '/../network/ssl/ssl_ram_map/rom']
|
||||||
|
|
||||||
if GetDepend('RT_USING_LWIP141'):
|
|
||||||
path += [RTT_ROOT + '/components/net/lwip-1.4.1/src/include/lwip']
|
|
||||||
elif GetDepend('RT_USING_LWIP202'):
|
|
||||||
path += [RTT_ROOT + '/components/net/lwip-2.0.2/src/include/lwip']
|
|
||||||
|
|
||||||
group = DefineGroup('ameba_wifi', src, depend = [], CPPPATH = path)
|
group = DefineGroup('ameba_wifi', src, depend = [], CPPPATH = path)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "tcpip.h"
|
#include "lwip/tcpip.h"
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include <platform/platform_stdlib.h>
|
#include <platform/platform_stdlib.h>
|
||||||
#include "platform_opts.h"
|
#include "platform_opts.h"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "tcpip.h"
|
#include "lwip/tcpip.h"
|
||||||
#include "wifi/wifi_conf.h"
|
#include "wifi/wifi_conf.h"
|
||||||
|
|
||||||
#ifndef CONFIG_WLAN
|
#ifndef CONFIG_WLAN
|
||||||
|
|
Loading…
Reference in a new issue