/** ALOE headers */ #include #include #include #include "typetools.h" #include "itf_types.h" #include "inputs.h" #include "outputs.h" #include "stats.h" int numbits; int tticnt; char file_sequence[OUTPUT_MAX_DATA]; int filelength,file_ptr; #define MAX_PRINT_BITS 1024 char printbuff[MAX_PRINT_BITS]; int get_output_length() { if (!tticnt) { return DIV8(numbits); } return 0; } int generate_output(int len) { int i; int bit, j; int *x; if (!len) return 1; switch (pattern) { case PAT_ZEROS: memset(output_data, 0, sizeof(char) * len); break; case PAT_ONES: memset(output_data, 0xff, sizeof(char) * len); break; case PAT_RANDOM: x=(int*) output_data; for (i = 0; i < DIV4(len); i++) { x[i] = rand(); } break; case PAT_FILE: for (i=0;ifilelength) { Log("Error while trying to read %d bytes. File is length %d\n",len,filelength-fixed_offset); len=filelength-fixed_offset; } memcpy(output_data, &file_sequence[fixed_offset], sizeof(char) * len); break; default: Log("Unknown pattern %d\n", pattern); return 0; } if (print_bits) { if (print_bits>MAX_PRINT_BITS) { print_bits=MAX_PRINT_BITS; Log("Error! can't print more bits than %d\n",print_bits); } bin2char(output_data,printbuff,print_bits); printf("SND:\t"); for (i=0;i= tti) tticnt = 0; return 1; } int InitCustom() { int i; tticnt = -1; if (-1==(filelength = lee_archivo(PAT_FILENAME, file_sequence, OUTPUT_MAX_DATA))) { printf("BINSOURCE: Error reading file %s\n",PAT_FILENAME); return 0; } file_ptr=0; return 1; } void ConfigInterfaces() { }