Renamed project from "Debug_UART-USB" to "Debug_USB" and changed symbols from "UART" to "USB" for better consistency
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Debug_UART-USB</name>
|
||||
<name>Debug_USB</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "interrupts.h"
|
||||
|
||||
extern volatile unsigned char status_flag;
|
||||
extern char* pUARTReceiveString;
|
||||
extern char* pUSBReceiveString;
|
||||
|
||||
/*
|
||||
* Timer B CCR0 Interrupt Service Routine
|
||||
@@ -31,5 +31,5 @@ __interrupt void TIMER0_B0_ISR(void){
|
||||
|
||||
#pragma vector = USCI_A2_VECTOR
|
||||
__interrupt void USCI_A2_ISR(void){
|
||||
usci_A2_receiveString(pUARTReceiveString);
|
||||
usci_A2_receiveString(pUSBReceiveString);
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
#include "usci.h"
|
||||
|
||||
volatile unsigned char status_flag = FALSE;
|
||||
char UARTTransmitString[] = "[DEBUG] Test Transmission String";
|
||||
char* pUARTReceiveString;
|
||||
char USBTransmitString[] = "[DEBUG] Test Transmission String";
|
||||
char* pUSBReceiveString;
|
||||
|
||||
int main(void) {
|
||||
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer; `WDTPW` is the "WatchDog Timer PassWord", required for all `WDTCTL` operations
|
||||
@@ -29,7 +29,7 @@ int main(void) {
|
||||
|
||||
P8OUT |= LEDY0; // Initially set LEDY0 to High
|
||||
|
||||
pUARTReceiveString = calloc(1, 256 * sizeof(*pUARTReceiveString) + 1);
|
||||
pUSBReceiveString = calloc(1, 256 * sizeof(*pUSBReceiveString) + 1);
|
||||
|
||||
usci_A2_enable();
|
||||
usci_A2_enableInterrupt();
|
||||
@@ -37,12 +37,12 @@ int main(void) {
|
||||
while(1)
|
||||
{
|
||||
// Repeating debug transmission string
|
||||
usci_A2_transmitString(&UARTTransmitString[0]);
|
||||
usci_A2_transmitString(&USBTransmitString[0]);
|
||||
|
||||
// String received, to be transmitted back
|
||||
if(pUARTReceiveString[0] != '\0'){
|
||||
usci_A2_transmitString(pUARTReceiveString);
|
||||
pUARTReceiveString[0] = '\0';
|
||||
if(pUSBReceiveString[0] != '\0'){
|
||||
usci_A2_transmitString(pUSBReceiveString);
|
||||
pUSBReceiveString[0] = '\0';
|
||||
}
|
||||
|
||||
delayMultiplied(5000);
|
||||
Reference in New Issue
Block a user