Skip to content

Instantly share code, notes, and snippets.

@ivand58
Created April 17, 2018 11:20
Show Gist options
  • Save ivand58/7ded2493051a45303fc3838a74c9ca3c to your computer and use it in GitHub Desktop.
Save ivand58/7ded2493051a45303fc3838a74c9ca3c to your computer and use it in GitHub Desktop.
#ifdef __GNUC__
#define INLINE inline __attribute__((always_inline))
#else
#define INLINE
#endif
{
FILE *fp;
memset(ram,0xFF,sizeof(ram));
memset(rom,0xFF,sizeof(rom));
if (argc != 2)
{
fprintf(stderr, "Usage:\nthumbulator-stm32f103 ROM.bin\n");
return -1;
}
else
{
fp=fopen(argv[1],"rb");
if( fp == NULL ) {
perror("Error: ");
}
else
{
unsigned int ra;
ra=fread(rom,1,sizeof(rom),fp);
if (ra < 1 )
{
fprintf(stderr, "The size of %s is zero!\n", argv[1]);
return -1;
}
fclose(fp);
}
}
reset();
run();
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment