mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-26 17:00:00 +08:00
update to interrupt description
This commit is contained in:
@@ -33,7 +33,7 @@ static void rt_hw_board_led_init(void);
|
||||
* This is the timer interrupt service routine.
|
||||
* @param vector the irq number for timer
|
||||
*/
|
||||
void rt_hw_timer_handler(int vector)
|
||||
void rt_hw_timer_handler(int vector, void* param)
|
||||
{
|
||||
if (AT91C_BASE_PITC->PITC_PISR & 0x01)
|
||||
{
|
||||
@@ -168,7 +168,7 @@ void rt_hw_board_init()
|
||||
AT91C_BASE_PITC->PITC_PIMR = (1 << 25) | (1 << 24) | PIV;
|
||||
|
||||
/* install timer handler */
|
||||
rt_hw_interrupt_install(AT91C_ID_SYS, rt_hw_timer_handler, RT_NULL);
|
||||
rt_hw_interrupt_install(AT91C_ID_SYS, rt_hw_timer_handler, RT_NULL, "tick");
|
||||
AT91C_BASE_AIC->AIC_SMR[AT91C_ID_SYS] = 0;
|
||||
rt_hw_interrupt_umask(AT91C_ID_SYS);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ rt_inline void sam7xether_reset_tx_desc(void)
|
||||
|
||||
|
||||
/* interrupt service routing */
|
||||
static void sam7xether_isr(int irq)
|
||||
static void sam7xether_isr(int irq, void* param)
|
||||
{
|
||||
/* Variable definitions can be made now. */
|
||||
volatile rt_uint32_t isr, rsr;
|
||||
@@ -377,7 +377,7 @@ rt_err_t sam7xether_init(rt_device_t dev)
|
||||
AT91C_BASE_EMAC->EMAC_IER = AT91C_EMAC_RCOMP | AT91C_EMAC_TCOMP;
|
||||
|
||||
/* setup interrupt */
|
||||
rt_hw_interrupt_install(AT91C_ID_EMAC, sam7xether_isr, RT_NULL);
|
||||
rt_hw_interrupt_install(AT91C_ID_EMAC, sam7xether_isr, RT_NULL, "emac");
|
||||
*(volatile unsigned int*)(0xFFFFF000 + AT91C_ID_EMAC * 4) = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | 5;
|
||||
// AT91C_AIC_SMR(AT91C_ID_EMAC) = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | 5;
|
||||
rt_hw_interrupt_umask(AT91C_ID_EMAC);
|
||||
|
||||
@@ -76,27 +76,12 @@ struct rt_at91serial serial1;
|
||||
struct rt_at91serial serial2;
|
||||
#endif
|
||||
|
||||
static void rt_hw_serial_isr(int irqno)
|
||||
static void rt_hw_serial_isr(int irqno, void* param)
|
||||
{
|
||||
rt_base_t level;
|
||||
struct rt_device* device;
|
||||
struct rt_at91serial* serial = RT_NULL;
|
||||
struct rt_at91serial* serial = (struct rt_at91serial*)param;
|
||||
|
||||
#ifdef RT_USING_UART1
|
||||
if (irqno == AT91C_ID_US0)
|
||||
{
|
||||
/* serial 1 */
|
||||
serial = &serial1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_UART2
|
||||
if (irqno == AT91C_ID_US1)
|
||||
{
|
||||
/* serial 2 */
|
||||
serial = &serial2;
|
||||
}
|
||||
#endif
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
|
||||
/* get generic device object */
|
||||
@@ -202,7 +187,7 @@ static rt_err_t rt_serial_open(rt_device_t dev, rt_uint16_t oflag)
|
||||
//serial->hw_base->US_IMR |= 1 << 0; /* umask RxReady interrupt */
|
||||
|
||||
/* install UART handler */
|
||||
rt_hw_interrupt_install(serial->peripheral_id, rt_hw_serial_isr, RT_NULL);
|
||||
rt_hw_interrupt_install(serial->peripheral_id, rt_hw_serial_isr, serial, "uart");
|
||||
// SAM7X Datasheet 30.5.3:
|
||||
// It is notrecommended to use the USART interrupt line in edge sensitive mode
|
||||
//AT91C_AIC_SMR(serial->peripheral_id) = 5 | (0x01 << 5);
|
||||
|
||||
Reference in New Issue
Block a user