comparison ostc4pack/src/OSTC4pack_V4.cpp @ 164:3e3d1ebba956

Merged in janlmulder/ostc4/linux-build (pull request #1) Linux build finetuning
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Thu, 07 Mar 2019 14:15:33 +0000
parents ad98da7e74f8
children 01f40cb1057e
comparison
equal deleted inserted replaced
160:e3ca52b8e7fa 164:3e3d1ebba956
409 #include <stdio.h> 409 #include <stdio.h>
410 #include <string.h> 410 #include <string.h>
411 int main(int argc, char** argv) { 411 int main(int argc, char** argv) {
412 412
413 413
414 if (argc != 3) {
415 fprintf(stderr, "Usage: OSTC4pack_V4 <type> <bin file>\n");
416 return(-1);
417 }
418
414 FILE *fp, * fpout; 419 FILE *fp, * fpout;
415 size_t len; 420 size_t len;
416 unsigned char buf[1050000]; 421 unsigned char buf[1050000];
417 char *file = argv[2]; 422 char *file = argv[2];
418 int type = atoi(argv[1]); 423 int type = atoi(argv[1]);
438 fclose(fp); 443 fclose(fp);
439 if(type == 0) 444 if(type == 0)
440 sprintf(filenameout,"%s_upload.bin",filename); 445 sprintf(filenameout,"%s_upload.bin",filename);
441 else 446 else
442 if(type == 2) 447 if(type == 2)
443 sprintf(filenameout,"OSTC4_FONT_upload.bin",filename); 448 sprintf(filenameout,"%s_upload.bin",filename);
444 else 449 else
445 sprintf(filenameout,"%s_upload.bin",filename); 450 sprintf(filenameout,"%s_upload.bin",filename);
446 451
447 unsigned char buf2[4]; 452 unsigned char buf2[4];
448 453
511 buf2[3] = 0xFF & checksum; 516 buf2[3] = 0xFF & checksum;
512 517
513 fwrite(buf2,sizeof(char),4,fp); 518 fwrite(buf2,sizeof(char),4,fp);
514 519
515 } 520 }
516
517
518
519
520