Dear Sir,
I am using interrupts and an RS232 port. The interrupt works fine.
The RS232 is not working if I include
ETPU_Interrupt_Routine = ENC_ETPU_ISR;
kindly advice.
Regards
Rajasekar
int ENC_ETPU_ISR(int channel)
{
switch(channel){
case ENCA_P1:{
break;
}
}
eTPUEventClear(channel); // Clear event so cahnnel can interrupt again
return 0;
}
void InitETPUIntr(void){
ETPU_Interrupt_Routine = ENC_ETPU_ISR;
fs_etpu_gpio_cfg_input_trans(ENCA_P1, FS_ETPU_OP_LOW);
eTPUInterruptEnable(ENCA_P1);
}
#define ATXCH 14
#define ARXCH 15
#define UART_RX_CHANNEL (15) // Defines which eTPU channel will be UART RX
#define UART_TX_CHANNEL (14) // Defines which eTPU channel will be UART TX
void SerialInit(void){
eTPUfdx = eTPUFDUartOpen(ARXCH, ATXCH);
}
etpuUART problem
Re: etpuUART problem
When using the NetBurner API, there are two callback functions that can be used to declare your eTPU interrupt routine:
extern int ( *ETPU_Interrupt_Routine )( int channel );
extern int ( *ETPU_Interrupt_Routine_UART )( int channel );
If you use ETPU_Interrupt_Routine, then the routine that your point to is all that is included inn the ISR. If you use ETPU_Interrupt_Routine_UART then the channel is first checked if it is a UART. If not then it will run your ISR. Just change the following in your code:
ETPU_Interrupt_Routine = ENC_ETPU_ISR;
should be:
ETPU_Interrupt_Routine_UART = ENC_ETPU_ISR;
-Larry
extern int ( *ETPU_Interrupt_Routine )( int channel );
extern int ( *ETPU_Interrupt_Routine_UART )( int channel );
If you use ETPU_Interrupt_Routine, then the routine that your point to is all that is included inn the ISR. If you use ETPU_Interrupt_Routine_UART then the channel is first checked if it is a UART. If not then it will run your ISR. Just change the following in your code:
ETPU_Interrupt_Routine = ENC_ETPU_ISR;
should be:
ETPU_Interrupt_Routine_UART = ENC_ETPU_ISR;
-Larry