Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -rbe83f01a4d54cbd0d92b68cb95a15dcbb06a9a51 -r1bbf9da32e622975efed00b1a7589387a9829440 --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision be83f01a4d54cbd0d92b68cb95a15dcbb06a9a51) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 1bbf9da32e622975efed00b1a7589387a9829440) @@ -23,6 +23,9 @@ #include "Interrupts.h" #include "FPGA.h" #include "SystemComm.h" +#ifdef DEBUG_ENABLED + #include "SystemCommMessages.h" +#endif // ********** private definitions ********** @@ -89,23 +92,47 @@ *************************************************************************/ void canErrorNotification(canBASE_t *node, uint32 notification) { +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + char debugStr[ 256 ]; +#endif if ( node == canREG1 ) { if ( notification & canLEVEL_PARITY_ERR ) { can1ParityCnt++; +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "CAN parity error:%5d \n", can1ParityCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } else if ( notification & canLEVEL_BUS_OFF ) { can1BusOffCnt++; +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "CAN bus off error:%5d \n", can1BusOffCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } else if ( notification & canLEVEL_WARNING ) { can1WarningCnt++; +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "CAN bus warning:%5d \n", can1WarningCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } else if ( notification & canLEVEL_PASSIVE ) { can1PassiveCnt++; +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "CAN passive warning:%5d \n", can1PassiveCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } else { @@ -127,17 +154,31 @@ *************************************************************************/ void sciNotification(sciBASE_t *sci, uint32 flags) { +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + char debugStr[ 256 ]; +#endif if ( sci == sciREG ) { if ( ( flags & SCI_FE_INT ) != 0 ) { sci1FrameErrorCnt++; // TODO - clear and try to do something to recover (+ max retries = comm fault) +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "Debug UART frame error:%5d \n", sci1FrameErrorCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } if ( ( flags & SCI_OE_INT ) != 0 ) { sci1OverrunErrorCnt++; // TODO - clear and try to do something to recover (+ max retries = comm fault) +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "Debug UART overrun error:%5d \n", sci1OverrunErrorCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } } else if ( sci == scilinREG ) @@ -146,11 +187,21 @@ { sci2FrameErrorCnt++; // TODO - clear and try to do something to recover (+ max retries = comm fault) +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "FPGA UART frame error:%5d \n", sci2FrameErrorCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } if ( ( flags & SCI_OE_INT ) != 0 ) { sci2OverrunErrorCnt++; // TODO - clear and try to do something to recover (+ max retries = comm fault) +#ifdef DEBUG_ENABLED + // TODO - temporary debug code - remove later + sprintf( debugStr, "FPGA UART overrun error:%5d \n", sci2OverrunErrorCnt ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); +#endif } } else