示例#1
0
uint32_t platform_flash_get_first_free_block_address( uint32_t *psect )
{
  // Round the total used flash size to the closest flash block address
  uint32_t start, end, sect;
  NODE_DBG("_flash_used_end:%08x\n", (uint32_t)_flash_used_end);
  if(_flash_used_end>0){ // find the used sector
    sect = flashh_find_sector( platform_flash_mapped2phys ( (uint32_t)_flash_used_end - 1), NULL, &end );
    if( psect )
      *psect = sect + 1;
    return end + 1;
  }else{
    sect = flashh_find_sector( 0, &start, NULL ); // find the first free sector
    if( psect )
      *psect = sect;
    return start;
  }
}
示例#2
0
uint32_t platform_flash_get_first_free_block_address( uint32_t *psect )
{
  // Round the total used flash size to the closest flash block address
  uint32_t start, end, sect;
  NODE_DBG("_flash_used_end:%08x\n", (uint32_t)_flash_used_end);
  if(_flash_used_end>0){ // find the used sector
    // sect = flashh_find_sector( ( uint32_t )flash_used_size + INTERNAL_FLASH_START_ADDRESS - 1, NULL, &end );
    sect = flashh_find_sector( ( uint32_t )_flash_used_end - 1, NULL, &end );
    if( psect )
      *psect = sect + 1;    
    return end + 1;
  }else{
    sect = flashh_find_sector( INTERNAL_FLASH_START_ADDRESS, &start, NULL ); // find the first free sector
    if( psect )
      *psect = sect;   
    return start;
  }
}
示例#3
0
文件: common.c 项目: louismdavis/elua
u32 platform_flash_get_first_free_block_address( u32 *psect )
{
  // Round the total used flash size to the closest flash block address
  u32 temp, sect;

  sect = flashh_find_sector( ( u32 )flash_used_size + INTERNAL_FLASH_START_ADDRESS - 1, NULL, &temp );
  if( psect )
    *psect = sect + 1;
  return temp + 1;
}
示例#4
0
uint32_t platform_flash_get_sector_of_address( uint32_t addr )
{
  return flashh_find_sector( addr, NULL, NULL );
}
示例#5
0
文件: common.c 项目: louismdavis/elua
u32 platform_flash_get_sector_of_address( u32 addr )
{
  return flashh_find_sector( addr, NULL, NULL );
}