Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osu-fpga
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fang Lu
osu-fpga
Commits
4c4244a0
Commit
4c4244a0
authored
7 years ago
by
Fang Lu
Browse files
Options
Downloads
Patches
Plain Diff
sdcard - adapt for nios2/f
parent
33858f9e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
software/osu_main/src/main.c
+3
-2
3 additions, 2 deletions
software/osu_main/src/main.c
software/osu_main/src/sdcard/terasic_sdcard/sd_hal.c
+5
-5
5 additions, 5 deletions
software/osu_main/src/sdcard/terasic_sdcard/sd_hal.c
with
8 additions
and
7 deletions
software/osu_main/src/main.c
+
3
−
2
View file @
4c4244a0
...
...
@@ -53,7 +53,7 @@ int main() {
}
}
/*
// Test sdcard
osu_init_device
();
osu_meta
o_meta
;
...
...
@@ -62,6 +62,7 @@ int main() {
printf
(
"Sdcard mount success!
\n
"
);
printf
(
"magic:%c%c%c%c
\n
"
,
o_meta
.
magic
[
0
],
o_meta
.
magic
[
1
],
o_meta
.
magic
[
2
],
o_meta
.
magic
[
3
]);
printf
(
"Song Count:%d
\n
"
,
o_meta
.
songs
);
break
;
}
else
{
printf
(
"Failed to mount the SDCARD!
\r\n
Please retry!
\r\n
"
);
usleep
(
1000000
);
...
...
@@ -69,7 +70,7 @@ int main() {
}
}
// while
*/
uint16_t
dim
=
0
;
while
(
1
)
{
...
...
This diff is collapsed.
Click to expand it.
software/osu_main/src/sdcard/terasic_sdcard/sd_hal.c
+
5
−
5
View file @
4c4244a0
...
...
@@ -54,11 +54,7 @@ volatile uint32_t* SDData = SD_BASE;*/
bool
SDHAL_IsSupport4Bits
(
void
){
bool
bYes
=
FALSE
;
#ifdef SD_4BIT_MODE
bYes
=
TRUE
;
#endif
return
bYes
;
return
TRUE
;
}
void
SDHAL_Init
(
void
){
...
...
@@ -78,6 +74,7 @@ void SDHAL_SendCmd(alt_u8 szCommand[6], int nCmdLen){
}
//*InterfaceCmd = 1;
IOWR_32DIRECT
(
InterfaceCmd
,
0
,
1
);
while
(
!
(
IORD_32DIRECT
(
InterfaceStatus
,
0
)));
}
...
...
@@ -108,6 +105,7 @@ bool SDHAL_GetResponse(alt_u8 szResponse[], int nLen){
//*InterfaceCmd = 4;
IOWR_32DIRECT
(
InterfaceCmd
,
0
,
4
);
while
(
!
(
IORD_32DIRECT
(
InterfaceStatus
,
0
)));
return
1
;
}
...
...
@@ -130,6 +128,7 @@ bool SDHAL_ReadData(alt_u8 szBuf[], int nBufLen){
IOWR_32DIRECT
(
InterfaceCmd
,
0
,
5
);
//*InterfaceCmd = 4;
//Jump 16 + 1 + 8 = 25 cycles
while
(
!
(
IORD_32DIRECT
(
InterfaceStatus
,
0
)));
return
1
;
}
...
...
@@ -143,6 +142,7 @@ bool SDHAL_WriteData(alt_u8 szDataWrite[], int nDataLen){
void
SDHAL_DummyClock
(
int
nClockCnt
){
//*InterfaceCmd = 4;
IOWR_32DIRECT
(
InterfaceCmd
,
0
,
4
);
while
(
!
(
IORD_32DIRECT
(
InterfaceStatus
,
0
)));
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment