make radio_upload not use static device
This commit is contained in:
parent
863f14b0c2
commit
05b7842053
6
radio.c
6
radio.c
@ -158,10 +158,10 @@ void radio_download(radio_device_t* dev)
|
||||
//
|
||||
// Write firmware image to the device.
|
||||
//
|
||||
void radio_upload(int cont_flag)
|
||||
void radio_upload(radio_device_t* dev, int cont_flag)
|
||||
{
|
||||
// Check for compatibility.
|
||||
if (! device->is_compatible(device)) {
|
||||
if (! dev->is_compatible(dev)) {
|
||||
fprintf(stderr, "Incompatible image - cannot upload.\n");
|
||||
exit(-1);
|
||||
}
|
||||
@ -170,7 +170,7 @@ void radio_upload(int cont_flag)
|
||||
fprintf(stderr, "Write device: ");
|
||||
fflush(stderr);
|
||||
}
|
||||
device->upload(device, cont_flag);
|
||||
dev->upload(dev, cont_flag);
|
||||
|
||||
if (! trace_flag)
|
||||
fprintf(stderr, " done.\n");
|
||||
|
2
radio.h
2
radio.h
@ -45,7 +45,7 @@ void radio_disconnect(void);
|
||||
//
|
||||
// Write firmware image to the device.
|
||||
//
|
||||
void radio_upload(int cont_flag);
|
||||
//void radio_upload(int cont_flag);
|
||||
|
||||
//
|
||||
// Print a generic information about the device.
|
||||
|
@ -9,7 +9,7 @@ extern {
|
||||
fn radio_connect() -> *const RadioDeviceT;
|
||||
fn radio_disconnect();
|
||||
fn radio_download(device: *const RadioDeviceT);
|
||||
fn radio_upload(cont_flag: c_int);
|
||||
fn radio_upload(device: *const RadioDeviceT, cont_flag: c_int);
|
||||
fn radio_list_c();
|
||||
fn radio_verify_config();
|
||||
fn radio_print_version(device: *const RadioDeviceT, stdout: *const libc::FILE);
|
||||
@ -38,9 +38,9 @@ pub fn download(device: *const RadioDeviceT) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn upload(_device: *const RadioDeviceT, cont_flag: c_int) {
|
||||
pub fn upload(device: *const RadioDeviceT, cont_flag: c_int) {
|
||||
unsafe {
|
||||
radio_upload(cont_flag)
|
||||
radio_upload(device, cont_flag)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user