bitIndex = 0;
int isDamp = 0;
- int damplimit = (int)((high / 2) * 0.3);
+ int damplimit = (int)( (int)(high / 2) * 0.3);
int dampHi = (high/2)+damplimit;
int dampLow = (high/2)-damplimit;
int firstST = 0;
i = startIndex;
j = 0;
tolerance = clock/4;
- uint8_t decodedArr[len];
+ uint8_t decodedArr[len] = {0x00};
/* Detect duration between 2 successive transitions */
for (bitindex = 1; i < len; i++) {
* parse it into final decoded bitstream
*/
int i, j, warnings;
- uint8_t decodedArr[(len/2)+1];
+ uint8_t decodedArr[(len/2)+1] = {0x00};
j = warnings = 0;
if ( fieldlen != 40 && fieldlen != 50){
printf("Detected field Length: %d \n", fieldlen);
printf("Can only handle 40 or 50. Aborting...\n");
+ free(output);
return;
}