diff --git a/bus.c b/bus.c index d52312a..6d02ee0 100644 --- a/bus.c +++ b/bus.c @@ -174,6 +174,7 @@ void* processBus(void* we) busFree = true; printx(DEBUG, BUS, buffer); V(SEM_INPUT); + usleep(2); } return NULL; } diff --git a/log.txt b/log.txt new file mode 100644 index 0000000..366f933 --- /dev/null +++ b/log.txt @@ -0,0 +1,20 @@ +==7664== Memcheck, a memory error detector +==7664== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. +==7664== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info +==7664== Command: ./tweekd +==7664== +==7664== +==7664== HEAP SUMMARY: +==7664== in use at exit: 408 bytes in 3 blocks +==7664== total heap usage: 16 allocs, 13 frees, 2,428 bytes allocated +==7664== +==7664== LEAK SUMMARY: +==7664== definitely lost: 0 bytes in 0 blocks +==7664== indirectly lost: 0 bytes in 0 blocks +==7664== possibly lost: 408 bytes in 3 blocks +==7664== still reachable: 0 bytes in 0 blocks +==7664== suppressed: 0 bytes in 0 blocks +==7664== Rerun with --leak-check=full to see details of leaked memory +==7664== +==7664== For counts of detected and suppressed errors, rerun with: -v +==7664== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/nfc.c b/nfc.c index dd7ed9b..6707c21 100644 --- a/nfc.c +++ b/nfc.c @@ -68,7 +68,7 @@ bool isTagPresent(char* tag) if(data == PROFESSOR_TAG) { sendData(&nfc_fd, GET_TAG_DETAILS); - printx(INFO, NFC, "Professor Tag Detected %02x\n", data); + //printx(INFO, NFC, "Professor Tag Detected %02x\n", data); //return (read(serial_fd, tag, 6) == 6); } else if(data == STUDENT_TAG) diff --git a/printx.c b/printx.c index 6f515fb..44d07c1 100644 --- a/printx.c +++ b/printx.c @@ -18,11 +18,12 @@ float start; void removeCharFromString(char c, char *str) { - int len = strlen(str)+1; +/* int len = strlen(str)+1; for(int i=0; i=0; i--) + for(int i=LOG_LINES-3; i>=0; i--) strcpy(uilog[i+1], uilog[i]); strcpy(uilog[0], newStr); } @@ -129,10 +129,10 @@ char* fillLogWithSpaces(char* buf, char* text) } char* fillStatusWithSpaces(char* buf, char* text) -{ +{/* strncpy(buf, text, LOG_LENGTH); strncat(buf, SPACES, LOG_LENGTH-strlen(buf)-1-7); - +*/ return buf; } @@ -153,7 +153,7 @@ void displayUI() { char buffer[LOG_LENGTH]; struct timeval tv = {0, 5000}; - char bufferO[4]; + char bufferO[4] = {0, 0, 0, 0}; fd_set rdfs; FD_ZERO(&rdfs); FD_SET(STDIN_FILENO, &rdfs); -- libgit2 0.21.2