Skip to content

Commit db77c46

Browse files
committed
function name fix
1 parent 67529b9 commit db77c46

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ fn main() -> Result<()> {
219219
if !(enter ^ quit) {
220220
println!("Please choose one mode to switch, either --enter or --quit");
221221
} else if enter {
222-
WchLink::enter_iap(device_index)?;
222+
WchLink::iap_enter(device_index)?;
223223
} else {
224-
WchLink::quit_iap(device_index)?;
224+
WchLink::iap_quit(device_index)?;
225225
}
226226
}
227227
Some(Commands::List {}) => {

src/probe.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl WchLink {
187187

188188
/// Switch IAP mode
189189
// ref: https://github.com/cjacker/wlink-iap/blob/main/src/main.c
190-
pub fn enter_iap(nth: usize) -> Result<()> {
190+
pub fn iap_enter(nth: usize) -> Result<()> {
191191

192192
// Check device mode
193193
let vid; let pid; let endp_out;
@@ -206,19 +206,19 @@ impl WchLink {
206206
}
207207

208208
let mut dev = crate::usb_device::open_nth(vid, pid, nth)?;
209-
log::info!("Enter IAP mode");
210209

210+
log::info!("Enter IAP mode");
211211
let buf = [0x81, 0x0f, 0x01, 0x01];
212212
log::trace!("send {} {}", hex::encode(&buf[..3]), hex::encode(&buf[3..]));
213213
let _ = dev.write_endpoint(endp_out, &buf);
214214

215215
Ok(())
216216
}
217217

218-
pub fn quit_iap(nth: usize) -> Result<()> {
218+
pub fn iap_quit(nth: usize) -> Result<()> {
219219
let mut dev = crate::usb_device::open_nth(VENDOR_ID_IAP, PRODUCT_ID_IAP, nth)?;
220-
log::info!("Quit IAP mode");
221220

221+
log::info!("Quit IAP mode");
222222
let buf = [0x83, 0x02, 0x00, 0x00];
223223
log::trace!("send {} {}", hex::encode(&buf[..3]), hex::encode(&buf[3..]));
224224
let _ = dev.write_endpoint(ENDPOINT_OUT_IAP, &buf);

0 commit comments

Comments
 (0)