Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet_Pico_ordi_B6
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Man hing Ling
Projet_Pico_ordi_B6
Commits
b62d53d0
Commit
b62d53d0
authored
1 year ago
by
chayrai
Browse files
Options
Downloads
Patches
Plain Diff
micro système de fichier complet
parent
f1857ac2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SD/picofs.c
+7
-16
7 additions, 16 deletions
SD/picofs.c
with
7 additions
and
16 deletions
SD/picofs.c
+
7
−
16
View file @
b62d53d0
...
@@ -459,12 +459,9 @@ void CP(SD_info *sd, char *source_filename, char *destination_filename) {
...
@@ -459,12 +459,9 @@ void CP(SD_info *sd, char *source_filename, char *destination_filename) {
// Copie du nom de la copie dans le bloc de description
// Copie du nom de la copie dans le bloc de description
writeBlock
(
sd
,
destination_offset
,
0
,
destination_filename
,
strlen
(
destination_filename
));
writeBlock
(
sd
,
destination_offset
,
0
,
destination_filename
,
strlen
(
destination_filename
));
// Copier les blocs de données associés au fichier source dans de nouveaux blocs de données pour le fichier destination
//for (int i = 1; i < MAX_BLOCKS_PER_FILE_DESCRIPTION; i++) {
// Lecture des numéros de bloc dans les blocs de description
// Lecture des numéros de bloc dans les blocs de description
//for (int byteNum=0; byteNum<BLOCK_SIZE; byteNum+=2) {
readBlock
(
sd
,
source_offset
+
1
,
0
,
numBuffer
,
2
);
readBlock
(
sd
,
source_offset
+
1
,
0
,
numBuffer
,
2
);
...
@@ -475,7 +472,7 @@ void CP(SD_info *sd, char *source_filename, char *destination_filename) {
...
@@ -475,7 +472,7 @@ void CP(SD_info *sd, char *source_filename, char *destination_filename) {
return
;
return
;
}
}
//for (int chunkStart = 0; chunkStart < BLOCK_SIZE; chunkStart += //CHUNK_SIZE) {
// On stocke le bloc de données associé au fichier source dans descriptionBuffer
// On stocke le bloc de données associé au fichier source dans descriptionBuffer
readBlock
(
sd
,
numDataBlock
,
0
,
descriptionBuffer
,
CHUNK_SIZE
);
readBlock
(
sd
,
numDataBlock
,
0
,
descriptionBuffer
,
CHUNK_SIZE
);
...
@@ -502,7 +499,7 @@ void CP(SD_info *sd, char *source_filename, char *destination_filename) {
...
@@ -502,7 +499,7 @@ void CP(SD_info *sd, char *source_filename, char *destination_filename) {
// Ecriture du bloc de données dans le premier bloc disponible
// Ecriture du bloc de données dans le premier bloc disponible
writeBlock
(
sd
,
newDataBlock
,
0
,
descriptionBuffer
,
CHUNK_SIZE
);
writeBlock
(
sd
,
newDataBlock
,
0
,
descriptionBuffer
,
CHUNK_SIZE
);
printf
(
"
\n
La copie de
\"
%s
\"
sous le nom
\"
%s
\"
a été créée avec succès.
\n
"
,
source_filename
,
destination_filename
);
printf
(
"
\n
La copie de
\"
%s
\"
sous le nom
\"
%s
\"
a été créée avec succès.
\n
"
,
source_filename
,
destination_filename
);
//}
}
}
...
@@ -515,13 +512,7 @@ int main(int argc, char *argv[]) {
...
@@ -515,13 +512,7 @@ int main(int argc, char *argv[]) {
SD_info
sd
;
SD_info
sd
;
init_printf
();
init_printf
();
spi_init
();
spi_init
();
uint8_t
result
=
sd_init
(
&
sd
);
sd_init
(
&
sd
);
printf
(
"result=%x
\n
"
,
result
);
printf
(
"status=%x
\n
"
,
sd
.
status_
);
printf
(
"erreur=%x
\n
"
,
sd
.
errorCode_
);
printf
(
"type=%x
\n
"
,
sd
.
type_
);
uint32_t
size
=
cardSize
(
&
sd
);
printf
(
"taille=%ld
\n\n
"
,
size
);
printf
(
"Pico ordinateur OK
\n\n
"
);
printf
(
"Pico ordinateur OK
\n\n
"
);
...
@@ -598,7 +589,7 @@ int main(int argc, char *argv[]) {
...
@@ -598,7 +589,7 @@ int main(int argc, char *argv[]) {
}
}
else
else
{
{
printf
(
"
\n
La commande entr
e
e %s, n'a pas été reconnue
\n
"
,
current_cmd
);
printf
(
"
\n
La commande entr
é
e %s, n'a pas été reconnue
\n
"
,
current_cmd
);
}
}
printf
(
"
\n
PicoOrdi>"
);
printf
(
"
\n
PicoOrdi>"
);
current_cmd
[
0
]
=
'\0'
;
// Réinitialise la chaîne
current_cmd
[
0
]
=
'\0'
;
// Réinitialise la chaîne
...
...
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