当前位置: 首页>>代码示例>>C++>>正文


C++ FLASH_Unlock函数代码示例

本文整理汇总了C++中FLASH_Unlock函数的典型用法代码示例。如果您正苦于以下问题:C++ FLASH_Unlock函数的具体用法?C++ FLASH_Unlock怎么用?C++ FLASH_Unlock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FLASH_Unlock函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: conf_general_init

void conf_general_init(void) {
	// First, make sure that all relevant virtual addresses are assigned for page swapping.
	memset(VirtAddVarTab, 0, sizeof(VirtAddVarTab));

	int ind = 0;
	for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) {
		VirtAddVarTab[ind++] = EEPROM_BASE_MCCONF + i;
	}

	for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) {
		VirtAddVarTab[ind++] = EEPROM_BASE_APPCONF + i;
	}

	FLASH_Unlock();
	EE_Init();
}
开发者ID:xin198365,项目名称:bldc,代码行数:16,代码来源:conf_general.c

示例2: Flash_SaveLastGUI

void Flash_SaveLastGUI(void)
{
	uint8 buff[1024] = {0};

  FLASH_Unlock(); 
	FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR );
	if(FLASH_COMPLETE != FLASH_ErasePage(STORE_LAST_GUI_PAGE_ADDR))
	{
    return;
  }
	memcpy(buff, (uint8*)&backgroud, 1024);
	
  Flash_WriteData(STORE_LAST_GUI_PAGE_ADDR, (uint16*)buff, 1024/2);

	FLASH_Lock();
}
开发者ID:wangxubo1988,项目名称:smart_tag,代码行数:16,代码来源:app_flash.c

示例3: Flash_SaveTagState

void Flash_SaveTagState(void)
{
	uint8 buff[64] = {0};

  FLASH_Unlock(); 
	FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR );
	if(FLASH_COMPLETE != FLASH_ErasePage(STORE_SYS_STATE_PAGE_ADDR))
	{
    return;
  }
	memcpy(buff, (uint8*)&state_para.ackflag_set, sizeof(state_para));
	
  Flash_WriteData(STORE_SYS_STATE_PAGE_ADDR, (uint16*)buff, (sizeof(state_para)+1)/2);

	FLASH_Lock();
}
开发者ID:wangxubo1988,项目名称:smart_tag,代码行数:16,代码来源:app_flash.c

示例4: Flash_WritePageU8

/*=====================================================================================================*/
int8_t Flash_WritePageU8( uint32_t writeAddr, const uint8_t *writeData, uint32_t lens )
{
  int8_t status = ERROR;
  uint32_t count = 0;

  FLASH_Unlock();
  FLASH_ClearFlag(FLASH_FLAG_EOP    | FLASH_FLAG_OPERR  | FLASH_FLAG_WRPERR |
                  FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);

  do {
    status = FLASH_ProgramByte(writeAddr + count, writeData[count]);
  } while((++count < lens) && (status == FLASH_COMPLETE));
  FLASH_Lock();

  return status;
}
开发者ID:KitSprout,项目名称:KDWM1000,代码行数:17,代码来源:stm32f4_flash.c

示例5: PIOS_Flash_Internal_StartTransaction

static int32_t PIOS_Flash_Internal_StartTransaction(uintptr_t flash_id)
{
	struct pios_internal_flash_dev * flash_dev = (struct pios_internal_flash_dev *)flash_id;

	if (!PIOS_Flash_Internal_Validate(flash_dev))
		return -1;

#if defined(PIOS_INCLUDE_FREERTOS)
	if (xSemaphoreTake(flash_dev->transaction_lock, portMAX_DELAY) != pdTRUE)
		return -2;
#endif	/* defined(PIOS_INCLUDE_FREERTOS) */

	/* Unlock the internal flash so we can write to it */
	FLASH_Unlock();
	return 0;
}
开发者ID:johnm1,项目名称:flyingf4_int_flash,代码行数:16,代码来源:pios_flash_internal.c

示例6: erase_flash_page

void erase_flash_page(uint32_t page_addr)
{
	FLASH_Status FLASHStatus = FLASH_COMPLETE;

	__disable_irq();
	FLASH_Unlock();

	FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);	

	FLASHStatus = FLASH_ErasePage(page_addr);
	if(FLASHStatus != FLASH_COMPLETE)
		myprintf("FLASH_ErasePage Error\r\n");

	FLASH_Lock();
	__enable_irq();
}
开发者ID:Wiznet,项目名称:WIZ550web,代码行数:16,代码来源:flashHandler.c

示例7: hal_nvm_init_sector

