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 @@ ...@@ -6,6 +6,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include <stdbool.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
...@@ -301,7 +302,8 @@ flash_program_exit: ...@@ -301,7 +302,8 @@ flash_program_exit:
return ret; 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; int ret = 0;
...@@ -324,7 +326,7 @@ static int program_flash(struct bitstream *bitstream, int program_boot) ...@@ -324,7 +326,7 @@ static int program_flash(struct bitstream *bitstream, int program_boot)
} }
printf("Flash ID: 0x%.7x, OK\n", flash_id); printf("Flash ID: 0x%.7x, OK\n", flash_id);
if(program_boot) if(fpga_bootloader_flash)
{ {
char confirm[1024]; 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 " 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[]) ...@@ -441,8 +443,8 @@ int main(int argc, char *argv[])
void *buf; void *buf;
uint32_t size; uint32_t size;
int slot; int slot;
int program_boot = 0; bool fpga_bootloader_flash = false;
int direct_boot = 0; bool fpga_configure = false;
int rv; int rv;
int err; int err;
char opt; char opt;
...@@ -456,10 +458,10 @@ int main(int argc, char *argv[]) ...@@ -456,10 +458,10 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
break; break;
case 'b': case 'b':
program_boot = 1; fpga_bootloader_flash = true;
break; break;
case 'f': case 'f':
direct_boot = 1; fpga_configure = true;
break; break;
} }
} }
...@@ -490,8 +492,8 @@ int main(int argc, char *argv[]) ...@@ -490,8 +492,8 @@ int main(int argc, char *argv[])
init_vme(slot); init_vme(slot);
enter_bootloader(); enter_bootloader();
if(!direct_boot) if(!fpga_configure)
err = program_flash(&bitstream, program_boot); err = program_flash(&bitstream, fpga_bootloader_flash);
else else
err = program_afpga(&bitstream); 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