Пример #1
0
        public void identify()
        {
            port.DiscardInBuffer();

            //Console.WriteLine("0 " + DateTime.Now.Millisecond);
            // make sure we are in sync before starting
            self.__sync();

            //Console.WriteLine("1 "+DateTime.Now.Millisecond);

            //get the bootloader protocol ID first
            self.bl_rev = self.__getInfo(Info.BL_REV);

            // Console.WriteLine("2 " + DateTime.Now.Millisecond);
            if ((bl_rev < (int)BL_REV_MIN) || (bl_rev > (int)BL_REV_MAX))
            {
                throw new Exception("Bootloader protocol mismatch");
            }

            // revert to default write timeout
            port.WriteTimeout = 500;

            self.board_type = self.__getInfo(Info.BOARD_ID);
            self.board_rev  = self.__getInfo(Info.BOARD_REV);
            self.fw_maxsize = self.__getInfo(Info.FLASH_SIZE);
        }
Пример #2
0
        public void identify()
        {
            port.DiscardInBuffer();

            //Console.WriteLine("0 " + DateTime.Now.Millisecond);
            // make sure we are in sync before starting
            self.__sync();

            //Console.WriteLine("1 "+DateTime.Now.Millisecond);

            //get the bootloader protocol ID first
            self.bl_rev = self.__getInfo(Info.BL_REV);

            // Console.WriteLine("2 " + DateTime.Now.Millisecond);
            if ((bl_rev < (int)BL_REV_MIN) || (bl_rev > (int)BL_REV_MAX))
            {
                throw new Exception("Bootloader protocol mismatch");
            }

            print("Got BL Info - changing timeout");

            // revert to default write timeout
            port.WriteTimeout = 500;

            self.board_type = self.__getInfo(Info.BOARD_ID);
            self.board_rev  = self.__getInfo(Info.BOARD_REV);
            self.fw_maxsize = self.__getInfo(Info.FLASH_SIZE);

            if (bl_rev >= 5)
            {
                try
                {
                    self.chip      = self.__getCHIP();
                    self.chip_desc = self.__getCHIPDES();
                } catch { __sync(); }
            }

            if (bl_rev >= 5)
            {
                try
                {
                    self.extf_maxsize = __getInfo(Info.EXTF_SIZE);
                }
                catch { __sync(); }
            }

            Console.WriteLine("Found board type {0} brdrev {1} blrev {2} fwmax {3} extf {7} chip {5:X} chipdes {6} on {4}", board_type,
                              board_rev, bl_rev, fw_maxsize, port, chip, chip_desc, extf_maxsize);
        }
Пример #3
0
        public void identify()
        {
            //Console.WriteLine("0 " + DateTime.Now.Millisecond);
            // make sure we are in sync before starting
            self.__sync();

            //Console.WriteLine("1 "+DateTime.Now.Millisecond);

            //get the bootloader protocol ID first
            self.bl_rev = self.__getInfo(Code.INFO_BL_REV);

            // Console.WriteLine("2 " + DateTime.Now.Millisecond);
            if ((bl_rev < (int)Code.BL_REV_MIN) || (bl_rev > (int)Code.BL_REV_MAX))
            {
                throw new Exception("Bootloader protocol mismatch");
            }

            self.board_type = self.__getInfo(Code.INFO_BOARD_ID);
            self.board_rev  = self.__getInfo(Code.INFO_BOARD_REV);
            self.fw_maxsize = self.__getInfo(Code.INFO_FLASH_SIZE);
        }