/* USER CODE BEGIN (28) */
/* USER CODE END */
-void sciNotification(sciBASE_t *sci, uint32_t flags)
-{
-/* USER CODE BEGIN (29) */
- if (sci == sciREG) {
- if (flags & SCI_RX_INT) {
- sciReceive(sci, 1, NULL); // Restart receiving
- }
- }
-/* USER CODE END */
-
-}
-
/* USER CODE BEGIN (30) */
/* USER CODE END */
void pwmNotification(hetBASE_t * hetREG,uint32_t pwm, uint32_t notification)
switch (vec)
{
case 1:
- sciNotification(sciREG, SCI_WAKE_INT);
+ //sciNotification(sciREG, SCI_WAKE_INT);
break;
case 3:
- sciNotification(sciREG, SCI_PE_INT);
+ //sciNotification(sciREG, SCI_PE_INT);
break;
case 6:
- sciNotification(sciREG, SCI_FE_INT);
+ //sciNotification(sciREG, SCI_FE_INT);
break;
case 7:
- sciNotification(sciREG, SCI_BREAK_INT);
+ //sciNotification(sciREG, SCI_BREAK_INT);
break;
case 9:
- sciNotification(sciREG, SCI_OE_INT);
+ //sciNotification(sciREG, SCI_OE_INT);
break;
case 11:
if (xQueueSendFromISR(sciInBuffer.buf, (void*)&byte, NULL) == errQUEUE_FULL) {
receiveError++;
}
- sciNotification(sciREG, SCI_RX_INT);
+ /* clear error flags */
+ sciREG->FLR = SCI_FE_INT | SCI_OE_INT | SCI_PE_INT;
}
break;
/* USER CODE BEGIN (27) */
/* USER CODE END */
}
-
-/** @fn void sciLowLevelInterrupt(void)
-* @brief Level 1 Interrupt for SCI
-*/
-#pragma INTERRUPT(sciLowLevelInterrupt, IRQ)
-
-void sciLowLevelInterrupt(void)
-{
- uint32_t vec = sciREG->INTVECT1;
-
-/* USER CODE BEGIN (28) */
-/* USER CODE END */
-
- switch (vec)
- {
- case 1:
- sciNotification(sciREG, SCI_WAKE_INT);
- break;
- case 3:
- sciNotification(sciREG, SCI_PE_INT);
- break;
- case 6:
- sciNotification(sciREG, SCI_FE_INT);
- break;
- case 7:
- sciNotification(sciREG, SCI_BREAK_INT);
- break;
- case 9:
- sciNotification(sciREG, SCI_OE_INT);
- break;
-
- case 11:
- /* receive */
- { uint32_t byte = sciREG->RD;
-
- if (g_sciTransfer[0].length > 0)
- {
- *g_sciTransfer[0].data++ = byte;
- g_sciTransfer[0].length--;
- if (g_sciTransfer[0].length == 0)
- {
- sciNotification(sciREG, SCI_RX_INT);
- }
- }
- }
- break;
-
- case 12:
- /* transmit */
- if (--g_sciTransfer[0].length > 0)
- {
- sciREG->TD = *g_sciTransfer[0].data++;
- }
- else
- {
- sciREG->CLRINT = SCI_TX_INT;
- sciNotification(sciREG, SCI_TX_INT);
- }
- break;
-
- default:
- /* phantom interrupt, clear flags and return */
- sciREG->FLR = sciREG->SETINTLVL & 0x07000303;
- break;
- }
-/* USER CODE BEGIN (29) */
-/* USER CODE END */
-}