@@ -187,7 +187,7 @@ impl WchLink {
187
187
188
188
/// Switch IAP mode
189
189
// 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 < ( ) > {
191
191
192
192
// Check device mode
193
193
let vid; let pid; let endp_out;
@@ -206,19 +206,19 @@ impl WchLink {
206
206
}
207
207
208
208
let mut dev = crate :: usb_device:: open_nth ( vid, pid, nth) ?;
209
- log:: info!( "Enter IAP mode" ) ;
210
209
210
+ log:: info!( "Enter IAP mode" ) ;
211
211
let buf = [ 0x81 , 0x0f , 0x01 , 0x01 ] ;
212
212
log:: trace!( "send {} {}" , hex:: encode( & buf[ ..3 ] ) , hex:: encode( & buf[ 3 ..] ) ) ;
213
213
let _ = dev. write_endpoint ( endp_out, & buf) ;
214
214
215
215
Ok ( ( ) )
216
216
}
217
217
218
- pub fn quit_iap ( nth : usize ) -> Result < ( ) > {
218
+ pub fn iap_quit ( nth : usize ) -> Result < ( ) > {
219
219
let mut dev = crate :: usb_device:: open_nth ( VENDOR_ID_IAP , PRODUCT_ID_IAP , nth) ?;
220
- log:: info!( "Quit IAP mode" ) ;
221
220
221
+ log:: info!( "Quit IAP mode" ) ;
222
222
let buf = [ 0x83 , 0x02 , 0x00 , 0x00 ] ;
223
223
log:: trace!( "send {} {}" , hex:: encode( & buf[ ..3 ] ) , hex:: encode( & buf[ 3 ..] ) ) ;
224
224
let _ = dev. write_endpoint ( ENDPOINT_OUT_IAP , & buf) ;
0 commit comments