1
0
Fork 0
forked from len0rd/rockbox

fix more yellow

Change-Id: I74bad58707d05ea167169d4315c05eb0cd1c8b7b
This commit is contained in:
Solomon Peachy 2020-10-13 17:09:13 -04:00
parent b94db707fb
commit 09785a8499
6 changed files with 16 additions and 6 deletions

View file

@ -1521,13 +1521,16 @@ static int ata_smart_attr_to_string(
break; break;
case RAWFMT_RAW48: case RAWFMT_RAW48:
default: default: {
uint32_t tmp;
memcpy(&tmp, w, sizeof(tmp));
/* shows first 4 bytes of raw data as uint32 LE, /* shows first 4 bytes of raw data as uint32 LE,
and the ramaining 2 bytes as uint16 LE */ and the ramaining 2 bytes as uint16 LE */
len += snprintf(buf+len, size-len, "%lu", letoh32(*((uint32_t*)w))); len += snprintf(buf+len, size-len, "%lu", letoh32(tmp));
if (w[2] && (len < size)) if (w[2] && (len < size))
len += snprintf(buf+len, size-len, " %u", w[2]); len += snprintf(buf+len, size-len, " %u", w[2]);
break; break;
}
} }
/* ignore trailing \0 when truncated */ /* ignore trailing \0 when truncated */
if (len >= size) len = size-1; if (len >= size) len = size-1;

View file

@ -460,7 +460,7 @@ void show_fatal_error(void)
int flash_bootloader(const char *filename) int flash_bootloader(const char *filename)
{ {
char *bootsector; char *bootsector;
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;
@ -509,7 +509,7 @@ int flash_bootloader(const char *filename)
/* Erase the bootloader flash section. */ /* Erase the bootloader flash section. */
for (i = BOOTLOADER_ENTRYPOINT/SEC_SIZE; i < 0x200; i++) for (i = BOOTLOADER_ENTRYPOINT/SEC_SIZE; i < 0x200; i++)
rc = cfi_erase_sector(FB + (SEC_SIZE/2) * i); /*rc =*/ cfi_erase_sector(FB + (SEC_SIZE/2) * i);
pos = BOOTLOADER_ENTRYPOINT/2; pos = BOOTLOADER_ENTRYPOINT/2;
p16 = (uint16_t *)audiobuf; p16 = (uint16_t *)audiobuf;

View file

@ -365,6 +365,7 @@ static void usb_handle_data_int(int ep, int dir)
endpoints[ep].in_ack = 1; endpoints[ep].in_ack = 1;
} }
logf("usb_handle_data_int(%d, %d) finished", ep, dir); logf("usb_handle_data_int(%d, %d) finished", ep, dir);
void(len);
} }
bool usb_drv_powered(void) bool usb_drv_powered(void)

View file

@ -137,9 +137,11 @@ static int button_read_device_v2(void) {
int button_read_device(void) { int button_read_device(void) {
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
@ -147,7 +149,7 @@ int button_read_device(void) {
backlight_hold_changed(hold_button); backlight_hold_changed(hold_button);
} }
#endif #endif
if (hold_button) { if (hold_button) {
return 0; return 0;
} else if (kbd_type == KEYBOARD_V1) { } else if (kbd_type == KEYBOARD_V1) {

View file

@ -40,10 +40,12 @@ int button_read_device(void)
{ {
int btn = BUTTON_NONE; int btn = BUTTON_NONE;
static bool hold_button = false; static bool hold_button = false;
#ifndef BOOTLOADER
bool hold_button_old; bool hold_button_old;
/* Hold */ /* Hold */
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

@ -194,13 +194,15 @@ int button_read_device(void)
int data = 0; int data = 0;
static bool hold_button = false; static bool hold_button = false;
#ifndef BOOTLOADER
bool hold_button_old; bool hold_button_old;
/* read hold buttons status */ /* read hold buttons status */
hold_button_old = hold_button; hold_button_old = hold_button;
#endif
hold_button = button_hold(); hold_button = button_hold();
#ifndef BOOTLOADER #ifndef BOOTLOADER
/* Only main hold affects backlight */ /* Only main hold affects backlight */
if (hold_button != hold_button_old) if (hold_button != hold_button_old)