protocol_ntr.c: Change if block chain to a switch block
This commit is contained in:
parent
1f4c4911fc
commit
1059f73fb8
@ -13,21 +13,28 @@ void NTR_SendCommand(const u32 command[2], u32 pageSize, u32 latency, void* buff
|
|||||||
}
|
}
|
||||||
|
|
||||||
pageSize -= pageSize & 3; // align to 4 byte
|
pageSize -= pageSize & 3; // align to 4 byte
|
||||||
|
|
||||||
u32 pageParam = NTRCARD_PAGESIZE_4K;
|
u32 pageParam = NTRCARD_PAGESIZE_4K;
|
||||||
u32 transferLength = 4096;
|
u32 transferLength = 4096;
|
||||||
|
|
||||||
// make zero read and 4 byte read a little special for timing optimization(and 512 too)
|
// make zero read and 4 byte read a little special for timing optimization(and 512 too)
|
||||||
if( 0 == pageSize ) {
|
switch (pageSize) {
|
||||||
transferLength = 0;
|
case 0:
|
||||||
pageParam = NTRCARD_PAGESIZE_0;
|
transferLength = 0;
|
||||||
} else if( 4 == pageSize ) {
|
pageParam = NTRCARD_PAGESIZE_0;
|
||||||
transferLength = 4;
|
break;
|
||||||
pageParam = NTRCARD_PAGESIZE_4;
|
case 4:
|
||||||
} else if( 512 == pageSize ) {
|
transferLength = 4;
|
||||||
transferLength = 512;
|
pageParam = NTRCARD_PAGESIZE_4;
|
||||||
pageParam = NTRCARD_PAGESIZE_512;
|
break;
|
||||||
} else if( 8192 == pageSize ) {
|
case 512:
|
||||||
transferLength = 8192;
|
transferLength = 512;
|
||||||
pageParam = NTRCARD_PAGESIZE_8K;
|
pageParam = NTRCARD_PAGESIZE_512;
|
||||||
|
break;
|
||||||
|
case 8192:
|
||||||
|
transferLength = 8192;
|
||||||
|
pageParam = NTRCARD_PAGESIZE_8K;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// go
|
// go
|
||||||
|
Loading…
x
Reference in New Issue
Block a user