This commit is contained in:
pvvx 2017-08-30 23:46:18 +03:00
parent 3aed7cffe0
commit 18fd944164
8 changed files with 18 additions and 22 deletions

View file

@ -411,15 +411,10 @@ LOCAL rtw_result_t StartStDHCPClient(void)
struct netif * pnetif = &xnetif[WLAN_ST_NETIF_NUM]; struct netif * pnetif = &xnetif[WLAN_ST_NETIF_NUM];
DHCP_CONFIG *p = (dhcp_cfg *)&wifi_st_dhcp; DHCP_CONFIG *p = (dhcp_cfg *)&wifi_st_dhcp;
unsigned char mode = p->mode; unsigned char mode = p->mode;
if((mode == 3) // Auto fix if(mode == 2 && p->ip != IP4ADDR(255,255,255,255) && p->ip != IP4ADDR(0,0,0,0)) { // fixed ip
&& p->ip != IP4ADDR(255,255,255,255) netif_set_addr(pnetif, (ip_addr_t *)&p->ip, (ip_addr_t *)&p->mask, (ip_addr_t *)&p->gw);
&& p->ip != IP4ADDR(0,0,0,0)) {
} }
else mode = 1; // DHCP On else if(mode) { // DHCP On
if(mode == 2) { // fixed ip
netif_set_addr(pnetif, (ip_addr_t *)&p->ip, (ip_addr_t *)&p->mask, (ip_addr_t *)&p->gw);
}
else if(mode) {
UBaseType_t savePriority = uxTaskPriorityGet(NULL); UBaseType_t savePriority = uxTaskPriorityGet(NULL);
/* If not rise priority, LwIP DHCP may timeout */ /* If not rise priority, LwIP DHCP may timeout */
vTaskPrioritySet(NULL, tskIDLE_PRIORITY + 3); vTaskPrioritySet(NULL, tskIDLE_PRIORITY + 3);
@ -430,7 +425,7 @@ LOCAL rtw_result_t StartStDHCPClient(void)
p->ip = pnetif->ip_addr.addr; p->ip = pnetif->ip_addr.addr;
p->gw = pnetif->gw.addr; p->gw = pnetif->gw.addr;
p->mask = pnetif->netmask.addr; p->mask = pnetif->netmask.addr;
if(p->mode == 3) { // Auto fix if(mode > 2) { // 3+ Auto fix
p->mode = 2; // fixed ip p->mode = 2; // fixed ip
write_wifi_cfg(BID_ST_DHCP_CFG); write_wifi_cfg(BID_ST_DHCP_CFG);
} }

View file

