Fix more warnings.

Change-Id: Ib3a9fc622a46b1fc72e94dcbc6d29d2e430cd81b
This commit is contained in:
Solomon Peachy 2020-10-13 14:43:29 -04:00
parent 431caa4311
commit b94db707fb
11 changed files with 41 additions and 19 deletions

View file

@ -334,7 +334,7 @@ static int get_section_address(int section)
int flash_rockbox(const char *filename, int section) int flash_rockbox(const char *filename, int section)
{ {
struct flash_header hdr; struct flash_header hdr;
int pos, i, len, rc; int pos, i, len/*, rc */;
unsigned long checksum, sum; unsigned long checksum, sum;
unsigned char *p8; unsigned char *p8;
uint16_t *p16; uint16_t *p16;
@ -390,7 +390,7 @@ int flash_rockbox(const char *filename, int section)
rb->lcd_putsf(0, 3, "Erasing... %d%%", (i+SEC_SIZE)*100/len); rb->lcd_putsf(0, 3, "Erasing... %d%%", (i+SEC_SIZE)*100/len);
rb->lcd_update(); rb->lcd_update();
rc = cfi_erase_sector(FB + (i + pos)/2); /*rc = */cfi_erase_sector(FB + (i + pos)/2);
} }
/* Write the magic and size. */ /* Write the magic and size. */

View file

@ -326,7 +326,7 @@ static bool pmu_is_hibernated(void)
*/ */
void main(void) void main(void)
{ {
int fw = FW_ROCKBOX; // int fw = FW_ROCKBOX;
int rc = 0; int rc = 0;
unsigned char *loadbuffer; unsigned char *loadbuffer;
int (*kernel_entry)(void); int (*kernel_entry)(void);
@ -337,7 +337,7 @@ void main(void)
i2c_preinit(0); i2c_preinit(0);
if (pmu_is_hibernated()) { if (pmu_is_hibernated()) {
fw = FW_APPLE; // fw = FW_APPLE;
rc = launch_onb(1); /* 27/2 = 13.5 MHz. */ rc = launch_onb(1); /* 27/2 = 13.5 MHz. */
} }
@ -375,7 +375,7 @@ void main(void)
if ((btn == BUTTON_MENU) if ((btn == BUTTON_MENU)
|| (btn == (BUTTON_SELECT|BUTTON_LEFT)) || (btn == (BUTTON_SELECT|BUTTON_LEFT))
|| (btn == (BUTTON_SELECT|BUTTON_PLAY))) { || (btn == (BUTTON_SELECT|BUTTON_PLAY))) {
fw = FW_APPLE; // fw = FW_APPLE;
rc = kernel_launch_onb(); rc = kernel_launch_onb();
} }
} }
@ -410,7 +410,7 @@ void main(void)
/* We wait until HDD spins up to check for hold button */ /* We wait until HDD spins up to check for hold button */
if (button_hold()) { if (button_hold()) {
fw = FW_APPLE; // fw = FW_APPLE;
printf("Executing OF..."); printf("Executing OF...");
ata_sleepnow(); ata_sleepnow();
rc = kernel_launch_onb(); rc = kernel_launch_onb();

View file

@ -226,7 +226,7 @@ bool rtc_check_alarm_flag(void)
/* read Control 2 register which contains alarm flag */ /* read Control 2 register which contains alarm flag */
rv = i2c_readbytes(RTC_ADDR, RTC_CTRL2, 1, &tmp); rv = i2c_readbytes(RTC_ADDR, RTC_CTRL2, 1, &tmp);
(void)rv;
return (tmp & RTC_AF); return (tmp & RTC_AF);
} }
#endif /* HAVE_RTC_ALARM */ #endif /* HAVE_RTC_ALARM */

View file

@ -97,9 +97,11 @@ int button_read_device(void)
int buttons = int_btn; int buttons = int_btn;
unsigned char state; unsigned char state;
static bool hold_button = false; static bool hold_button = false;
#ifndef BOOTLOADER
bool hold_button_old; bool hold_button_old;
hold_button_old = hold_button; hold_button_old = hold_button;
#endif
hold_button = button_hold(); hold_button = button_hold();
#ifndef BOOTLOADER #ifndef BOOTLOADER

View file

@ -103,10 +103,14 @@ int button_read_device(void)
int btn = BUTTON_NONE; int btn = BUTTON_NONE;
#endif /* (SAMSUNG_YH920) || (SAMSUNG_YH925) */ #endif /* (SAMSUNG_YH920) || (SAMSUNG_YH925) */
static bool hold_button = false; static bool hold_button = false;
#ifndef BOOTLOADER
bool hold_button_old; bool hold_button_old;
#endif
/* Hold */ /* Hold */
#ifndef BOOTLOADER
hold_button_old = hold_button; hold_button_old = hold_button;
#endif
hold_button = button_hold(); hold_button = button_hold();
#ifndef BOOTLOADER #ifndef BOOTLOADER

View file

