mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Implement iPod Nano 2G storage active indicator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23325 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
16a956c4f3
commit
49d4c428dc
2 changed files with 9 additions and 10 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include <pmu-target.h>
|
||||
#include <mmu-target.h>
|
||||
#include <string.h>
|
||||
#include "led.h"
|
||||
|
||||
|
||||
#define NAND_CMD_READ 0x00
|
||||
|
|
@ -101,6 +102,7 @@ static uint8_t nand_ecc[0x30] __attribute__((aligned(16)));
|
|||
|
||||
uint32_t nand_unlock(uint32_t rc)
|
||||
{
|
||||
led(false);
|
||||
mutex_unlock(&nand_mtx);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -349,6 +351,7 @@ uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer,
|
|||
if (sparebuffer && !((uint32_t)sparebuffer & 0xf))
|
||||
spare = (uint8_t*)sparebuffer;
|
||||
mutex_lock(&nand_mtx);
|
||||
led(true);
|
||||
if (!nand_powered) nand_power_up();
|
||||
uint32_t rc, eccresult;
|
||||
nand_set_fmctrl0(bank, FMCTRL0_ENABLEDMA);
|
||||
|
|
@ -405,6 +408,7 @@ uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer,
|
|||
if (sparebuffer && !((uint32_t)sparebuffer & 0xf))
|
||||
spare = (uint8_t*)sparebuffer;
|
||||
mutex_lock(&nand_mtx);
|
||||
led(true);
|
||||
if (!nand_powered) nand_power_up();
|
||||
if (sparebuffer)
|
||||
{
|
||||
|
|
@ -438,6 +442,7 @@ uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer,
|
|||
uint32_t nand_block_erase(uint32_t bank, uint32_t page)
|
||||
{
|
||||
mutex_lock(&nand_mtx);
|
||||
led(true);
|
||||
if (!nand_powered) nand_power_up();
|
||||
nand_set_fmctrl0(bank, 0);
|
||||
if (nand_send_cmd(NAND_CMD_BLOCKERASE)) return nand_unlock(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue