diff --git a/fpga_io.cpp b/fpga_io.cpp index 9f892ba..1582bfb 100644 --- a/fpga_io.cpp +++ b/fpga_io.cpp @@ -83,7 +83,7 @@ int fpga_load_rbf(const char *name, const char *cfg, const char *xml) if (cfg) { - fpga_core_reset(1); + fpga_core_reset(); make_env(name, cfg); //do_bridge(0); reboot(0); @@ -173,7 +173,7 @@ int fpga_get_io_type() void reboot(int cold) { sync(); - fpga_core_reset(1); + fpga_core_reset(); usleep(500000); @@ -195,7 +195,7 @@ char *getappname() void app_restart(const char *path, const char *xml) { sync(); - fpga_core_reset(1); + fpga_core_reset(); input_switch(0); input_uinp_destroy(); @@ -210,10 +210,12 @@ void app_restart(const char *path, const char *xml) reboot(1); } -void fpga_core_reset(int reset) +void fpga_core_reset() { - printf("fpga_core_reset(%d)\n", reset); - gpiod_line_set_value(gpio_line_fpga_reset, reset); + printf("fpga_core_reset()\n"); + gpiod_line_set_value(gpio_line_fpga_reset, 1); + usleep(100000); + gpiod_line_set_value(gpio_line_fpga_reset, 0); } int is_fpga_ready(int quick) @@ -263,7 +265,7 @@ void fpga_wait_to_reset() printf("FPGA is not ready. JTAG uploading?\n"); printf("Waiting for FPGA to be ready...\n"); - fpga_core_reset(1); + fpga_core_reset(); while (!is_fpga_ready(0)) { diff --git a/fpga_io.h b/fpga_io.h index e72b6b3..ecd6a9d 100644 --- a/fpga_io.h +++ b/fpga_io.h @@ -24,7 +24,7 @@ void fpga_set_led(uint32_t on); int fpga_get_buttons(); int fpga_get_io_type(); -void fpga_core_reset(int reset); +void fpga_core_reset(); int fpga_core_id(); int is_fpga_ready(int quick);