Commit ab93260c authored by Federico Vaga's avatar Federico Vaga

tool: convert flags to stdbool

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 04f93b8a
......@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
......@@ -301,7 +302,8 @@ flash_program_exit:
return ret;
}
static int program_flash(struct bitstream *bitstream, int program_boot)
static int program_flash(struct bitstream *bitstream,
bool fpga_bootloader_flash)
{
int ret = 0;
......@@ -324,7 +326,7 @@ static int program_flash(struct bitstream *bitstream, int program_boot)
}
printf("Flash ID: 0x%.7x, OK\n", flash_id);
if(program_boot)
if(fpga_bootloader_flash)
{
char confirm[1024];
printf("\nWARNING! You're about to update the SVEC bootloader. \nIf this operation fails (due to incorrect bitstream or power loss), the card "
......@@ -441,8 +443,8 @@ int main(int argc, char *argv[])
void *buf;
uint32_t size;
int slot;
int program_boot = 0;
int direct_boot = 0;
bool fpga_bootloader_flash = false;
bool fpga_configure = false;
int rv;
int err;
char opt;
......@@ -456,10 +458,10 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS);
break;
case 'b':
program_boot = 1;
fpga_bootloader_flash = true;
break;
case 'f':
direct_boot = 1;
fpga_configure = true;
break;
}
}
......@@ -490,8 +492,8 @@ int main(int argc, char *argv[])
init_vme(slot);
enter_bootloader();
if(!direct_boot)
err = program_flash(&bitstream, program_boot);
if(!fpga_configure)
err = program_flash(&bitstream, fpga_bootloader_flash);
else
err = program_afpga(&bitstream);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment