diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 46 | ||||
-rw-r--r-- | apps/main.c | 3 | ||||
-rw-r--r-- | apps/misc.c | 3 | ||||
-rw-r--r-- | apps/screens.c | 4 |
4 files changed, 30 insertions, 26 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 0b39430d56..fe7d5b584b 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #include "fat.h" | 59 | #include "fat.h" |
60 | #include "mas.h" | 60 | #include "mas.h" |
61 | #include "eeprom_24cxx.h" | 61 | #include "eeprom_24cxx.h" |
62 | #ifdef HAVE_MMC | 62 | #if defined(HAVE_MMC) || defined(HAVE_HOTSWAP) |
63 | #include "ata_mmc.h" | 63 | #include "ata_mmc.h" |
64 | #endif | 64 | #endif |
65 | #if CONFIG_TUNER | 65 | #if CONFIG_TUNER |
@@ -1524,8 +1524,8 @@ static bool view_battery(void) | |||
1524 | #endif | 1524 | #endif |
1525 | 1525 | ||
1526 | #ifndef SIMULATOR | 1526 | #ifndef SIMULATOR |
1527 | #ifdef HAVE_MMC | 1527 | #if defined(HAVE_MMC) || defined(HAVE_HOTSWAP) |
1528 | static bool dbg_mmc_info(void) | 1528 | static bool dbg_card_info(void) |
1529 | { | 1529 | { |
1530 | bool done = false; | 1530 | bool done = false; |
1531 | int currval = 0; | 1531 | int currval = 0; |
@@ -1548,7 +1548,7 @@ static bool dbg_mmc_info(void) | |||
1548 | 1548 | ||
1549 | while (!done) | 1549 | while (!done) |
1550 | { | 1550 | { |
1551 | card = mmc_card_info(currval / 2); | 1551 | card = card_get_info(currval / 2); |
1552 | 1552 | ||
1553 | line = 0; | 1553 | line = 0; |
1554 | lcd_clear_display(); | 1554 | lcd_clear_display(); |
@@ -1564,29 +1564,29 @@ static bool dbg_mmc_info(void) | |||
1564 | 1564 | ||
1565 | strncpy(card_name, ((unsigned char*)card->cid) + 3, 6); | 1565 | strncpy(card_name, ((unsigned char*)card->cid) + 3, 6); |
1566 | snprintf(pbuf, sizeof(pbuf), "%s Rev %d.%d", card_name, | 1566 | snprintf(pbuf, sizeof(pbuf), "%s Rev %d.%d", card_name, |
1567 | (int) mmc_extract_bits(card->cid, 72, 4), | 1567 | (int) card_extract_bits(card->cid, 72, 4), |
1568 | (int) mmc_extract_bits(card->cid, 76, 4)); | 1568 | (int) card_extract_bits(card->cid, 76, 4)); |
1569 | lcd_puts(0, line++, pbuf); | 1569 | lcd_puts(0, line++, pbuf); |
1570 | snprintf(pbuf, sizeof(pbuf), "Prod: %d/%d", | 1570 | snprintf(pbuf, sizeof(pbuf), "Prod: %d/%d", |
1571 | (int) mmc_extract_bits(card->cid, 112, 4), | 1571 | (int) card_extract_bits(card->cid, 112, 4), |
1572 | (int) mmc_extract_bits(card->cid, 116, 4) + 1997); | 1572 | (int) card_extract_bits(card->cid, 116, 4) + 1997); |
1573 | lcd_puts(0, line++, pbuf); | 1573 | lcd_puts(0, line++, pbuf); |
1574 | snprintf(pbuf, sizeof(pbuf), "Ser#: 0x%08lx", | 1574 | snprintf(pbuf, sizeof(pbuf), "Ser#: 0x%08lx", |
1575 | mmc_extract_bits(card->cid, 80, 32)); | 1575 | card_extract_bits(card->cid, 80, 32)); |
1576 | lcd_puts(0, line++, pbuf); | 1576 | lcd_puts(0, line++, pbuf); |
1577 | snprintf(pbuf, sizeof(pbuf), "M=%02x, O=%04x", | 1577 | snprintf(pbuf, sizeof(pbuf), "M=%02x, O=%04x", |
1578 | (int) mmc_extract_bits(card->cid, 0, 8), | 1578 | (int) card_extract_bits(card->cid, 0, 8), |
1579 | (int) mmc_extract_bits(card->cid, 8, 16)); | 1579 | (int) card_extract_bits(card->cid, 8, 16)); |
1580 | lcd_puts(0, line++, pbuf); | 1580 | lcd_puts(0, line++, pbuf); |
1581 | temp = mmc_extract_bits(card->csd, 2, 4); | 1581 | temp = card_extract_bits(card->csd, 2, 4); |
1582 | snprintf(pbuf, sizeof(pbuf), "MMC v%s", temp < 5 ? | 1582 | snprintf(pbuf, sizeof(pbuf), "MMC v%s", temp < 5 ? |
1583 | spec_vers[temp] : "?.?"); | 1583 | spec_vers[temp] : "?.?"); |
1584 | lcd_puts(0, line++, pbuf); | 1584 | lcd_puts(0, line++, pbuf); |
1585 | snprintf(pbuf, sizeof(pbuf), "Blocks: 0x%06lx", card->numblocks); | 1585 | snprintf(pbuf, sizeof(pbuf), "Blocks: 0x%06lx", card->numblocks); |
1586 | lcd_puts(0, line++, pbuf); | 1586 | lcd_puts(0, line++, pbuf); |
1587 | snprintf(pbuf, sizeof(pbuf), "Blksz.: %d P:%c%c", card->blocksize, | 1587 | snprintf(pbuf, sizeof(pbuf), "Blksz.: %d P:%c%c", card->blocksize, |
1588 | mmc_extract_bits(card->csd, 48, 1) ? 'R' : '-', | 1588 | card_extract_bits(card->csd, 48, 1) ? 'R' : '-', |
1589 | mmc_extract_bits(card->csd, 106, 1) ? 'W' : '-'); | 1589 | card_extract_bits(card->csd, 106, 1) ? 'W' : '-'); |
1590 | lcd_puts(0, line++, pbuf); | 1590 | lcd_puts(0, line++, pbuf); |
1591 | } | 1591 | } |
1592 | else /* Technical details */ | 1592 | else /* Technical details */ |
@@ -1606,12 +1606,12 @@ static bool dbg_mmc_info(void) | |||
1606 | snprintf(pbuf, sizeof(pbuf), "R2W: *%d", card->r2w_factor); | 1606 | snprintf(pbuf, sizeof(pbuf), "R2W: *%d", card->r2w_factor); |
1607 | lcd_puts(0, line++, pbuf); | 1607 | lcd_puts(0, line++, pbuf); |
1608 | snprintf(pbuf, sizeof(pbuf), "IRmax: %d..%d mA", | 1608 | snprintf(pbuf, sizeof(pbuf), "IRmax: %d..%d mA", |
1609 | i_vmin[mmc_extract_bits(card->csd, 66, 3)], | 1609 | i_vmin[card_extract_bits(card->csd, 66, 3)], |
1610 | i_vmax[mmc_extract_bits(card->csd, 69, 3)]); | 1610 | i_vmax[card_extract_bits(card->csd, 69, 3)]); |
1611 | lcd_puts(0, line++, pbuf); | 1611 | lcd_puts(0, line++, pbuf); |
1612 | snprintf(pbuf, sizeof(pbuf), "IWmax: %d..%d mA", | 1612 | snprintf(pbuf, sizeof(pbuf), "IWmax: %d..%d mA", |
1613 | i_vmin[mmc_extract_bits(card->csd, 72, 3)], | 1613 | i_vmin[card_extract_bits(card->csd, 72, 3)], |
1614 | i_vmax[mmc_extract_bits(card->csd, 75, 3)]); | 1614 | i_vmax[card_extract_bits(card->csd, 75, 3)]); |
1615 | lcd_puts(0, line++, pbuf); | 1615 | lcd_puts(0, line++, pbuf); |
1616 | } | 1616 | } |
1617 | } | 1617 | } |
@@ -1642,7 +1642,7 @@ static bool dbg_mmc_info(void) | |||
1642 | action_signalscreenchange(); | 1642 | action_signalscreenchange(); |
1643 | return false; | 1643 | return false; |
1644 | } | 1644 | } |
1645 | #else /* !HAVE_MMC */ | 1645 | #else /* !defined(HAVE_MMC) && !defined(HAVE_HOTSWAP) */ |
1646 | static bool dbg_disk_info(void) | 1646 | static bool dbg_disk_info(void) |
1647 | { | 1647 | { |
1648 | char buf[128]; | 1648 | char buf[128]; |
@@ -1799,7 +1799,7 @@ static bool dbg_disk_info(void) | |||
1799 | action_signalscreenchange(); | 1799 | action_signalscreenchange(); |
1800 | return false; | 1800 | return false; |
1801 | } | 1801 | } |
1802 | #endif /* !HAVE_MMC */ | 1802 | #endif /* !defined(HAVE_MMC) && !defined(HAVE_HOTSWAP) */ |
1803 | #endif /* !SIMULATOR */ | 1803 | #endif /* !SIMULATOR */ |
1804 | 1804 | ||
1805 | #ifdef HAVE_DIRCACHE | 1805 | #ifdef HAVE_DIRCACHE |
@@ -2278,8 +2278,10 @@ static const struct the_menu_item menuitems[] = { | |||
2278 | { "View partitions", dbg_partitions }, | 2278 | { "View partitions", dbg_partitions }, |
2279 | #endif | 2279 | #endif |
2280 | #ifndef SIMULATOR | 2280 | #ifndef SIMULATOR |
2281 | #ifdef HAVE_MMC | 2281 | #if defined(HAVE_MMC) |
2282 | { "View MMC info", dbg_mmc_info }, | 2282 | { "View MMC info", dbg_card_info }, |
2283 | #elif defined(HAVE_HOTSWAP) | ||
2284 | { "View microSD info", dbg_card_info }, | ||
2283 | #else | 2285 | #else |
2284 | { "View disk info", dbg_disk_info }, | 2286 | { "View disk info", dbg_disk_info }, |
2285 | #endif | 2287 | #endif |
diff --git a/apps/main.c b/apps/main.c index 3dfab06280..2dd90ef5fe 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -430,7 +430,8 @@ static void init(void) | |||
430 | /* enter USB mode early, before trying to mount */ | 430 | /* enter USB mode early, before trying to mount */ |
431 | if (button_get_w_tmo(HZ/10) == SYS_USB_CONNECTED) | 431 | if (button_get_w_tmo(HZ/10) == SYS_USB_CONNECTED) |
432 | #ifdef HAVE_MMC | 432 | #ifdef HAVE_MMC |
433 | if (!mmc_touched() || (mmc_remove_request() == SYS_MMC_EXTRACTED)) | 433 | if (!mmc_touched() || |
434 | (mmc_remove_request() == SYS_HOTSWAP_EXTRACTED)) | ||
434 | #endif | 435 | #endif |
435 | { | 436 | { |
436 | usb_screen(); | 437 | usb_screen(); |
diff --git a/apps/misc.c b/apps/misc.c index 88ec73e2d3..daa96b006a 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -828,7 +828,8 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame | |||
828 | if (callback != NULL) | 828 | if (callback != NULL) |
829 | callback(parameter); | 829 | callback(parameter); |
830 | #ifdef HAVE_MMC | 830 | #ifdef HAVE_MMC |
831 | if (!mmc_touched() || (mmc_remove_request() == SYS_MMC_EXTRACTED)) | 831 | if (!mmc_touched() || |
832 | (mmc_remove_request() == SYS_HOTSWAP_EXTRACTED)) | ||
832 | #endif | 833 | #endif |
833 | { | 834 | { |
834 | scrobbler_flush_cache(); | 835 | scrobbler_flush_cache(); |
diff --git a/apps/screens.c b/apps/screens.c index d8e3121121..aebb7bd469 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -163,8 +163,8 @@ int mmc_remove_request(void) | |||
163 | queue_wait_w_tmo(&button_queue, &ev, HZ/2); | 163 | queue_wait_w_tmo(&button_queue, &ev, HZ/2); |
164 | switch (ev.id) | 164 | switch (ev.id) |
165 | { | 165 | { |
166 | case SYS_MMC_EXTRACTED: | 166 | case SYS_HOTSWAP_EXTRACTED: |
167 | return SYS_MMC_EXTRACTED; | 167 | return SYS_HOTSWAP_EXTRACTED; |
168 | 168 | ||
169 | case SYS_USB_DISCONNECTED: | 169 | case SYS_USB_DISCONNECTED: |
170 | return SYS_USB_DISCONNECTED; | 170 | return SYS_USB_DISCONNECTED; |