• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FLASH_Unlock函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Data_Save

void Data_Save(void)
{
	uint8_t count;
	uint8_t i,flag;
	LED4_on;
	flash_save[0].i32_data[0] = Gyro_Float;
	flash_save[0].i32_data[1] = 0x00000000;
	flash_save[1].f64_data = Gyro_Convert1;
	flash_save[2].f64_data = Gyro_Convert2;
	flash_save[3].f64_data = Encoders[0].Convert1;
	flash_save[4].f64_data = Encoders[0].Convert2;
	flash_save[5].f64_data = Encoders[0].Radius;
	flash_save[6].f64_data = Encoders[0].radian;
	flash_save[7].f64_data = Encoders[1].Convert1;
	flash_save[8].f64_data = Encoders[1].Convert2;
	flash_save[9].f64_data = Encoders[1].Radius;
	flash_save[10].f64_data = Encoders[1].radian;
	
	FLASH_Unlock();
	while(FLASH_GetFlagStatus(FLASH_FLAG_BSY)==1);
	
	FLASH_ErasePage(PAGE_ADDRESS);
	for(count=0;count < SAVEDATA_NUM;count++)
	{
		for(i=0;i<4;i++)
		{
			flag = 0;
			while(flag==0)
			{
				FLASH_ProgramHalfWord((PAGE_ADDRESS +count*8+i*2),flash_save[count].u16_data[i]);  //flash  为一个字节存储,16位数据必须地址加2
				if(flashread((PAGE_ADDRESS +count*8+i*2)) == (flash_save[count].u16_data[i]))
				{
					flag = 1;
					LED2_off;
				}
				else
					LED2_on;
			}
		}
	}
	while(FLASH_GetFlagStatus(FLASH_FLAG_BSY)==1);

	FLASH_Lock();
	
	LED4_off;
}
开发者ID:yihui-he,项目名称:Rotary-encoder-System,代码行数:46,代码来源:flash.c


示例17: FlashErase

/*******************************************************************************
* Function Name  : EraseFLASH
* Description    : Brisanje flash bloka
* Input          :
* Output         :
* Return         :
*******************************************************************************/
int					FlashErase(int n) {
int					i;
						if(n == _BOOT_SECTOR) 
							return(-1);
						FLASH_Unlock();
#if defined (STM32F10X_HD)
						FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);						
						do i=FLASH_ErasePage(n); while(i==FLASH_BUSY);
#elif defined  (STM32F2XX)
						FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR|FLASH_FLAG_PGSERR);	
						do i=FLASH_EraseSector(n, VoltageRange_3);	while(i==FLASH_BUSY);
#endif			
						if(i==FLASH_COMPLETE)
							return(0);
						else
							return(i);
}
开发者ID:yallawalla,项目名称:stm32,代码行数:24,代码来源:iap.c


示例18: Tekdaqc_SetCalibrationMode

/**
 * Enter calibration mode. NOTE: Calling this method will erase the calibration table.
 *
 * @param none
 * @retval FLASH_Status The status of the FLASH operations. Returns FLASH_COMPLETE on success.
 */
FLASH_Status Tekdaqc_SetCalibrationMode(void) {
	/* Enable the flash control register access */
	FLASH_Unlock();

	/* Clear pending flags (if any) */
	FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);

	FLASH_Status status = FLASH_COMPLETE;

	/* FLASH_OB_Unlock(); */

	/* Disable write protection for this sector */
	/*FLASH_OB_WRPConfig(CALIBRATION_WPSECTOR, DISABLE);

	 FLASH_OB_Launch(); */

	/* Erase the calibration sector */
	status = FLASH_EraseSector(CALIBRATION_SECTOR, FLASH_VOLTAGE_RANGE);
	if (status != FLASH_COMPLETE) {
		return status;
	}

	/* Program the user Flash area word by word area defined by FLASH_USER_START_ADDR and FLASH_USER_END_ADDR */
	uint32_t Address = ADDR_CALIBRATION_BASE;

	while (Address < ADDR_CALIBRATION_END) {
		status = FLASH_ProgramWord(Address, CALIBRATION_ERASE_DATA);
		if (status == FLASH_COMPLETE) {
			Address = Address + 4;
		} else {
			return status;
		}
	}

	/* Enable write protection for this sector */
	/*FLASH_OB_WRPConfig(CALIBRATION_WPSECTOR, ENABLE);

	 FLASH_OB_Launch();*/

	/* FLASH_OB_Lock(); */
	/* Disable the flash control register access */

	CalibrationModeEnabled = true;
	return status;
}
开发者ID:Tenkiv,项目名称:Tekdaqc-Firmware-Depricated,代码行数:51,代码来源:Tekdaqc_CalibrationTable.c


示例19: WriteflashBoatnum

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

	FlashAddress = StartAddr[0];
	for(i=0;i<4;i++)
	{
		FLASHStatus = FLASH_ProgramWord(FlashAddress, ((boatnum[i*4+3]<<24) + (boatnum[i*4+2]<<16) + (boatnum[i*4+1]<<8) + boatnum[i*4]));
		FlashAddress = FlashAddress + 4;
	}
}
开发者ID:baidcwsse,项目名称:NETMARK_W100,代码行数:24,代码来源:flashwr.c


示例20: STMFLASH_WriteOnePage

void STMFLASH_WriteOnePage(u32 WriteAddr,u16 *pBuffer,u16 NumToWrite)	
{
	u32 secpos;	   
	u32 offaddr;   
	if(WriteAddr<STM32_FLASH_BASE||(WriteAddr>=(STM32_FLASH_BASE+1024*STM32_FLASH_SIZE)))
		{
		return;
		}
	FLASH_Unlock();					
	
	offaddr=WriteAddr-STM32_FLASH_BASE;		
	secpos=offaddr/STM32_SECTOR_SIZE;			
	
	FLASH_ErasePage(secpos*STM32_SECTOR_SIZE+STM32_FLASH_BASE);
	STMFLASH_Write_NoCheck(WriteAddr,pBuffer,NumToWrite);		   	

	FLASH_Lock();
}
开发者ID:yanke928,项目名称:Kanade,代码行数:18,代码来源:stm32_flash.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FLA_COMPLEX_PTR函数代码示例发布时间:2022-05-30
下一篇:
C++ FLASH_SetLatency函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap