Skip to content

Commit

Permalink
Fixing v1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Spagett1 committed Apr 22, 2023
1 parent ceb1fb0 commit f91b752
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@
/release-out
/release-build
/tools
/PineFlash_Installer.exe
/PineFlash_Installer.exe
/pineflash*
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pineflash"
version = "0.4.5"
version = "0.4.7"
edition = "2021"
build = "build.rs"

Expand Down
2 changes: 1 addition & 1 deletion Package_Windows_Release.iss
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "PineFlash"
#define MyAppVersion "0.4.5"
#define MyAppVersion "0.4.7"
#define MyAppPublisher "Spagett"
#define MyAppURL "https://github.com/Spagett1"
#define MyAppExeName "pineflash.exe"
Expand Down
23 changes: 8 additions & 15 deletions src/submodules/flash.rs
Expand Up @@ -5,15 +5,6 @@ use std::io::{Read, Cursor};
use std::path::PathBuf;
#[cfg(target_os = "windows")]
use std::os::windows::process::CommandExt;
#[cfg(target_family = "unix")]
static DFU_COMMAND: &str = "dfu-util";
#[cfg(target_family = "unix")]
static BLISP_COMMAND: &str = "blisp";
#[cfg(target_os = "windows")]
static DFU_COMMAND: &str = "dfu-util.exe";
#[cfg(target_os = "windows")]
static BLISP_COMMAND: &str = "blisp.exe";


use crate::Flasher;

Expand Down Expand Up @@ -57,21 +48,23 @@ impl Flasher {

#[cfg(target_os = "linux")]
let command = Command::new("pkexec")
.arg(DFU_COMMAND)
.arg("dfu-util")
.arg("-D")
.arg(firmware_path)
.output()
.expect("Could not flash soldering iron");

#[cfg(target_os = "macos")]
let command = Command::new(DFU_COMMAND)
let command = Command::new("dfu-util")
.arg("-D")
.arg(firmware_path)
.output()
.expect("Could not flash soldering iron");

#[cfg(target_os = "windows")]
let command = Command::new(DFU_COMMAND)
let command: PathBuf = [ std::env::current_dir().unwrap(), "tools".into(), "dfu-util.exe".into() ].iter().collect();
#[cfg(target_os = "windows")]
let command = Command::new(command)
.creation_flags(0x00000008)
.arg("-D")
.arg(firmware_path)
Expand All @@ -91,7 +84,7 @@ impl Flasher {
} else if self.config.int_name == "Pinecilv2" {
#[cfg(target_os = "linux")]
let command = Command::new("pkexec")
.arg(BLISP_COMMAND)
.arg("blisp")
.arg("write")
.arg("-c")
.arg("bl70x")
Expand All @@ -103,7 +96,7 @@ impl Flasher {
.expect("Could not flash soldering iron");

#[cfg(target_os = "macos")]
let command = Command::new(BLISP_COMMAND)
let command = Command::new("blisp")
.arg("write")
.arg("-c")
.arg("bl70x")
Expand All @@ -115,7 +108,7 @@ impl Flasher {
.expect("Could not flash soldering iron");

#[cfg(target_family = "windows")]
let command: PathBuf = [ std::env::current_dir().unwrap(), "tools".into(), BLISP_COMMAND.into() ].iter().collect();
let command: PathBuf = [ std::env::current_dir().unwrap(), "tools".into(), "blisp.exe".into() ].iter().collect();

#[cfg(target_os = "windows")]
let command = Command::new(command)
Expand Down
12 changes: 6 additions & 6 deletions src/submodules/main_panel.rs
Expand Up @@ -91,14 +91,14 @@ impl Flasher {

});

if self.config.picked_path.is_some() || //&&
// self.config.iron_connected.as_ref() == Some(&self.config.int_name) ||
// self.config.iron_connected.as_ref() == Some(&"Both".to_string()) ||
if self.config.picked_path.is_some() &&
self.config.iron_connected.as_ref() == Some(&self.config.int_name) ||
self.config.iron_connected.as_ref() == Some(&"Both".to_string()) ||
self.config.version != *"Custom" &&
self.config.version != *"Select" &&
!self.config.download //&&
// self.config.iron_connected.as_ref() == Some(&self.config.int_name) ||
// self.config.iron_connected.as_ref() == Some(&"Both".to_string())
!self.config.download &&
self.config.iron_connected.as_ref() == Some(&self.config.int_name) ||
self.config.iron_connected.as_ref() == Some(&"Both".to_string())
{
self.config.ready_to_flash = true

Expand Down

0 comments on commit f91b752

Please sign in to comment.