Fixed issues with the logger and brought logger to same structure as the rest - now the logger is a independent object
Added testItems to HwValidationMenu for SWo git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@235 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -244,3 +244,102 @@ ErrorStatus Uart_read (struct Uart* self, char* buffer, size_t length, size_t* a
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* @brief Function: USART1_IRQHandler
|
||||
*
|
||||
* Dedicated Interrupt Service Routine for USART1
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void USART1_IRQHandler(void)
|
||||
{
|
||||
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
|
||||
//! Transmission register empty interrupt
|
||||
if(USART_GetITStatus(USART1, USART_IT_TXE) != RESET)
|
||||
{
|
||||
//! Receive element from usart transmission queue
|
||||
struct usartQueueItem usartTxItem;
|
||||
xQueueReceiveFromISR(uart1->txQueue, &usartTxItem, &higherPriorityTaskWoken);
|
||||
//! Write one byte to the transmit data register
|
||||
USART_SendData(USART1, usartTxItem.byte);
|
||||
//! check if queue is empty -> all bytes transmit
|
||||
if(pdTRUE == xQueueIsQueueEmptyFromISR(uart1->txQueue))
|
||||
{
|
||||
//! Disable the COMPORT Transmit interrupt and release semaphore
|
||||
USART_ITConfig(USART1, USART_IT_TXE, DISABLE);
|
||||
xSemaphoreGiveFromISR(uart1->txSemaphore, &higherPriorityTaskWoken);
|
||||
}
|
||||
}
|
||||
|
||||
//! Current interrupt is triggered by USART_RXNE (receive register not empty)
|
||||
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
|
||||
{
|
||||
//! Read one byte from the receive data register
|
||||
struct usartQueueItem usartRxItem;
|
||||
//! Reading from reception register automatically clears the RXNE interrupt
|
||||
usartRxItem.byte = USART_ReceiveData(USART1);
|
||||
//! Add the byte to the USART RX queue
|
||||
//! In case of a full queue, the data is dumped
|
||||
(void)xQueueSendFromISR(uart1->rxQueue, &usartRxItem, &higherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
portEND_SWITCHING_ISR(higherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* @brief Function: USART3_IRQHandler
|
||||
*
|
||||
* Dedicated Interrupt Service Routine for USART3
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void USART3_IRQHandler(void)
|
||||
{
|
||||
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
|
||||
//! Transmission register empty interrupt
|
||||
if(USART_GetITStatus(USART3, USART_IT_TXE) != RESET)
|
||||
{
|
||||
//! Receive element from usart transmission queue
|
||||
struct usartQueueItem usartTxItem;
|
||||
xQueueReceiveFromISR(uart3->txQueue, &usartTxItem, &higherPriorityTaskWoken);
|
||||
//! Write one byte to the transmit data register
|
||||
USART_SendData(USART3, usartTxItem.byte);
|
||||
//! check if queue is empty -> all bytes transmit
|
||||
if(pdTRUE == xQueueIsQueueEmptyFromISR(uart3->txQueue))
|
||||
{
|
||||
//! Disable the COMPORT Transmit interrupt and release semaphore
|
||||
USART_ITConfig(USART3, USART_IT_TXE, DISABLE);
|
||||
xSemaphoreGiveFromISR(uart3->txSemaphore, &higherPriorityTaskWoken);
|
||||
}
|
||||
}
|
||||
|
||||
//! Current interrupt is triggered by USART_RXNE (receive register not empty)
|
||||
if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
|
||||
{
|
||||
//! Read one byte from the receive data register
|
||||
struct usartQueueItem usartRxItem;
|
||||
//! Reading from reception register automatically clears the RXNE interrupt
|
||||
usartRxItem.byte = (char)USART_ReceiveData(USART3);
|
||||
//! Add the byte to the USART RX queue
|
||||
//! In case of a full queue, the data is dumped
|
||||
(void)xQueueSendFromISR(uart3->rxQueue, &usartRxItem, &higherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
portEND_SWITCHING_ISR(higherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user