Exemplo n.º 1
0
uint8_t DataMem_Write(uint32_t addr, uint8_t * pu8Buffer, uint8_t size)
{
	uint32_t timeout = 10000;
	uint8_t i = 0;
	uint8_t state = 1;

	usr_assert(pu8Buffer != NULL);

	// Unlock flash data eeprom memory 
  	FLASH_Unlock(FLASH_MemType_Data);
	
  	// Wait until Data EEPROM area unlocked flag is set
  	while ((FLASH_GetFlagStatus(FLASH_FLAG_PUL) == RESET) && (timeout--))
  	{}

	if(timeout)
	{
		for(i = 0;i < size;i ++)
		{
			FLASH_ProgramByte(addr + i, *(pu8Buffer + i));
		}
		state = 1;
	}
	else
	{
		state = 0;
	}

	// Lock flash data eeprom memory 
  	FLASH_Lock(FLASH_MemType_Data);

	return (state);
}
Exemplo n.º 2
0
/***********************************************************************
  * @brief  Display the one icon.
  * @param  None
  * @retval None
************************************************************************/
static void LCD_SC_DispDigits(uint8_t * pSrc, uint8_t num)
{   
	uint8_t i = 0;

    /* Check parameters */
	usr_assert(pSrc != NULL);
	usr_assert(num);

	for(i = 0;i < num;i ++)
	{
		if(*(pSrc + i) != 0xFF)
		{
			dispBuffer[*(pSrc + i)](i);
		}
	}
}
Exemplo n.º 3
0
/**
  * @brief  Reads one byte from flash memory
  * @param  Address : Address to read
  * @retval Value of the byte
  */
uint8_t DataMem_ReadByte(uint32_t Address)
{
  	uint8_t tmp = 0;

	usr_assert((Address >= FLASH_DATA_EEPROM_START_PHYSICAL_ADDRESS) && 
				(Address <= FLASH_DATA_EEPROM_END_PHYSICAL_ADDRESS));
  
  	tmp = *(PointerAttr uint8_t *) (MemoryAddressCast)Address;

  	return tmp;
}
Exemplo n.º 4
0
int
afs_inactive(struct vcache *avc, afs_ucred_t *acred)
{
    if (afs_shuttingdown)
	return 0;

    usr_assert(avc->vrefCount == 0);
    afs_InactiveVCache(avc, acred);

    return 0;
}