mirror of
https://github.com/pvvx/RTL00_WEB.git
synced 2025-07-31 20:31:05 +00:00
update
This commit is contained in:
parent
34d3652711
commit
39f77eb92b
1844 changed files with 899433 additions and 7 deletions
21
USDK/component/common/api/network/include/main_test.h
Normal file
21
USDK/component/common/api/network/include/main_test.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
//----------------------------------------------------------------------------//
|
||||
#ifndef __MAIN_TEST_H
|
||||
#define __MAIN_TEST_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported test functions ------------------------------------------------------- */
|
||||
void do_ping_test(char *ip, int size, int count, int interval);
|
||||
void do_ping_call(char *ip, int loop, int count);
|
||||
void interactive_question(char *question, char *choice, char *buf, int buf_size);
|
||||
void start_interactive_mode(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __MAIN_TEST_H
|
||||
|
||||
//----------------------------------------------------------------------------//
|
50
USDK/component/common/api/network/include/netconf.h
Normal file
50
USDK/component/common/api/network/include/netconf.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file netconf.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.1.0
|
||||
* @date 07-October-2011
|
||||
* @brief This file contains all the functions prototypes for the netconf.c
|
||||
* file.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __NETCONF_H
|
||||
#define __NETCONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// TODO: remove this file
|
||||
#include "lwip_netconf.h"
|
||||
#if 0
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void LwIP_Init(void);
|
||||
void LwIP_DHCP(void);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __NETCONF_H */
|
||||
|
||||
|
||||
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
8
USDK/component/common/api/network/include/rtl8195a_it.h
Normal file
8
USDK/component/common/api/network/include/rtl8195a_it.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
#ifndef __RTL8195A_IT_H_
|
||||
#define __RTL8195A_IT_H_
|
||||
|
||||
|
||||
int irq_alloc_wlan(void *contex);
|
||||
|
||||
#endif //__RTL8195A_IT_H_
|
47
USDK/component/common/api/network/include/util.h
Normal file
47
USDK/component/common/api/network/include/util.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
#ifndef _UTIL_H
|
||||
#define _UTIL_H
|
||||
|
||||
#include <wireless.h>
|
||||
#include <wlan_intf.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "wifi_util.h"
|
||||
#if 0
|
||||
typedef enum _WIFI_EVENT_INDICATE{
|
||||
WIFI_EVENT_CONNECT = 0,
|
||||
WIFI_EVENT_DISCONNECT = 1,
|
||||
WIFI_EVENT_FOURWAY_HANDSHAKE_DONE = 2,
|
||||
}WIFI_EVENT_INDICATE;
|
||||
rtw_event_indicate_t
|
||||
|
||||
int wext_get_ssid(const char *ifname, __u8 *ssid);
|
||||
int wext_set_ssid(const char *ifname, const __u8 *ssid, __u16 ssid_len);
|
||||
int wext_set_auth_param(const char *ifname, __u16 idx, __u32 value);
|
||||
int wext_set_key_ext(const char *ifname, __u16 alg, const __u8 *addr, int key_idx, int set_tx, const __u8 *seq, __u16 seq_len, __u8 *key, __u16 key_len);
|
||||
int wext_get_enc_ext(const char *ifname, __u16 *alg);
|
||||
int wext_set_passphrase(const char *ifname, const __u8 *passphrase, __u16 passphrase_len);
|
||||
int wext_get_passphrase(const char *ifname, __u8 *passphrase);
|
||||
int wext_set_mode(const char *ifname, int mode);
|
||||
int wext_get_mode(const char *ifname, int *mode);
|
||||
int wext_set_ap_ssid(const char *ifname, const __u8 *ssid, __u16 ssid_len);
|
||||
int wext_set_country(const char *ifname, char *country_code);
|
||||
int wext_get_rssi(const char *ifname, int *rssi);
|
||||
int wext_set_channel(const char *ifname, __u8 ch);
|
||||
int wext_get_channel(const char *ifname, __u8 *ch);
|
||||
int wext_set_scan(const char *ifname, char *buf, __u16 buf_len);
|
||||
int wext_get_scan(const char *ifname, char *buf, __u16 buf_len);
|
||||
int wext_mp_command(const char *ifname, char *cmd, int show_msg);
|
||||
int wext_wifi_priv(const char *ifname, int argc, char **argv);
|
||||
void wext_wlan_indicate(unsigned int cmd, union iwreq_data *wrqu, char *extra);
|
||||
#endif
|
||||
|
||||
#define wext_handshake_done rltk_wlan_handshake_done
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _UTIL_H */
|
222
USDK/component/common/api/network/src/ping_test.c
Normal file
222
USDK/component/common/api/network/src/ping_test.c
Normal file
|
@ -0,0 +1,222 @@
|
|||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "main.h"
|
||||
|
||||
#include <lwip/sockets.h>
|
||||
#if LWIP_SOCKET
|
||||
#include <lwip/raw.h>
|
||||
#include <lwip/icmp.h>
|
||||
#include <lwip/inet_chksum.h>
|
||||
#include <platform/platform_stdlib.h>
|
||||
|
||||
//#define PING_IP "192.168.0.1"
|
||||
#define PING_IP "192.168.159.1"
|
||||
#define PING_TO 1000
|
||||
#define PING_ID 0xABCD
|
||||
#define BUF_SIZE 10000
|
||||
#define STACKSIZE 1024
|
||||
|
||||
static unsigned short ping_seq = 0;
|
||||
static int infinite_loop, ping_count, data_size, ping_interval, ping_call;
|
||||
static char ping_ip[16];
|
||||
|
||||
static void generate_ping_echo(unsigned char *buf, int size)
|
||||
{
|
||||
int i;
|
||||
struct icmp_echo_hdr *pecho;
|
||||
|
||||
for(i = 0; i < size; i ++) {
|
||||
buf[sizeof(struct icmp_echo_hdr) + i] = (unsigned char) i;
|
||||
}
|
||||
|
||||
pecho = (struct icmp_echo_hdr *) buf;
|
||||
ICMPH_TYPE_SET(pecho, ICMP_ECHO);
|
||||
ICMPH_CODE_SET(pecho, 0);
|
||||
pecho->chksum = 0;
|
||||
pecho->id = PING_ID;
|
||||
pecho->seqno = htons(++ ping_seq);
|
||||
|
||||
//Checksum includes icmp header and data. Need to calculate after fill up icmp header
|
||||
pecho->chksum = inet_chksum(pecho, sizeof(struct icmp_echo_hdr) + size);
|
||||
}
|
||||
|
||||
void ping_test(void *param)
|
||||
//void ping_test()
|
||||
{
|
||||
int i, ping_socket;
|
||||
int pint_timeout = PING_TO;
|
||||
struct sockaddr_in to_addr, from_addr;
|
||||
int from_addr_len = sizeof(struct sockaddr);
|
||||
int ping_size, reply_size;
|
||||
unsigned char *ping_buf, *reply_buf;
|
||||
unsigned int ping_time, reply_time;
|
||||
struct ip_hdr *iphdr;
|
||||
struct icmp_echo_hdr *pecho;
|
||||
|
||||
if(data_size > BUF_SIZE){
|
||||
printf("[ERROR] %s: data size error, can't exceed %d\n",__func__,BUF_SIZE);
|
||||
return;
|
||||
}
|
||||
|
||||
//Ping size = icmp header(8 bytes) + data size
|
||||
ping_size = sizeof(struct icmp_echo_hdr) + data_size;
|
||||
|
||||
ping_buf = pvPortMalloc(ping_size);
|
||||
if(NULL == ping_buf){
|
||||
printf("[ERROR] %s: Allocate ping_buf failed\n",__func__);
|
||||
return;
|
||||
}
|
||||
|
||||
reply_buf = pvPortMalloc(ping_size);
|
||||
if(NULL == reply_buf){
|
||||
vPortFree(ping_buf);
|
||||
printf("[ERROR] %s: Allocate reply_buf failed\n",__func__);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("[%s] PING %s %d(%d) bytes of data\n", __FUNCTION__, ping_ip, data_size, sizeof(struct ip_hdr) + sizeof(struct icmp_echo_hdr) + data_size);
|
||||
|
||||
for(i = 0; (i < ping_count) || (infinite_loop == 1); i ++) {
|
||||
ping_socket = socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP);
|
||||
#ifdef CONFIG_LWIP_1_5_0
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = pint_timeout / 1000;
|
||||
timeout.tv_usec = pint_timeout % 1000 * 1000;
|
||||
setsockopt(ping_socket, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
|
||||
#else
|
||||
setsockopt(ping_socket, SOL_SOCKET, SO_RCVTIMEO, &pint_timeout, sizeof(pint_timeout));
|
||||
#endif
|
||||
to_addr.sin_len = sizeof(to_addr);
|
||||
to_addr.sin_family = AF_INET;
|
||||
to_addr.sin_addr.s_addr = inet_addr(ping_ip);
|
||||
|
||||
generate_ping_echo(ping_buf, data_size);
|
||||
sendto(ping_socket, ping_buf, ping_size, 0, (struct sockaddr *) &to_addr, sizeof(to_addr));
|
||||
|
||||
ping_time = xTaskGetTickCount();
|
||||
if((reply_size = recvfrom(ping_socket, reply_buf, ping_size, 0, (struct sockaddr *) &from_addr, (socklen_t *) &from_addr_len))
|
||||
>= (int)(sizeof(struct ip_hdr) + sizeof(struct icmp_echo_hdr))) {
|
||||
|
||||
reply_time = xTaskGetTickCount();
|
||||
iphdr = (struct ip_hdr *)reply_buf;
|
||||
pecho = (struct icmp_echo_hdr *)(reply_buf + (IPH_HL(iphdr) * 4));
|
||||
|
||||
if((pecho->id == PING_ID) && (pecho->seqno == htons(ping_seq))) {
|
||||
printf("[%s] %d bytes from %s: icmp_seq=%d time=%d ms\n", __FUNCTION__, reply_size - sizeof(struct ip_hdr), inet_ntoa(from_addr.sin_addr), htons(pecho->seqno), (reply_time - ping_time) * portTICK_RATE_MS);
|
||||
}
|
||||
}
|
||||
else
|
||||
printf("[%s] Request timeout for icmp_seq %d\n", __FUNCTION__, ping_seq);
|
||||
|
||||
close(ping_socket);
|
||||
vTaskDelay(ping_interval * configTICK_RATE_HZ);
|
||||
}
|
||||
|
||||
vPortFree(ping_buf);
|
||||
vPortFree(reply_buf);
|
||||
|
||||
if(!ping_call)
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
void do_ping_call(char *ip, int loop, int count)
|
||||
{
|
||||
ping_call = 1;
|
||||
ping_seq = 0;
|
||||
data_size = 120;
|
||||
ping_interval = 1;
|
||||
infinite_loop = loop;
|
||||
ping_count = count;
|
||||
strcpy(ping_ip, ip);
|
||||
ping_test(NULL);
|
||||
}
|
||||
|
||||
void cmd_ping(int argc, char **argv)
|
||||
{
|
||||
int argv_count = 2;
|
||||
|
||||
if(argc < 2)
|
||||
goto Exit;
|
||||
|
||||
//ping cmd default value
|
||||
infinite_loop = 0;
|
||||
ping_count = 4;
|
||||
data_size = 32;
|
||||
ping_interval = 1;
|
||||
ping_call = 1;
|
||||
ping_seq = 0;
|
||||
|
||||
while(argv_count<=argc){
|
||||
//first operation
|
||||
if(argv_count == 2){
|
||||
memset(ping_ip, 0, sizeof(ping_ip));
|
||||
strncpy(ping_ip, argv[argv_count-1], (strlen(argv[argv_count-1])>16)?16:strlen(argv[argv_count-1]));
|
||||
argv_count++;
|
||||
}
|
||||
else{
|
||||
if(strcmp(argv[argv_count-1], "-t") == 0){
|
||||
infinite_loop = 1;
|
||||
argv_count++;
|
||||
}
|
||||
else if(strcmp(argv[argv_count-1], "-n") == 0){
|
||||
if(argc < (argv_count+1))
|
||||
goto Exit;
|
||||
ping_count = (int) atoi(argv[argv_count]);
|
||||
argv_count+=2;
|
||||
}
|
||||
else if(strcmp(argv[argv_count-1], "-l") == 0){
|
||||
if(argc < (argv_count+1))
|
||||
goto Exit;
|
||||
data_size = (int) atoi(argv[argv_count]);
|
||||
argv_count+=2;
|
||||
}
|
||||
else{
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ping_test(NULL);
|
||||
|
||||
return;
|
||||
|
||||
Exit:
|
||||
printf("[ATWI] Usage: ATWI=[host],[options]\n");
|
||||
printf("\t-t\tPing the specified host until stopped\n");
|
||||
printf("\t-n\t# Number of echo requests to send (default 4 times)\n");
|
||||
printf("\t-l\t# Send buffer size (default 32 bytes)\n");
|
||||
printf("\tExample:\n");
|
||||
printf("\t\tATWI=192.168.1.2,-n,100,-l,5000\n");
|
||||
return;
|
||||
}
|
||||
|
||||
void do_ping_test(char *ip, int size, int count, int interval)
|
||||
{
|
||||
if((sizeof(struct icmp_echo_hdr) + size) > BUF_SIZE) {
|
||||
printf("%s BUF_SIZE(%d) is too small\n", __FUNCTION__, BUF_SIZE);
|
||||
return;
|
||||
}
|
||||
|
||||
if(ip == NULL)
|
||||
strcpy(ping_ip, PING_IP);
|
||||
else
|
||||
strcpy(ping_ip, ip);
|
||||
|
||||
ping_call = 0;
|
||||
ping_seq = 0;
|
||||
data_size = size;
|
||||
ping_interval = interval;
|
||||
|
||||
if(count == 0) {
|
||||
infinite_loop = 1;
|
||||
ping_count = 0;
|
||||
}
|
||||
else {
|
||||
infinite_loop = 0;
|
||||
ping_count = count;
|
||||
}
|
||||
|
||||
if(xTaskCreate(ping_test, ((const signed char*)"ping_test"), STACKSIZE, NULL, tskIDLE_PRIORITY + 1, NULL) != pdPASS)
|
||||
printf("%s xTaskCreate failed\n", __FUNCTION__);
|
||||
}
|
||||
#endif // LWIP_SOCKET
|
110
USDK/component/common/api/network/src/rtl8195a_it.c
Normal file
110
USDK/component/common/api/network/src/rtl8195a_it.c
Normal file
|
@ -0,0 +1,110 @@
|
|||
#include "rtl8195a.h"
|
||||
#include <main.h>
|
||||
#include "rtl8195a_it.h"
|
||||
|
||||
/* os dependent*/
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
|
||||
#include <diag.h>
|
||||
#define printf DiagPrintf
|
||||
|
||||
/*-----------------------------Global Variable ---------------------*/
|
||||
//#ifdef CONFIG_WLAN
|
||||
//#ifdef CONFIG_ISR_THREAD_MODE_INTERRUPT
|
||||
extern xSemaphoreHandle *pExportWlanIrqSemaphore;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_WLAN
|
||||
#ifdef CONFIG_ISR_THREAD_MODE_INTERRUPT
|
||||
|
||||
//TODO: chris
|
||||
#define IRQ_HANDLED 1
|
||||
#define IRQ_NONE 0
|
||||
|
||||
int wlan_Interrupt (
|
||||
IN VOID* Data
|
||||
)
|
||||
{
|
||||
#if 1
|
||||
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
printf("wlan interrupt\n");
|
||||
/* This semaphore is initialized once wlan interrupt handler thread is created and initialized*/
|
||||
if(!pExportWlanIrqSemaphore)
|
||||
{
|
||||
printf("%s(%d)\n", __FUNCTION__, __LINE__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
printf("%s(%d)\n", __FUNCTION__, __LINE__);
|
||||
xSemaphoreGiveFromISR( *pExportWlanIrqSemaphore, &xHigherPriorityTaskWoken );
|
||||
|
||||
printf("%s(%d)\n", __FUNCTION__, __LINE__);
|
||||
/* Switch tasks if necessary. */
|
||||
if( xHigherPriorityTaskWoken != pdFALSE )
|
||||
{
|
||||
printf("%s(%d)\n", __FUNCTION__, __LINE__);
|
||||
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
return IRQ_HANDLED;
|
||||
#else
|
||||
struct dvobj_priv *dvobj = (struct dvobj_priv *)Data;
|
||||
_adapter *adapter = dvobj->if1;
|
||||
DBG_8192C("Dma isr\n");
|
||||
|
||||
if (dvobj->irq_enabled == 0) {
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
DBG_871X("%s(%d)\n", __FUNCTION__, __LINE__);
|
||||
if(rtw_hal_interrupt_handler(adapter) == _FAIL)
|
||||
return IRQ_HANDLED;
|
||||
//return IRQ_NONE;
|
||||
DBG_871X("%s(%d)\n", __FUNCTION__, __LINE__);
|
||||
return IRQ_HANDLED;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
lextra_bus_dma_Interrupt (
|
||||
IN VOID* Data
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* This function register interrupt handler and is called by wlan driver
|
||||
* Return 0 if success, Others if fail
|
||||
*/
|
||||
|
||||
int irq_alloc_wlan(void *contex)
|
||||
{
|
||||
int ret = 0;
|
||||
IRQ_HANDLE IrqHandle = {0};
|
||||
|
||||
printf("Register Interrupt\n");
|
||||
IrqHandle.Data = (u32) (contex);
|
||||
IrqHandle.IrqNum = WL_DMA_IRQ;
|
||||
IrqHandle.IrqFun = (IRQ_FUN)wlan_Interrupt;
|
||||
//IrqHandle.IrqFun = (IRQ_FUN)lextra_bus_dma_Interrupt;
|
||||
IrqHandle.Priority = 0;
|
||||
|
||||
InterruptRegister(&IrqHandle);
|
||||
InterruptEn(&IrqHandle);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
95
USDK/component/common/api/network/src/wlan_network.c
Normal file
95
USDK/component/common/api/network/src/wlan_network.c
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Hello World
|
||||
*
|
||||
* Copyright (c) 2013 Realtek Semiconductor Corp.
|
||||
*
|
||||
* This module is a confidential and proprietary property of RealTek and
|
||||
* possession or use of this module requires written permission of RealTek.
|
||||
*/
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "semphr.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "main_test.h"
|
||||
#if CONFIG_WLAN
|
||||
#include "wifi_conf.h"
|
||||
#include "wlan_intf.h"
|
||||
#include "wifi_constants.h"
|
||||
#endif
|
||||
#include "lwip_netconf.h"
|
||||
#include <platform/platform_stdlib.h>
|
||||
//#include "wifi_interactive_ext.h"
|
||||
|
||||
#ifndef CONFIG_INIT_NET
|
||||
#define CONFIG_INIT_NET 1
|
||||
#endif
|
||||
#ifndef CONFIG_INTERACTIVE_MODE
|
||||
#define CONFIG_INTERACTIVE_MODE 1
|
||||
#endif
|
||||
|
||||
#define STACKSIZE (512 + 768)
|
||||
|
||||
xSemaphoreHandle uart_rx_interrupt_sema = NULL;
|
||||
|
||||
void init_thread(void *param)
|
||||
{
|
||||
|
||||
#if CONFIG_INIT_NET
|
||||
#if CONFIG_LWIP_LAYER
|
||||
/* Initilaize the LwIP stack */
|
||||
// DBG_8195A("\nLwIP Init\n");
|
||||
LwIP_Init();
|
||||
#endif
|
||||
#endif
|
||||
#if CONFIG_WIFI_IND_USE_THREAD
|
||||
wifi_manager_init();
|
||||
#endif
|
||||
#if CONFIG_WLAN
|
||||
// DBG_8195A("\nWiFi_on(RTW_MODE_STA)\n");
|
||||
wifi_on(RTW_MODE_STA);
|
||||
#if CONFIG_AUTO_RECONNECT
|
||||
//setup reconnection flag
|
||||
// u8 mode;
|
||||
// if(wifi_get_autoreconnect(&mode) > 0 && mode != 1)
|
||||
wifi_set_autoreconnect(1);
|
||||
#endif
|
||||
// printf("\n\r%s(%d), Available heap %d\n\r", __FUNCTION__, __LINE__, xPortGetFreeHeapSize());
|
||||
#endif
|
||||
|
||||
#if CONFIG_INTERACTIVE_MODE
|
||||
/* Initial uart rx swmaphore*/
|
||||
vSemaphoreCreateBinary(uart_rx_interrupt_sema);
|
||||
xSemaphoreTake(uart_rx_interrupt_sema, 1/portTICK_RATE_MS);
|
||||
start_interactive_mode();
|
||||
#endif
|
||||
|
||||
/* Kill init thread after all init tasks done */
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
void wlan_network()
|
||||
{
|
||||
#if 0
|
||||
{
|
||||
void *stack_addr = tcm_heap_malloc(STACKSIZE*sizeof(int));
|
||||
if(stack_addr == NULL){
|
||||
printf("%s: Out of TCM heap!\n", __FUNCTION__);
|
||||
}
|
||||
if (xTaskGenericCreate(
|
||||
init_thread,
|
||||
(const char *)"init",
|
||||
STACKSIZE,
|
||||
NULL,
|
||||
tskIDLE_PRIORITY + 3 + PRIORITIE_OFFSET,
|
||||
NULL,
|
||||
stack_addr,
|
||||
NULL) != pdTRUE)
|
||||
printf("%s: xTaskCreate(init_thread) failed\n", __FUNCTION__);
|
||||
}
|
||||
#else
|
||||
if(xTaskCreate(init_thread, ((const char*)"init"), STACKSIZE, NULL, tskIDLE_PRIORITY + 3 + PRIORITIE_OFFSET, NULL) != pdPASS) // +3
|
||||
printf("%s: xTaskCreate(init_thread) failed\n", __FUNCTION__);
|
||||
#endif
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue