replaced DMA API routines by fresh download with originals
moved more interrupt handlers to generalized handler cleaned up lowlevel interrupt handling fixed wrong assignment of interrupt masks reformatted
This commit is contained in:
24
net/fec.c
24
net/fec.c
@@ -571,9 +571,9 @@ void fec_rx_start(uint8_t ch, int8_t *rxbd)
|
||||
* Start the Rx DMA task
|
||||
*/
|
||||
MCD_startDma(channel,
|
||||
(int8_t *) rxbd,
|
||||
(s8 *) rxbd,
|
||||
0,
|
||||
(int8_t *) MCF_FEC_FECRFDR(ch),
|
||||
(s8 *) MCF_FEC_FECRFDR(ch),
|
||||
0,
|
||||
RX_BUF_SZ,
|
||||
0,
|
||||
@@ -887,9 +887,9 @@ void fec_tx_start(uint8_t ch, int8_t *txbd)
|
||||
* Start the Tx DMA task
|
||||
*/
|
||||
MCD_startDma(channel,
|
||||
(int8_t *) txbd,
|
||||
(s8 *) txbd,
|
||||
0,
|
||||
(int8_t*) MCF_FEC_FECTFDR(ch),
|
||||
(s8 *) MCF_FEC_FECTFDR(ch),
|
||||
0,
|
||||
ETH_MTU,
|
||||
0,
|
||||
@@ -1189,7 +1189,7 @@ void fec_irq_disable(uint8_t ch)
|
||||
* Parameters:
|
||||
* ch FEC channel
|
||||
*/
|
||||
static void fec_irq_handler(uint8_t ch)
|
||||
static bool fec_irq_handler(uint8_t ch)
|
||||
{
|
||||
uint32_t event, eir;
|
||||
|
||||
@@ -1284,6 +1284,8 @@ static void fec_irq_handler(uint8_t ch)
|
||||
fec_log[ch].hberr++;
|
||||
dbg("HBERR\r\n");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1292,22 +1294,26 @@ static void fec_irq_handler(uint8_t ch)
|
||||
*/
|
||||
bool fec0_interrupt_handler(void* arg1, void* arg2)
|
||||
{
|
||||
bool res;
|
||||
|
||||
(void) arg1; /* not used */
|
||||
(void) arg2;
|
||||
|
||||
fec_irq_handler(0);
|
||||
res = fec_irq_handler(0);
|
||||
|
||||
return true; /* handled */
|
||||
return res;
|
||||
}
|
||||
|
||||
bool fec1_interrupt_handler(void* arg1, void* arg2)
|
||||
{
|
||||
bool res;
|
||||
|
||||
(void) arg1; /* not used */
|
||||
(void) arg2;
|
||||
|
||||
fec_irq_handler(1);
|
||||
res = fec_irq_handler(1);
|
||||
|
||||
return true; /* handled */
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -38,7 +38,7 @@ static NET_TIMER net_timer[4] =
|
||||
};
|
||||
|
||||
|
||||
int timer_default_isr(void *not_used, NET_TIMER *t)
|
||||
bool timer_default_isr(void *not_used, NET_TIMER *t)
|
||||
{
|
||||
(void) not_used;
|
||||
|
||||
@@ -159,7 +159,7 @@ bool timer_init(uint8_t ch, uint8_t lvl, uint8_t pri)
|
||||
* Register the timer interrupt handler
|
||||
*/
|
||||
if (!isr_register_handler(TIMER_VECTOR(ch), 3, 0,
|
||||
(int (*)(void *,void *)) timer_default_isr,
|
||||
(bool (*)(void *,void *)) timer_default_isr,
|
||||
NULL,
|
||||
(void *) &net_timer[ch])
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user