anchor.diff:    MainForm.ProgressBar.Position := 0;
   end;
   
  +procedure SelectHW(programmer: integer);
  +begin
  +  if programmer = HW_USBASP then
  +  begin
  +    MainForm.MenuSPIClock.Enabled:= true;
  +    MainForm.MenuMicrowire.Enabled:= true;
  +    MainForm.RadioI2C.Enabled:= true;
  +    MainForm.RadioMw.Enabled:= true;
  +    MainForm.MenuChip.Find('I2C').Enabled:= true;
  +    MainForm.MenuChip.Find('Microwire').Enabled:= true;
  +    CH341 := false;
  +  end;
  +
  +  if programmer = HW_CH341A then
  +  begin
  +    MainForm.MenuSPIClock.Enabled:= false;
  +    MainForm.MenuMicrowire.Enabled:= false;
  +    MainForm.RadioI2C.Enabled:= false;
  +    MainForm.RadioMw.Enabled:= false;
  +    MainForm.RadioSPI.Checked:= true;
  +    MainForm.MenuChip.Find('I2C').Enabled:= false;
  +    MainForm.MenuChip.Find('Microwire').Enabled:= false;
  +    CH341 := true;
  +  end;
  +
  +end;
  +
   procedure LockControl;
   begin
     //MainForm.ToolBar.Enabled := false;
  
positive.code:   SPI_CMD_KB             = 2;
    SPI_CMD_95             = 3;
  
  
  var
    MainForm: TMainForm;
  
negative.code:   TimeCounter := Time();
  
    for i:=0 to cycles do
    begin
      UsbAsp25_Read(hUSBdev, 0, 0, buffer, sizeof(buffer));
      Application.ProcessMessages;
      if MainForm.ButtonCancel.Tag <> 0 then
        begin
          LogPrint(STR_USER_CANCEL, clRed);
          Break;
        end;
    end;
  
    t :=  Time() - TimeCounter;
  
    LogPrint(STR_TIME + TimeToStr(t)+' '+
      IntToStr( (cycles*sizeof(buffer)) div ((StrToInt(FormatDateTime('nn',t)) * 60) + StrToInt(FormatDateTime('ss',t)))) +' bytes/s');
    ExitProgMode25(hUSBdev);
    USB_Dev_Close(hUSBdev);
    UnlockControl();
  end;
  
  procedure TMainForm.MenuItemEditSregClick(Sender: TObject);
  