return p.returncode def _check_progress(self, line): initialized = re.search('initialized', line) if initialized: self._logger.debug("Device initialized") self._send_progress_update("busy", "flash_read") read = re.search('reading input', line) if read: self._logger.debug("Hex file read") self._send_progress_update("done", "flash_read") self._send_progress_update("busy", "flash_write") written = re.search('flash written', line) if written: self._logger.debug("Hex file written to flash") self._send_progress_update("done", "flash_write") self._send_progress_update("busy", "flash_verify") verified = re.search('flash verified', line) if verified: self._logger.debug("Hex file verified on flash") self._send_progress_update("done", "flash_verify") self._send_progress_update("busy", "flash_done") self._send_result_update("success") done = 'avrdude' in line and 'done' in line if done: self._logger.debug("Flashing hex file done") self._send_progress_update("done", "flash_done") register_programmer(AVRDudeProgrammer("avrdude"))
return p.returncode def _check_progress(self, line): erase = re.search('Erase', line) if erase: self._logger.debug("Device erased") self._send_progress_update("busy", "bossac_erase") self._send_progress_update("done", "bossac_erase") self._send_progress_update("busy", "bossac_write") return written = re.search('Verify', line) and not re.search('successful', line) if written: self._logger.debug("Hex file written to flash") self._send_progress_update("done", "bossac_write") self._send_progress_update("busy", "bossac_verify") return verified = re.search('Verify successful', line) if verified: self._logger.debug("Hex file verified on flash") self._send_progress_update("done", "bossac_verify") self._send_progress_update("busy", "bossac_done") self._send_result_update("success") return done = re.search('CPU reset', line) if done: self._logger.debug("Flashing hex file done") self._send_progress_update("done", "bossac_done") register_programmer(BossacProgrammer("bossac"))