Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new non-OS SDK addition #8

Open
scaprile opened this issue Aug 22, 2016 · 0 comments
Open

new non-OS SDK addition #8

scaprile opened this issue Aug 22, 2016 · 0 comments

Comments

@scaprile
Copy link

hi there,
the new SDK for non-OS requires this function to be added in user_main:
`
/******************************************************************************

  • 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 : ABBBCDDD
    
  •            A : rf cal
    
  •            B : at parameters
    
  •            C : rf init data
    
  •            D : sdk parameters
    
  • Parameters : none

  • Returns : rf cal sector
    *******************************************************************************/
    uint32 ICACHE_FLASH_ATTR
    user_rf_cal_sector_set(void)
    {
    enum 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 - 8;
    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;
    }
    `

I don't know if it needs mods in your specific code, I just made it to compilation and haven't tested any further.
Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant