Exemplo n.º 1
0
void _Device_Uart_Module_1_Disable(void){
    //Disable UART module for operation
    USCI_A_UART_disable(UART_Module_1_USCI_A_BASEADDRESS);

    //Disable Receive Interrupt
	USCI_A_UART_clearInterruptFlag(UART_Module_1_USCI_A_BASEADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);
    USCI_A_UART_disableInterrupt(UART_Module_1_USCI_A_BASEADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);
    __no_operation();
    Interrupt_UART_ReceiveData_ptr_fuc = Empty_UART_fun;

}
static inline void uart_tx_isr(void)
{
	if (_txBuf.head == _txBuf.tail) {     //No data need to transmit.
		USCI_A_UART_disableInterrupt(USCI_A1_BASE,
                                     USCI_A_UART_TRANSMIT_INTERRUPT); // Disable interrupt
		UCA1IFG |= UCTXIFG;    // Set Flag again
		return;
	}

	unsigned char data = _txBuf.buf[_txBuf.tail];
	_txBuf.tail = (_txBuf.tail + 1) % UART_BUFFER_SIZE;
	USCI_A_UART_transmitData(USCI_A1_BASE, data);
}