summaryrefslogtreecommitdiffstats
path: root/firmware/drivers/m66591.c
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-06-13 20:59:03 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-06-13 20:59:03 +0000
commit4d41886caaefeccb08ed6eeccfffea15bad9c2a6 (patch)
tree7ee5071dac2dfdae5c576d6b87d87d559c5365be /firmware/drivers/m66591.c
parent414f6c558b27ab6deb03d4dd49e040c75f298d46 (diff)
downloadrockbox-4d41886caaefeccb08ed6eeccfffea15bad9c2a6.tar.gz
rockbox-4d41886caaefeccb08ed6eeccfffea15bad9c2a6.zip
M:Robe 500: Fix up 256 color blitting when in portrait mode, fix a mistake in the plugin linker script, reduce the amount of memory used by overwriting IRAM with bss after program has started, clean up some tabs and formatting, resize the simulator when building for 640x480
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21280 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/m66591.c')
-rw-r--r--firmware/drivers/m66591.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/firmware/drivers/m66591.c b/firmware/drivers/m66591.c
index 9a93985580..4c1773e61b 100644
--- a/firmware/drivers/m66591.c
+++ b/firmware/drivers/m66591.c
@@ -423,29 +423,29 @@ void USB_DEVICE(void) {
M66591_INTSTAT_NRDY, M66591_INTSTAT_EMP);
/* VBUS (connected) interrupt */
- while ( M66591_INTSTAT_MAIN & (1<<15) ) {
- M66591_INTSTAT_MAIN &= ~(1<<15);
-
- /* If device is not clocked, interrupt flag must be set manually */
- if ( !(M66591_TRN_CTRL & (1<<10)) ) {
- M66591_INTSTAT_MAIN |= (1<<15);
- }
- }
-
- /* Resume interrupt: This is not used. Extra logic needs to be added similar
- * to the VBUS interrupt incase the PHY clock is not running.
- */
- if(M66591_INTSTAT_MAIN & (1<<14)) {
- M66591_INTSTAT_MAIN &= ~(1<<14);
- logf("mxx: RESUME");
- }
-
- /* Device state transition interrupt: Not used, but useful for debugging */
- if(M66591_INTSTAT_MAIN & (1<<12)) {
- M66591_INTSTAT_MAIN &= ~(1<<12);
- logf("mxx: DEV state CHANGE=%d",
- ((M66591_INTSTAT_MAIN & (0x07<<4)) >> 4) );
- }
+ while ( M66591_INTSTAT_MAIN & (1<<15) ) {
+ M66591_INTSTAT_MAIN &= ~(1<<15);
+
+ /* If device is not clocked, interrupt flag must be set manually */
+ if ( !(M66591_TRN_CTRL & (1<<10)) ) {
+ M66591_INTSTAT_MAIN |= (1<<15);
+ }
+ }
+
+ /* Resume interrupt: This is not used. Extra logic needs to be added similar
+ * to the VBUS interrupt incase the PHY clock is not running.
+ */
+ if(M66591_INTSTAT_MAIN & (1<<14)) {
+ M66591_INTSTAT_MAIN &= ~(1<<14);
+ logf("mxx: RESUME");
+ }
+
+ /* Device state transition interrupt: Not used, but useful for debugging */
+ if(M66591_INTSTAT_MAIN & (1<<12)) {
+ M66591_INTSTAT_MAIN &= ~(1<<12);
+ logf("mxx: DEV state CHANGE=%d",
+ ((M66591_INTSTAT_MAIN & (0x07<<4)) >> 4) );
+ }
/* Control transfer stage interrupt */
if(M66591_INTSTAT_MAIN & (1<<11)) {
@@ -721,30 +721,30 @@ void usb_drv_exit(void) {
* Reference Manual Rev 1.00, p. 78.
*/
- /* Detach notification to PC (disable D+ pull-up) */
- M66591_TRN_CTRL &= ~(1<<4);
+ /* Detach notification to PC (disable D+ pull-up) */
+ M66591_TRN_CTRL &= ~(1<<4);
+
+ /* Software reset */
+ M66591_TRN_CTRL &= ~0x01;
- /* Software reset */
- M66591_TRN_CTRL &= ~0x01;
+ /* Disable internal clock supply */
+ M66591_TRN_CTRL &= ~(1<<10);
+ udelay(3);
- /* Disable internal clock supply */
- M66591_TRN_CTRL &= ~(1<<10);
- udelay(3);
+ /* Disable PLL */
+ M66591_TRN_CTRL &= ~(1<<11);
+ udelay(3);
- /* Disable PLL */
- M66591_TRN_CTRL &= ~(1<<11);
- udelay(3);
+ /* Disable internal reference clock */
+ M66591_TRN_CTRL &= ~(1<<12);
+ udelay(3);
- /* Disable internal reference clock */
- M66591_TRN_CTRL &= ~(1<<12);
- udelay(3);
+ /* Disable oscillation buffer, reenable USB operation */
+ M66591_TRN_CTRL &= ~(1<<13);
- /* Disable oscillation buffer, reenable USB operation */
- M66591_TRN_CTRL &= ~(1<<13);
-
- M66591_TRN_CTRL |= 0x01;
+ M66591_TRN_CTRL |= 0x01;
- logf("mxx: detached");
+ logf("mxx: detached");
}
/* This function begins a transmit (on an IN endpoint), it should not block