diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-01-15 08:52:59 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-01-15 08:52:59 +0000 |
commit | 71651cacb62540bd67b56029d551a3ccdeb3c81c (patch) | |
tree | add48793d0fe87bb5cd18cef4506c676998e55cd | |
parent | 3a1127785b9f29e526b2ab845efe0a313699c459 (diff) |
Fix r29053 red and a leftover use of 'usb' variable as a bool rather than int in main-pp.c.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29054 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | bootloader/main-pp.c | 26 | ||||
-rw-r--r-- | firmware/target/arm/iriver/usb-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/system-target.h | 5 | ||||
-rw-r--r-- | firmware/target/arm/usb-fw-pp5002.c | 2 |
4 files changed, 19 insertions, 16 deletions
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c index 3670a7dc97..c8102dd0cc 100644 --- a/bootloader/main-pp.c +++ b/bootloader/main-pp.c @@ -44,8 +44,8 @@ #include "i2c.h" #include "backlight-target.h" #endif -#if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) #include "usb.h" +#if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) #include "usb_drv.h" #endif #include "usb-target.h" @@ -515,17 +515,8 @@ static int handle_usb(int connect_timeout) return usb; } -#else /* !HAVE_BOOTLOADER_USB_MODE */ - -#if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) \ - || defined (SANSA_VIEW) -/* Ignore cable state */ -static int handle_usb(int connect_timeout) -{ - return USB_EXTRACTED; - (void)connect_timeout; -} -#else +#elif (defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) \ + || defined (SANSA_VIEW)) && !defined(USB_ROCKBOX_USB) /* Return USB_INSERTED if cable present */ static int handle_usb(int connect_timeout) { @@ -546,6 +537,14 @@ static int handle_usb(int connect_timeout) return usb; (void)connect_timeout; } +#else +/* Ignore cable state */ +static int handle_usb(int connect_timeout) +{ + return USB_EXTRACTED; + (void)connect_timeout; +} +#else #endif #endif /* HAVE_BOOTLOADER_USB_MODE */ @@ -692,7 +691,8 @@ void* main(void) pinfo = disk_partinfo(1); if(pinfo->type == PARTITION_TYPE_OS2_HIDDEN_C_DRIVE) { - rc = load_mi4_part(loadbuffer, pinfo, MAX_LOADSIZE, usb); + rc = load_mi4_part(loadbuffer, pinfo, MAX_LOADSIZE, + usb == USB_INSERTED); if (rc < EOK) { printf("Can't load from partition"); printf(strerror(rc)); diff --git a/firmware/target/arm/iriver/usb-target.h b/firmware/target/arm/iriver/usb-target.h index 59e7eb5581..03aa2cbff7 100644 --- a/firmware/target/arm/iriver/usb-target.h +++ b/firmware/target/arm/iriver/usb-target.h @@ -25,5 +25,7 @@ #define USB_TARGET_H bool usb_init_device(void); +void usb_pin_init(void); /* Init the GPIO input only */ +bool usb_plugged(void); /* Returns instantaneous state - always */ #endif diff --git a/firmware/target/arm/tms320dm320/system-target.h b/firmware/target/arm/tms320dm320/system-target.h index 4e0a97f10e..1b94a93126 100644 --- a/firmware/target/arm/tms320dm320/system-target.h +++ b/firmware/target/arm/tms320dm320/system-target.h @@ -35,9 +35,10 @@ void dm320_set_io (char pin_num, bool input, bool invert, bool irq, bool irqany, bool chat, char func_num ); #if defined(CREATIVE_ZVx) && defined(BOOTLOADER) + /* hacky.. */ #define SLEEP_KERNEL_HOOK(ticks) \ - ({ \ /* hacky.. */ - long _sleep_ticks = current_tick + ticks + 1; \ + ({ \ + long _sleep_ticks = current_tick + (ticks) + 1; \ while (TIME_BEFORE(current_tick, _sleep_ticks)) \ switch_thread(); \ true; }) /* handled here */ diff --git a/firmware/target/arm/usb-fw-pp5002.c b/firmware/target/arm/usb-fw-pp5002.c index f9682161c1..d1664c3607 100644 --- a/firmware/target/arm/usb-fw-pp5002.c +++ b/firmware/target/arm/usb-fw-pp5002.c @@ -75,4 +75,4 @@ int usb_detect(void) } /* No different for now */ -void usb_plugged(void) __attribute__((alias("usb_detect"))); +bool usb_plugged(void) __attribute__((alias("usb_detect"))); |