Example #1
0
        public static void SaveSRAM()
        {
            if (board != null)
            {
                if (SaveSRAMAtShutdown && board.SRAMSaveRequired)
                {
                    Trace.WriteLine("Saving SRAM ...");
                    byte[] sramBuffer = new byte[0];
                    ZlipWrapper.CompressData(board.GetSRAMBuffer(), out sramBuffer);

                    Stream str = new FileStream(SRAMFileName, FileMode.Create, FileAccess.Write);
                    str.Write(sramBuffer, 0, sramBuffer.Length);

                    str.Flush();
                    str.Close();
                    Trace.WriteLine("SRAM saved successfully.");
                }
            }
        }