From e31372a8e619455b52a150dd92c13328b5210fa7 Mon Sep 17 00:00:00 2001 From: William Miceli Date: Fri, 25 Jun 2021 13:32:00 -0400 Subject: [PATCH] Changed from using delay function to a counter so that if a string is received, it will be repeated/transmitted back more quickly --- Telem_Debug/Debug_USB/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Telem_Debug/Debug_USB/main.c b/Telem_Debug/Debug_USB/main.c index 9c46e1f..338409a 100644 --- a/Telem_Debug/Debug_USB/main.c +++ b/Telem_Debug/Debug_USB/main.c @@ -5,6 +5,7 @@ #include "timers.h" #include "usci.h" +long delayCounter = 0; volatile unsigned char status_flag = FALSE; char USBTransmitString[] = "[DEBUG] Test Transmission String"; char* pUSBReceiveString; @@ -37,14 +38,17 @@ int main(void) { while(1) { // Repeating debug transmission string - usci_A2_transmitString(&USBTransmitString[0]); + if(delayCounter == 0){ + usci_A2_transmitString(&USBTransmitString[0]); + }else{ + ++delayCounter; + delayCounter %= 10000; + } // String received, to be transmitted back if(pUSBReceiveString[0] != '\0'){ usci_A2_transmitString(pUSBReceiveString); pUSBReceiveString[0] = '\0'; } - - delayMultiplied(5000); } }