mirror of
git://projects.qi-hardware.com/iris.git
synced 2025-04-21 12:27:27 +03:00
working on mass storage
This commit is contained in:
@@ -53,6 +53,7 @@ static volatile char *data
|
||||
static unsigned page_bits
|
||||
static unsigned redundant_bits
|
||||
static unsigned block_bits
|
||||
static unsigned size_bits
|
||||
static unsigned word_size
|
||||
|
||||
static void unbusy ():
|
||||
@@ -107,8 +108,9 @@ static void reset ():
|
||||
debug ("word size: %d\n", word_size)
|
||||
//unsigned serial_access_minimum = (d & 0x80 ? 25 : 50)
|
||||
d = rdata ()
|
||||
//unsigned num_planes = 1 << ((d >> 2) & 3)
|
||||
//unsigned plane_bits = 26 + ((d >> 4) & 7)
|
||||
unsigned num_planes_bits = d >> 2 & 3
|
||||
unsigned plane_bits = 26 + (d >> 4 & 7)
|
||||
size_bits = plane_bits + num_planes_bits - 3
|
||||
|
||||
static bool read (unsigned a, char *buffer):
|
||||
unsigned column = a & ((1 << page_bits) - 1)
|
||||
|
||||
@@ -26,7 +26,7 @@ udc_boot_programs = udc
|
||||
sd_boot_programs = sd+mmc partition fat
|
||||
standard_boot_programs = bootinit
|
||||
|
||||
programs = init gpio lcd bsquare ball buzzer metronome elfrun alarm rtc gui nand test boot booter $(udc_boot_programs) $(sd_boot_programs) $(standard_boot_programs)
|
||||
programs = init usb-mass-storage gpio lcd bsquare ball buzzer metronome elfrun alarm rtc gui nand test boot booter $(udc_boot_programs) $(sd_boot_programs) $(standard_boot_programs)
|
||||
|
||||
ARCH_CPPFLAGS = -I. -Imips -Imips/nanonote -Wa,-mips32 -DNANONOTE -DUSE_SERIAL
|
||||
CROSS = mipsel-linux-gnu-
|
||||
|
||||
@@ -155,7 +155,7 @@ void data::poll ():
|
||||
if !--lock:
|
||||
dir.clear ()
|
||||
continue
|
||||
case Iris::String::GET_BLOCK:
|
||||
case Iris::Block::GET_BLOCK:
|
||||
if buffer[1] >= dir.size ():
|
||||
std::cerr << "reading invalid file" << std::endl
|
||||
usb_release_interface (handle, 0)
|
||||
@@ -177,7 +177,7 @@ void data::poll ():
|
||||
handle = NULL
|
||||
return
|
||||
continue
|
||||
case Iris::String::GET_SIZE:
|
||||
case Iris::Block::GET_SIZE:
|
||||
if buffer[1] >= dir.size ():
|
||||
std::cerr << "reading invalid file size " << buffer[1] << " >= " << dir.size () << std::endl
|
||||
usb_release_interface (handle, 0)
|
||||
|
||||
Reference in New Issue
Block a user