mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-27 04:09:59 +08:00
feat: Modify file mode
This commit is contained in:
bin
driver_lib
examples
openssl_demo
project_template
smart_config
spiffs_test
websocket_demo
wifi_station_machine_demo
wps_demo
extra_include/xtensa
cacheasm.hcacheattrasm.h
config
coreasm.hcorebits.hhal.hsim.hsimcall-errno.hsimcall-fcntl.hsimcall.hspecreg.htie
xt_MUL32.hxt_core.hxt_debug.hxt_density.hxt_exceptions.hxt_externalregisters.hxt_interrupt.hxt_misc.hxt_mmu.hxt_mul.hxt_timer.hxt_trace.h
xtensa-libdb-macros.hxtensa-xer.hxtruntime-frames.hxtruntime.hinclude
espressif
esp8266
esp_common.hesp_misc.hesp_softap.hesp_spiffs.hesp_ssc.hesp_sta.hesp_system.hesp_timer.hesp_wifi.hpwm.hfreertos
FreeRTOS.hFreeRTOSConfig.hStackMacros.hcroutine.hlist.hmpu_wrappers.hportable.hportmacro.hprojdefs.hqueue.hsemphr.htask.htimers.hxtensa_context.hxtensa_rtos.hxtensa_timer.h
lwip
apps
arch
ipv4/lwip
ipv6/lwip
lwip
api.hapi_msg.harch.hdebug.hdef.hdhcp.hdhcpserver.hdns.herr.hinet_chksum.hinit.hip.hip_addr.hmem.hmemp.hmemp_std.hnetbuf.hnetdb.hnetif.hnetifapi.hopt.hpbuf.hraw.hsio.hsnmp.hsnmp_asn1.hsnmp_msg.hsnmp_structs.hsockets.hstats.hsys.htcp.htcp_impl.htcpip.htimers.hudp.h
lwipopts.hnetif
posix
nopoll
openssl
lib
libcrypto.alibespconn.alibespnow.alibfreertos.alibmain.alibmesh.alibminic.alibnet80211.alibnopoll.alibpp.alibpwm.alibsmartconfig.alibssl.alibwpa.alibwps.a
third_party
tools
@ -1,81 +1,81 @@
|
||||
/*
|
||||
* ESPRSSIF MIT License
|
||||
*
|
||||
* Copyright (c) 2015 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
|
||||
*
|
||||
* Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
|
||||
* it is free of charge, to any person obtaining a copy of this software and associated
|
||||
* documentation files (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "esp_common.h"
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : user_rf_cal_sector_set
|
||||
* Description : SDK just reversed 4 sectors, used for rf init data and paramters.
|
||||
* We add this function to force users to set rf cal sector, since
|
||||
* we don't know which sector is free in user's application.
|
||||
* sector map for last several sectors : ABCCC
|
||||
* A : rf cal
|
||||
* B : rf init data
|
||||
* C : sdk parameters
|
||||
* Parameters : none
|
||||
* Returns : rf cal sector
|
||||
*******************************************************************************/
|
||||
uint32 user_rf_cal_sector_set(void)
|
||||
{
|
||||
flash_size_map size_map = system_get_flash_size_map();
|
||||
uint32 rf_cal_sec = 0;
|
||||
|
||||
switch (size_map) {
|
||||
case FLASH_SIZE_4M_MAP_256_256:
|
||||
rf_cal_sec = 128 - 5;
|
||||
break;
|
||||
|
||||
case FLASH_SIZE_8M_MAP_512_512:
|
||||
rf_cal_sec = 256 - 5;
|
||||
break;
|
||||
|
||||
case FLASH_SIZE_16M_MAP_512_512:
|
||||
case FLASH_SIZE_16M_MAP_1024_1024:
|
||||
rf_cal_sec = 512 - 5;
|
||||
break;
|
||||
|
||||
case FLASH_SIZE_32M_MAP_512_512:
|
||||
case FLASH_SIZE_32M_MAP_1024_1024:
|
||||
rf_cal_sec = 1024 - 5;
|
||||
break;
|
||||
|
||||
default:
|
||||
rf_cal_sec = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return rf_cal_sec;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : user_init
|
||||
* Description : entry of user application, init user function here
|
||||
* Parameters : none
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void user_init(void)
|
||||
{
|
||||
printf("SDK version:%s\n", system_get_sdk_version());
|
||||
}
|
||||
|
||||
/*
|
||||
* ESPRSSIF MIT License
|
||||
*
|
||||
* Copyright (c) 2015 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
|
||||
*
|
||||
* Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
|
||||
* it is free of charge, to any person obtaining a copy of this software and associated
|
||||
* documentation files (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "esp_common.h"
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : user_rf_cal_sector_set
|
||||
* Description : SDK just reversed 4 sectors, used for rf init data and paramters.
|
||||
* We add this function to force users to set rf cal sector, since
|
||||
* we don't know which sector is free in user's application.
|
||||
* sector map for last several sectors : ABCCC
|
||||
* A : rf cal
|
||||
* B : rf init data
|
||||
* C : sdk parameters
|
||||
* Parameters : none
|
||||
* Returns : rf cal sector
|
||||
*******************************************************************************/
|
||||
uint32 user_rf_cal_sector_set(void)
|
||||
{
|
||||
flash_size_map size_map = system_get_flash_size_map();
|
||||
uint32 rf_cal_sec = 0;
|
||||
|
||||
switch (size_map) {
|
||||
case FLASH_SIZE_4M_MAP_256_256:
|
||||
rf_cal_sec = 128 - 5;
|
||||
break;
|
||||
|
||||
case FLASH_SIZE_8M_MAP_512_512:
|
||||
rf_cal_sec = 256 - 5;
|
||||
break;
|
||||
|
||||
case FLASH_SIZE_16M_MAP_512_512:
|
||||
case FLASH_SIZE_16M_MAP_1024_1024:
|
||||
rf_cal_sec = 512 - 5;
|
||||
break;
|
||||
|
||||
case FLASH_SIZE_32M_MAP_512_512:
|
||||
case FLASH_SIZE_32M_MAP_1024_1024:
|
||||
rf_cal_sec = 1024 - 5;
|
||||
break;
|
||||
|
||||
default:
|
||||
rf_cal_sec = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return rf_cal_sec;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : user_init
|
||||
* Description : entry of user application, init user function here
|
||||
* Parameters : none
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void user_init(void)
|
||||
{
|
||||
printf("SDK version:%s\n", system_get_sdk_version());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user