コード例 #1
0
        private bool OnReadExternalFlashCompleted(Operation operation, bool success, out MemoryImage readMemory)
        {
            readMemory = null;

            if (success)
            {
                var readFlashOperation = (ReadExternalFlashOperation)operation;

                //we only want the data out of the memory images read, since we already know which memory layout is being used
                var readSectorData = new List <byte[]>();
                foreach (var sector in readFlashOperation.FlashBlockList)
                {
                    readSectorData.Add(sector.RawData);
                }

                if (!MemoryUtils.CombineMemorySectorsIntoImage(readSectorData, FlashMemoryLayout, out readMemory))
                {
                    App.DisplayStatusMessage("Failed to combine memory sectors into one memory image", StatusMessageType.USER);
                    success = false;
                }
            }

            return(success);
        }