@ -352,12 +352,16 @@ static struct queue_head qh_array[USB_NUM_ENDPOINTS*2]
static struct semaphore transfer_completion_signal[USB_NUM_ENDPOINTS*2] static struct semaphore transfer_completion_signal[USB_NUM_ENDPOINTS*2]
SHAREDBSS_ATTR; SHAREDBSS_ATTR;
static const unsigned int pipe2mask[] = { static const unsigned int pipe2mask[USB_NUM_ENDPOINTS*2] = {
0x01, 0x010000, 0x01, 0x010000,
0x02, 0x020000, 0x02, 0x020000,
0x04, 0x040000, 0x04, 0x040000,
#if USB_NUM_ENDPOINTS > 3
0x08, 0x080000, 0x08, 0x080000,
#endif
#if USB_NUM_ENDPOINTS > 4
0x10, 0x100000, 0x10, 0x100000,
#endif
}; };
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/

View file

@ -50,15 +50,11 @@ int button_read_device(void)
{ {
int btn = BUTTON_NONE; int btn = BUTTON_NONE;
#ifndef BOOTLOADER #ifndef BOOTLOADER
bool hold_button_old;
bool remote_hold_button_old; bool remote_hold_button_old;
#endif #endif
int data; int data;
/* normal buttons */ /* normal buttons */
#ifndef BOOTLOADER
hold_button_old = hold_button;
#endif
hold_button = button_hold(); hold_button = button_hold();
if (!hold_button) if (!hold_button)

View file

@ -68,14 +68,17 @@ int button_read_device(void)
static bool remote_hold_button = false; static bool remote_hold_button = false;
static int prev_data = 0xff; static int prev_data = 0xff;
static int last_valid = 0xff; static int last_valid = 0xff;
#ifndef BOOTLOADER
bool hold_button_old; bool hold_button_old;
bool remote_hold_button_old; bool remote_hold_button_old;
#endif
/* normal buttons */ /* normal buttons */
#ifndef BOOTLOADER
hold_button_old = hold_button; hold_button_old = hold_button;
#endif
hold_button = button_hold(); hold_button = button_hold();
#ifndef BOOTLOADER #ifndef BOOTLOADER
if (hold_button != hold_button_old) if (hold_button != hold_button_old)
backlight_hold_changed(hold_button); backlight_hold_changed(hold_button);
@ -120,7 +123,9 @@ int button_read_device(void)
} }
/* remote buttons */ /* remote buttons */
#ifndef BOOTLOADER
remote_hold_button_old = remote_hold_button; remote_hold_button_old = remote_hold_button;
#endif
remote_hold_button = remote_button_hold_only(); remote_hold_button = remote_button_hold_only();
#ifndef BOOTLOADER #ifndef BOOTLOADER

View file

@ -84,14 +84,17 @@ int button_read_device(void)
static bool remote_hold_button = false; static bool remote_hold_button = false;
static int prev_data = 0xff; static int prev_data = 0xff;
static int last_valid = 0xff; static int last_valid = 0xff;
#ifndef BOOTLOADER
bool hold_button_old; bool hold_button_old;
bool remote_hold_button_old; bool remote_hold_button_old;
#endif
/* normal buttons */ /* normal buttons */
#ifndef BOOTLOADER
hold_button_old = hold_button; hold_button_old = hold_button;
#endif
hold_button = button_hold(); hold_button = button_hold();
#ifndef BOOTLOADER #ifndef BOOTLOADER
if (hold_button != hold_button_old) if (hold_button != hold_button_old)
backlight_hold_changed(hold_button); backlight_hold_changed(hold_button);
@ -130,7 +133,9 @@ int button_read_device(void)
} }
/* remote buttons */ /* remote buttons */
#ifndef BOOTLOADER
remote_hold_button_old = remote_hold_button; remote_hold_button_old = remote_hold_button;
#endif
remote_hold_button = remote_button_hold_only(); remote_hold_button = remote_button_hold_only();
#ifndef BOOTLOADER #ifndef BOOTLOADER

View file

@ -39,7 +39,9 @@ void ata_reset(void)
void ata_enable(bool on) void ata_enable(bool on)
{ {
#ifndef BOOTLOADER
static bool init = true; static bool init = true;
#endif
/* Ide power toggling is a nasty hack to allow USB bridge operation /* Ide power toggling is a nasty hack to allow USB bridge operation
* in rockbox. For some reason GL811E bridge doesn't like the state * in rockbox. For some reason GL811E bridge doesn't like the state
@ -59,8 +61,8 @@ void ata_enable(bool on)
sleep(1); sleep(1);
ide_power_enable(true); ide_power_enable(true);
} }
#endif
init = false; init = false;
#endif
} }
else else
{ {

View file

@ -69,14 +69,18 @@ int button_read_device(void)
static bool hold_button = false; static bool hold_button = false;
bool remote_hold_button = false; bool remote_hold_button = false;
#ifndef BOOTLOADER
bool hold_button_old; bool hold_button_old;
#endif
bool remote_present; bool remote_present;
/* check if we have remote connected */ /* check if we have remote connected */
remote_present = remote_detect(); remote_present = remote_detect();
/* read hold buttons status */ /* read hold buttons status */
#ifndef BOOTLOADER
hold_button_old = hold_button; hold_button_old = hold_button;
#endif
hold_button = button_hold(); hold_button = button_hold();
remote_hold_button = remote_button_hold(); remote_hold_button = remote_button_hold();