int hal_nvm_init_sector(HAL_NVM_HANDLE handle, unsigned long address)
{
    int sector = get_sector(address);
    int rv = HAL_NVM_E_SUCCESS;

    FLASH_Unlock();

    if (FLASH_EraseSector(sector, VoltageRange_3) != FLASH_COMPLETE)
    {
        rv = HAL_NVM_E_ERROR;
    }

    FLASH_Lock();

    return rv;
}
开发者ID:BGCX261,项目名称:zhonx2-git,代码行数:16,代码来源:hal_nvm.c

示例8: clear_CardID

//----清除全部刷卡记录-----------------------------------------------------
void clear_CardID()
{
	 char DateSt[12], TimeSt[12];

	storeaddrlist.RecordCount = 0;
	storeaddrlist.CountAddrOffset = 0;
	timeoutaddrlist.RecordCount = 0;
	timeoutaddrlist.CountAddrOffset = 0;
	LastSaveTime = GetRTC(DateSt, TimeSt);///获取当前时间,秒数 //需要优化;
	//清除记录区
  	FLASH_Unlock();
  	FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
	FLASH_ErasePage(PLACELASTID); 
	FLASH_ErasePage(POINTOFSECTION);   
  	FLASH_Lock();
}
开发者ID:fanqh,项目名称:stm32f103_RFID-cola-,代码行数:17,代码来源:file.c

示例9: WriteflashBoatInfo

/***********************************************************
 * 函数名:WriteflashBoatInfo
 * 描述  :把activation_flag从CPU写入Flash,位置信息
 * 输入  : 无
 * 输出  : 无
 ***********************************************************/
void WriteflashBoatInfo(void) 
{
	FLASHStatus = FLASH_COMPLETE;
	MemoryProgramStatus = PASSED; 
	FLASH_Unlock();	//FLASH解锁
	FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);//清标志位
	
	NbrOfPage = (EndAddr[7] - StartAddr[7]) / FLASH_PAGE_SIZE; //页面擦除子程序
	FLASHStatus = FLASH_ErasePage(StartAddr[7] + (FLASH_PAGE_SIZE * NbrOfPage)); 

	FlashAddress = StartAddr[7]; 

	FLASHStatus = FLASH_ProgramWord(FlashAddress, boatlong);
	FlashAddress = FlashAddress + 4;
	FLASHStatus = FLASH_ProgramWord(FlashAddress, boatwidth);
}
开发者ID:baidcwsse,项目名称:NETMARK_W100,代码行数:22,代码来源:flashwr.c

示例10: FLASH_Config

void FLASH_Config(void)
{
 /* Define flash programming Time*/
  FLASH_SetProgrammingTime(FLASH_PROGRAMTIME_STANDARD);
/*
  FLASH_Unlock(FLASH_MEMTYPE_PROG);
  // Wait until Flash Program area unlocked flag is set
  while (FLASH_GetFlagStatus(FLASH_FLAG_PUL) == RESET)
  {}
*/
  /* Unlock flash data eeprom memory */
  FLASH_Unlock(FLASH_MEMTYPE_DATA);
  /* Wait until Data EEPROM area unlocked flag is set*/
  while (FLASH_GetFlagStatus(FLASH_FLAG_DUL) == RESET)
  {}
}
开发者ID:ivandevel,项目名称:DSS-80E,代码行数:16,代码来源:main.c

示例11: Flash_SaveTagInfo

void Flash_SaveTagInfo(void)
{
	uint8 buff[1024] = {0};

  FLASH_Unlock(); 
	FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR );
	if(FLASH_COMPLETE != FLASH_ErasePage(STORE_SYS_INFO_PAGE_ADDR))
	{
    return;
  }
	memcpy(buff, (uint8*)&tag_flash_info.net_flag_set, sizeof(tag_flash_info));
	
  Flash_WriteData(STORE_SYS_INFO_PAGE_ADDR, (uint16*)buff, (sizeof(tag_flash_info)+1)/2);

	FLASH_Lock();
}
开发者ID:wangxubo1988,项目名称:smart_tag,代码行数:16,代码来源:app_flash.c

示例12: FLASH_Erase

/**-----------------------------------------------------------------------------
 * @brief	Effacement d'un secteur de Flash.
 *
 * @param[in]	FlashSector	Secteur a effacer.
 *
 * @return		Status	Statut de l'ecriture.
 */
