async void esp32_write()
{
serialPort1.WriteLine("\\_test_");
await Task.Run(() =>
{
for (int i = 0;
i < file_bytes.Length && update_esp32 && serialPort1.IsOpen;
i++)
{
serialPort1.Write(file_bytes, i, 1);
label6.Text = (i + 1).ToString();
progressBar1.Value = i + 1;
}
});
btn_sendESP32.Text = "Загрузить";
}