diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-17 23:02:40 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-17 23:02:40 +0000 |
commit | 12747c4d3b9f43e93134318c211235c8c29eb4fa (patch) | |
tree | 692cbc6f21e9ad7da5e01694ceeb270a766228a5 | |
parent | ec669a14ab680da475cd1e16b588f164462c0d78 (diff) | |
download | px4-nuttx-12747c4d3b9f43e93134318c211235c8c29eb4fa.tar.gz px4-nuttx-12747c4d3b9f43e93134318c211235c8c29eb4fa.tar.bz2 px4-nuttx-12747c4d3b9f43e93134318c211235c8c29eb4fa.zip |
PIC32 USB driver fixes (still not working)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4308 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/TODO | 2 | ||||
-rw-r--r-- | nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c | 16 | ||||
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/up_leds.c | 6 |
3 files changed, 16 insertions, 8 deletions
diff --git a/nuttx/TODO b/nuttx/TODO index f4a154a23..01f808cdb 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -35,7 +35,7 @@ nuttx/ (3) AVR (arch/avr) (0) Intel x86 (arch/x86) (4) 8051 / MCS51 (arch/8051/) - (1) MIPS (arch/mips) + (1) MIPS/PIC32 (arch/mips) (1) Hitachi/Renesas SH-1 (arch/sh/src/sh1) (4) Renesas M16C/26 (arch/sh/src/m16c) (10) z80/z8/ez80 (arch/z80/) diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c b/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c index 65a7c9162..50b138c6c 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c @@ -2199,7 +2199,7 @@ static int pic32mx_interrupt(int irq, void *context) pic32mx_putreg(USB_INT_ALL, PIC32MX_USB_IR); - /* Make sure the the USE reset and idle detect interrupts are enabled */ + /* Make sure that the USE reset and IDLE detect interrupts are enabled */ regval = pic32mx_getreg(PIC32MX_USB_IE); regval |= (USB_INT_URST|USB_INT_IDLE); @@ -2411,7 +2411,9 @@ static void pic32mx_suspend(struct pic32mx_usbdev_s *priv) { uint16_t regval; - /* NOTE: Do not clear UIRbits.ACTVIF here! Reason: ACTVIF is only + /* Enable the ACTV interrupt. + * + * NOTE: Do not clear UIRbits.ACTVIF here! Reason: ACTVIF is only * generated once an IDLEIF has been generated. This is a 1:1 ratio * interrupt generation. For every IDLEIF, there will be only one ACTVIF * regardless of the number of subsequent bus transitions. If the ACTIF @@ -2424,6 +2426,12 @@ static void pic32mx_suspend(struct pic32mx_usbdev_s *priv) regval |= USBOTG_INT_ACTV; pic32mx_putreg(regval, PIC32MX_USBOTG_IE); + /* Disable further IDLE interrupts. Once is enough. */ + + regval = pic32mx_getreg(PIC32MX_USB_IE); + regval &= ~USB_INT_IDLE; + pic32mx_putreg(regval, PIC32MX_USB_IE); + /* Invoke a callback into board-specific logic. The board-specific logic * may enter into sleep or idle modes or switch to a slower clock, etc. */ @@ -3457,7 +3465,7 @@ static void pic32mx_hwreset(struct pic32mx_usbdev_s *priv) pic32mx_putreg(0, PIC32MX_USB_CNFG1); pic32mx_putreg(ERROR_INTERRUPTS, PIC32MX_USB_EIE); - pic32mx_putreg(NORMAL_INTERRUPTS, PIC32MX_USB_EIE); + pic32mx_putreg(NORMAL_INTERRUPTS, PIC32MX_USB_IE); /* Power up the USB module */ @@ -3595,7 +3603,7 @@ static void pic32mx_hwshutdown(struct pic32mx_usbdev_s *priv) /* Disable all interrupts and force the USB controller into reset */ pic32mx_putreg(0, PIC32MX_USB_EIE); - pic32mx_putreg(0, PIC32MX_USB_EIE); + pic32mx_putreg(0, PIC32MX_USB_IE); /* Clear any pending interrupts */ diff --git a/nuttx/configs/sure-pic32mx/src/up_leds.c b/nuttx/configs/sure-pic32mx/src/up_leds.c index 0ea87571d..49905bb4a 100644 --- a/nuttx/configs/sure-pic32mx/src/up_leds.c +++ b/nuttx/configs/sure-pic32mx/src/up_leds.c @@ -81,9 +81,9 @@ */ #define GPIO_USB_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN7) -#define GPIO_SD_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN8) -#define GPIO_FLASH_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN9) -#define GPIO_ERROR_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN10) +#define GPIO_SD_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN6) +#define GPIO_FLASH_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTF|GPIO_PIN0) +#define GPIO_ERROR_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTF|GPIO_PIN1) /* LED Management Definitions ***********************************************/ |