コード例 #1
0
        public bool EraseMemory(uint address, uint length)
        {
            WireProtocol.Commands.Monitor_EraseMemory cmd = new WireProtocol.Commands.Monitor_EraseMemory();

            cmd.m_address = address;
            cmd.m_length = length;

            WireProtocol.IncomingMessage reply = SyncMessage(WireProtocol.Commands.c_Monitor_EraseMemory, 0, cmd, 2, 10000);

            return WireProtocol.IncomingMessage.IsPositiveAcknowledge(reply);
        }
コード例 #2
0
ファイル: Engine.cs プロジェクト: aura1213/netmf-interpreter
        public bool EraseMemory( uint address, uint length )
        {
            DebuggerEventSource.Log.EngineEraseMemory( address, length );
            var cmd = new Commands.Monitor_EraseMemory
                    {
                        m_address = address,
                        m_length = length
                    };

            // Magic number multiplier here is somewhat arbitrary. Assuming a max 250ms per 1KB block erase time.
            // (Given most chip erase times are measured in uSecs that's pretty generous 8^) )
            // The idea is to extend the timeout based on the actual length of the area being erased
            var timeout = ( int )( length / 1024 ) * 250;
            IncomingMessage reply = SyncMessage( Commands.c_Monitor_EraseMemory, 0, cmd, 2, timeout );

            return IncomingMessage.IsPositiveAcknowledge( reply );
        }