@ -223,20 +223,20 @@ s8 sdio_write_blocks(uint32_t sector, const uint8_t *buffer, uint32_t count) {
//----- //-----
s8 sdio_sd_init(void) { s8 sdio_sd_init(void) {
if (sdio_status != SDIO_SD_OK) { if (sdio_status != SDIO_SD_OK) {
SdioHostAdapter.AdmaDescTbl = gAdmaTbls;
if (sdio_status <= SDIO_INIT_FAIL) if (sdio_status <= SDIO_INIT_FAIL)
sdio_init_host(); sdio_init_host();
if (sdio_status != SDIO_INIT_OK) { if (sdio_status != SDIO_INIT_OK) {
return -1; return -1;
} }
DBG_SDIO_INFO("Init sd card.\n"); DBG_SDIO_INFO("Init sd card.\n");
SdioHostAdapter.AdmaDescTbl = gAdmaTbls;
if (HalSdioHostOp.HalSdioHostInitCard(&SdioHostAdapter)) { if (HalSdioHostOp.HalSdioHostInitCard(&SdioHostAdapter)) {
return -1; return -1;
} }
sdio_status = SDIO_SD_OK; sdio_status = SDIO_SD_OK;
if (HalSdioHostOp.HalSdioHostChangeSdClock(&SdioHostAdapter, if (HalSdioHostOp.HalSdioHostChangeSdClock(&SdioHostAdapter,
// SD_CLK_20_8MHZ) != HAL_OK) SD_CLK_20_8MHZ) != HAL_OK)
SD_CLK_41_6MHZ) != HAL_OK) // SD_CLK_41_6MHZ) != HAL_OK)
DBG_SDIO_INFO("SD card does not support high speed.\n"); DBG_SDIO_INFO("SD card does not support high speed.\n");
} }
return 0; return 0;

View file

@ -119,7 +119,7 @@
/ FatFs supports only BMP. */ / FatFs supports only BMP. */
#define _FS_RPATH 0 /* 0 to 2 */ #define _FS_RPATH 2 /* 0 to 2 */
/* The _FS_RPATH option configures relative path feature. /* The _FS_RPATH option configures relative path feature.
/ /
/ 0: Disable relative path feature and remove related functions. / 0: Disable relative path feature and remove related functions.

View file

@ -112,7 +112,8 @@ void HalSdioHostOpInit(void *Data) {
phsha->HalSdioHostErase = &HalSdioHostEraseRtl8195a; phsha->HalSdioHostErase = &HalSdioHostEraseRtl8195a;
phsha->HalSdioHostGetWriteProtect = &HalSdioHostGetWriteProtectRtl8195a; phsha->HalSdioHostGetWriteProtect = &HalSdioHostGetWriteProtectRtl8195a;
phsha->HalSdioHostSetWriteProtect = &HalSdioHostSetWriteProtectRtl8195a; phsha->HalSdioHostSetWriteProtect = &HalSdioHostSetWriteProtectRtl8195a;
//#ifdef RTL8710AF
#if 0 //#ifdef RTL8710AF
if(HalGetChipId() != CHIP_ID_8195AM) { if(HalGetChipId() != CHIP_ID_8195AM) {
GPIOState[0] &= ~((1 << 8) - 1); GPIOState[0] &= ~((1 << 8) - 1);
{ {
@ -123,8 +124,7 @@ void HalSdioHostOpInit(void *Data) {
} }
// vTaskDelay(1); // vTaskDelay(1);
} }
#endif
//#endif
} }
#endif // CONFIG_SDIO_HOST_EN #endif // CONFIG_SDIO_HOST_EN

View file

@ -206,8 +206,7 @@ runram:
-f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \ -f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \
-c 'load_image $(RAM1R_IMAGE) 0x10000bc8 bin' \ -c 'load_image $(RAM1R_IMAGE) 0x10000bc8 bin' \
-c 'load_image $(RAM2_IMAGE) 0x10006000 bin' \ -c 'load_image $(RAM2_IMAGE) 0x10006000 bin' \
-c 'mww 0x40000210 0x20200113' \ -c 'mww 0x40000210 0x20111157' -c 'rtl8710_reboot' -c shutdown
-c 'reset run' -c shutdown
endif endif
endif endif

View file

@ -19,9 +19,9 @@
# FLAGS # FLAGS
# ------------------------------------------------------------------- # -------------------------------------------------------------------
CFLAGS = -DM3 -DCONFIG_PLATFORM_8195A -DGCC_ARMCM3 -DARDUINO_SDK -DF_CPU=166666666L -DNDEBUG CFLAGS = -DM3 -DCONFIG_PLATFORM_8195A -DGCC_ARMCM3 -DARDUINO_SDK -DF_CPU=166666666L -DNDEBUG
CFLAGS += -mcpu=cortex-m3 -mthumb -g2 -Os -std=gnu99 -Wall -Werror CFLAGS += -mcpu=cortex-m3 -mthumb -g2 -Os -std=gnu99 -Wall -Werror -Wpedantic -Wextra
CFLAGS += -fno-common -fmessage-length=0 -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-short-enums -fsigned-char CFLAGS += -fno-common -fmessage-length=0 -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-short-enums -fsigned-char
CFLAGS += -w -Wno-pointer-sign CFLAGS += -w -Wno-pointer-sign
ifdef USE_GCC_LIB ifdef USE_GCC_LIB
LFLAGS = -mcpu=cortex-m3 -mthumb -g -Os -nostartfiles --specs=nano.specs LFLAGS = -mcpu=cortex-m3 -mthumb -g -Os -nostartfiles --specs=nano.specs
else else
@ -40,7 +40,7 @@ all: LIBS +=_wlan _platform_new _wps _websocket _xmodem _mdns
mp: LIBS +=_wlan_mp _platform_new _wps _websocket _xmodem _mdns mp: LIBS +=_wlan_mp _platform_new _wps _websocket _xmodem _mdns
endif endif
ifdef USE_SDIOH ifdef USE_SDIOH
LIBS += _sdcard_v2 #LIBS += _sdcard_v2
CFLAGS += -DCONFIG_FATFS_EN=1 CFLAGS += -DCONFIG_FATFS_EN=1
endif endif
# m c nosys gcc # m c nosys gcc
@ -259,6 +259,7 @@ ifdef USE_SDIOH
SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c
SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sd.c SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sd.c
SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c
SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_sdio_host_open.c
endif endif
#peripheral - osdep #peripheral - osdep

View file

@ -111,7 +111,7 @@ extern uint32_t SystemCoreClock;
#define configCHECK_FOR_STACK_OVERFLOW 0 #define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0 #define configQUEUE_REGISTRY_SIZE 0
#define configGENERATE_RUN_TIME_STATS 0 #define configGENERATE_RUN_TIME_STATS 1
#if configGENERATE_RUN_TIME_STATS #if configGENERATE_RUN_TIME_STATS
#define configUSE_STATS_FORMATTING_FUNCTIONS 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 1

View file

@ -22,6 +22,7 @@
#include "wifi_api.h" #include "wifi_api.h"
#include "sys_api.h" #include "sys_api.h"
#include "esp_comp.h" #include "esp_comp.h"
#include "sdk_ver.h"
#ifdef USE_NETBIOS #ifdef USE_NETBIOS
#include "netbios/netbios.h" #include "netbios/netbios.h"