uint8_t FLASH_Erase(uint8_t FlashSector)
{
	uint32_t FLASH_Sector;
	FLASH_Status Status;

	// Effacement du secteur
	switch (FlashSector)
	{
		case 0:		FLASH_Sector = FLASH_Sector_0;	break;
		case 1:		FLASH_Sector = FLASH_Sector_1;	break;
		case 2:		FLASH_Sector = FLASH_Sector_2;	break;
		case 3:		FLASH_Sector = FLASH_Sector_3;	break;
		case 4:		FLASH_Sector = FLASH_Sector_4;	break;
		case 5:		FLASH_Sector = FLASH_Sector_5;	break;
		case 6:		FLASH_Sector = FLASH_Sector_6;	break;
		case 7:		FLASH_Sector = FLASH_Sector_7;	break;
		case 8:		FLASH_Sector = FLASH_Sector_8;	break;
		case 9:		FLASH_Sector = FLASH_Sector_9;	break;
		case 10:	FLASH_Sector = FLASH_Sector_10;	break;
		case 11:	FLASH_Sector = FLASH_Sector_11;	break;
		case 0xFF:	FLASH_Sector = 0xFF;			break;
		default:	return Status_KO;				break;

	}

	// Desactivation des interruptions
	__disable_irq();

	// Deverrouillage de la flash
	FLASH_Unlock();

	if (FLASH_Sector == 0xFF)
		Status = FLASH_EraseAllSectors(VoltageRange_3);
	else
		Status = FLASH_EraseSector(FLASH_Sector, VoltageRange_3);

	// Verrouillage de la flash
	FLASH_Lock();

	// ReActivation des interruptions
	__enable_irq();

	if (Status == FLASH_COMPLETE)
		return Status_OK;

	return Status_KO;
}
开发者ID:jdaheron,项目名称:BLDR,代码行数:54,代码来源:drv_FLASH.c

示例13: bsp_MCU_Write

u8* bsp_MCU_Write(u8* writebuffer,u8 blockid,u16 writelength)
{	
	
	u8 status=0;
	u16 index=0;
	SleepTime=0;
	__set_PRIMASK(1);  
	memcpy(MCU_ROM_Write,(u8*)ADDR_FLASH_SECTOR_7,1024+16); //在擦除之前,先把数据读出来放在内存buffer
	__set_PRIMASK(0);  
	
  if(blockid==1)
	{
		memcpy(MCU_ROM_Write,writebuffer,writelength); //将512byte数据写入第一个block区域
	}
	if(blockid==2)
	{
		memcpy(MCU_ROM_Write+512,writebuffer,writelength); //将512byte数据写入第二个block区域
	}
	
	FLASH_Unlock();									//解锁 
  FLASH_DataCacheCmd(DISABLE);//FLASH擦除期间,必须禁止数据缓存
 	FLASH_ClearFlag(FLASH_FLAG_EOP|FLASH_FLAG_OPERR|FLASH_FLAG_WRPERR|  FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR|FLASH_FLAG_PGSERR);
	status=FLASH_EraseSector(FLASH_Sector_7 ,VoltageRange_3);//VCC=2.7~3.6V之间!!

	if(status==FLASH_COMPLETE)
	{
   __set_PRIMASK(1);  
		  for(index=0;index<(1024+16);index++)
		{
			status=FLASH_ProgramByte(ADDR_FLASH_SECTOR_7+index,MCU_ROM_Write[index]);  //SysID
		}
   __set_PRIMASK(0);  
	}
	
  FLASH_DataCacheCmd(ENABLE);	//FLASH擦除结束,开启数据缓存
	FLASH_Lock();//上锁	
	if(status==FLASH_COMPLETE)
	{
		MCU_WriteStatus=0;
	}
	else
	{
		MCU_WriteStatus=status;
	}
	return &MCU_WriteStatus;
		
}
开发者ID:CaptainJe,项目名称:BlueShiled,代码行数:47,代码来源:bsp_FileSystem.c

示例14: mal_flash_erase_page

mal_error_e mal_flash_erase_page(uint32_t page) {
	// Unlock flash registers
	FLASH_Unlock();
	// Clear pending flags
	FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPERR);
	// Erase page
	FLASH_Status result;
	uint32_t offset = mal_flash_get_page_size(page) * page;
	result = FLASH_ErasePage(FLASH_START_ADDRESS + offset);
	// Lock flash registers
	FLASH_Lock();
	// Return result
	if (FLASH_COMPLETE != result) {
		return MAL_ERROR_MEMORY;
	}
	return MAL_ERROR_OK;
}
开发者ID:MAL-Organization,项目名称:MAL,代码行数:17,代码来源:mal_hspec_stm32f0_flash.c

示例15: IAC_Init

void IAC_Init(void)
{
	 delay_init(72);
	 MCO_INIT();
	 Nvic_Init(); 
   LED_GPIO_Config();	
   I2C_INIT();
	 delay(0XFFF);
	 TIM3_Init(2500);
	 usart1_config();
	 ADC1_Init();	
	 NRF24L01_Init();
   Moto_Init();	
	 LED_SHOW();
	 FLASH_Unlock();
	 EE_Init();
}
开发者ID:zjh3123629,项目名称:Air-Nano,代码行数:17,代码来源:app.c


注:本文中的FLASH_Unlock函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。