SAMA5 EMAC: Incremental progress. Still not code complete

This commit is contained in:
Gregory Nutt 2013-09-16 11:36:12 -06:00
parent 6a01d80bb2
commit a791ae11ce
4 changed files with 25 additions and 7 deletions

View File

@ -191,7 +191,8 @@ void sam_boardinitialize(void);
* *
************************************************************************************/ ************************************************************************************/
#if defined(CONFIG_NET) && (defined(CONFIG_SAMA5_EMAC) || defined(CONFIG_SAMA5_GMAC)) #if defined(CONFIG_NET) && (defined(CONFIG_SAMA5_EMAC) || defined(CONFIG_SAMA5_GMAC)) && \
defined(CONFIG_SAMA5_PIOE_IRQ)
xcpt_t sam_phyirq(int intf, xcpt_t irqhandler); xcpt_t sam_phyirq(int intf, xcpt_t irqhandler);
#endif #endif

View File

@ -151,14 +151,15 @@ xcpt_t up_irqbutton(int id, xcpt_t irqhandler)
/* Get the old button interrupt handler and save the new one */ /* Get the old button interrupt handler and save the new one */
oldhandler = *g_irquser1; oldhandler = g_irquser1;
*g_irquser1 = irqhandler; g_irquser1 = irqhandler;
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(IRQ_USER1); sam_pioirq(IRQ_USER1);
(void)irq_attach(IRQ_USER1, irqhandler); (void)irq_attach(IRQ_USER1, irqhandler);
sam_pioirqenable(IRQ_USER1); sam_pioirqenable(IRQ_USER1);
irqrestore(flags);
} }
/* Return the old button handler (so that it can be restored) */ /* Return the old button handler (so that it can be restored) */

View File

@ -47,9 +47,22 @@
#ifdef HAVE_NETWORK #ifdef HAVE_NETWORK
/************************************************************************************ /************************************************************************************
* Definitions * Pre-processor Definitions
************************************************************************************/ ************************************************************************************/
/************************************************************************************
* Private Data
************************************************************************************/
#ifdef CONFIG_SAMA5_PIOE_IRQ
#ifdef CONFIG_SAMA5_EMAC
static xcpt g_emac_handler;
#endif
#ifdef CONFIG_SAMA5_GMAC
static xcpt g_gmac_handler;
#endif
#endif
/************************************************************************************ /************************************************************************************
* Private Functions * Private Functions
************************************************************************************/ ************************************************************************************/
@ -117,6 +130,7 @@ void weak_function sam_netinitialize(void)
* *
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_SAMA5_PIOE_IRQ
xcpt_t sam_phyirq(int intf, xcpt_t irqhandler) xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
{ {
irqstate_t flags; irqstate_t flags;
@ -164,7 +178,9 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
/* Return the old button handler (so that it can be restored) */ /* Return the old button handler (so that it can be restored) */
irqrestore(flags);
return oldhandler; return oldhandler;
} }
#endif /* CONFIG_SAMA5_PIOE_IRQ */
#endif /* HAVE_NETWORK */ #endif /* HAVE_NETWORK */

View File

@ -90,7 +90,7 @@ static struct usbhost_connection_s *g_ehciconn;
/* Overcurrent interrupt handler */ /* Overcurrent interrupt handler */
#if defined(HAVE_USBHOST) && defined(CONFIG_SAMA5_PIOD_IRQ) #if defined(HAVE_USBHOST) && defined(CONFIG_SAMA5_PIOD_IRQ)
static xcpt_t *g_ochandler; static xcpt_t g_ochandler;
#endif #endif
/************************************************************************************ /************************************************************************************
@ -476,8 +476,8 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler)
/* Get the old button interrupt handler and save the new one */ /* Get the old button interrupt handler and save the new one */
oldhandler = *g_ochandler; oldhandler = g_ochandler;
*g_ochandler = handler; g_ochandler = handler;
/* Configure the interrupt */ /* Configure the interrupt */