示例#1
0
void cliFunc_storage( char* args )
{
	print( NL );
	print("Page: ");
	printHex( storage_page_position() );
	print(", Block: ");
	printHex( storage_block_position() );
	print( NL );
	print("Address: ");
	printHex32((STORAGE_FLASH_START
		+ storage_page_position() * STORAGE_FLASH_PAGE_SIZE)
		+ (storage_block_position() * (STORAGE_SIZE + 1))
	);
	print( NL );
	print("Cleared?: ");
	printInt8( storage_is_storage_cleared() );
	print( NL );

	for (uint8_t i=0; i<module_count; i++) {
		print( NL "\033[1;32m" );
		print(storage_modules[i]->name);
		print(" Storage\033[0m" NL );
		storage_modules[i]->display();
	}
}
示例#2
0
// Called after firmware download has completed, but before reseting and jumping to firmware
void Chip_download_complete()
{
	// Make sure the last page of non-volatile memory has been cleared
	switch ( storage_clear_page() )
	{
	case 0:
		print("Flash was not cleared." NL);
		break;
	default:
		print("Flashed cleared!" NL);
		break;
	}
	print(" Page: ");
	printHex( storage_page_position() );
	print( " Block: ");
	printHex( storage_block_position() );
	print( NL );
}