Просмотр исходного кода

fix(zephyr): Replace the deprecated timer API use

This replaces the use of the deprecated one-shot timer API use with the
new one and replaces the use of the port API in the zephyr example with
the loader API use.

Closes https://github.com/espressif/esp-serial-flasher/pull/82
Djordje Nedic 2 лет назад
Родитель
Сommit
2f0611cf60
3 измененных файлов с 3 добавлено и 5 удалено
  1. 1 3
      examples/zephyr_example/src/main.c
  2. 1 1
      idf_component.yml
  3. 1 1
      port/zephyr_port.c

+ 1 - 3
examples/zephyr_example/src/main.c

@@ -75,9 +75,7 @@ int main(void)
 		flash_binary(bin.app.data,  bin.app.size,  bin.app.addr);
 		flash_binary(bin.app.data,  bin.app.size,  bin.app.addr);
 	}
 	}
 
 
-	loader_port_change_transmission_rate(DEFAULT_BAUDRATE);
-
-	loader_port_reset_target();
+	esp_loader_reset_target();
 
 
 	return 0;
 	return 0;
 }
 }

+ 1 - 1
idf_component.yml

@@ -1,3 +1,3 @@
-version: "0.4.1"
+version: "0.4.2"
 description: Serial flasher component provides portable library for flashing or loading ram loadble app to Espressif SoCs from other host microcontroller
 description: Serial flasher component provides portable library for flashing or loading ram loadble app to Espressif SoCs from other host microcontroller
 url: https://github.com/espressif/esp-serial-flasher
 url: https://github.com/espressif/esp-serial-flasher

+ 1 - 1
port/zephyr_port.c

@@ -139,7 +139,7 @@ static uint64_t s_time_end;
 
 
 void loader_port_start_timer(uint32_t ms)
 void loader_port_start_timer(uint32_t ms)
 {
 {
-    s_time_end = sys_clock_timeout_end_calc(Z_TIMEOUT_MS(ms));
+    s_time_end = sys_timepoint_calc(Z_TIMEOUT_MS(ms)).tick;
 }
 }
 
 
 uint32_t loader_port_remaining_time(void)
 uint32_t loader_port_remaining_time(void)