hackrf_cpldjtag: Update for new hackrf_cpld_write interface
This commit is contained in:
@ -93,7 +93,6 @@ int main(int argc, char** argv)
|
|||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
FILE* fd = NULL;
|
FILE* fd = NULL;
|
||||||
ssize_t bytes_read;
|
ssize_t bytes_read;
|
||||||
uint16_t xfer_len = 0;
|
|
||||||
uint8_t* pdata = &data[0];
|
uint8_t* pdata = &data[0];
|
||||||
|
|
||||||
while ((opt = getopt_long(argc, argv, "x:", long_options,
|
while ((opt = getopt_long(argc, argv, "x:", long_options,
|
||||||
@ -168,10 +167,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
printf("LED1/2/3 blinking means CPLD program success.\nLED3/RED steady means error.\n");
|
printf("LED1/2/3 blinking means CPLD program success.\nLED3/RED steady means error.\n");
|
||||||
printf("Wait message 'Write finished' or in case of LED3/RED steady, Power OFF/Disconnect the Jawbreaker.\n");
|
printf("Wait message 'Write finished' or in case of LED3/RED steady, Power OFF/Disconnect the Jawbreaker.\n");
|
||||||
while( length )
|
result = hackrf_cpld_write(device, pdata, total_length);
|
||||||
{
|
|
||||||
xfer_len = (length > PACKET_LEN) ? PACKET_LEN : length;
|
|
||||||
result = hackrf_cpld_write(device, xfer_len, pdata, total_length);
|
|
||||||
if (result != HACKRF_SUCCESS)
|
if (result != HACKRF_SUCCESS)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "hackrf_cpld_write() failed: %s (%d)\n",
|
fprintf(stderr, "hackrf_cpld_write() failed: %s (%d)\n",
|
||||||
@ -180,11 +176,7 @@ int main(int argc, char** argv)
|
|||||||
fd = NULL;
|
fd = NULL;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
pdata += xfer_len;
|
|
||||||
length -= xfer_len;
|
|
||||||
printf("hackrf_cpld_write() Writing %d bytes, remaining %d bytes.\n",
|
|
||||||
xfer_len, length);
|
|
||||||
}
|
|
||||||
printf("Write finished.\n");
|
printf("Write finished.\n");
|
||||||
printf("Please Power OFF/Disconnect the Jawbreaker.\n");
|
printf("Please Power OFF/Disconnect the Jawbreaker.\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
Reference in New Issue
Block a user