Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
cm-projects
RIOT
Commits
1f409d09
Commit
1f409d09
authored
7 years ago
by
Vincent Dupont
Browse files
Options
Downloads
Patches
Plain Diff
drivers/flashpage: use const ptrs for write/verify
parent
07810422
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/include/periph/flashpage.h
+4
-4
4 additions, 4 deletions
drivers/include/periph/flashpage.h
drivers/periph_common/flashpage.c
+2
-2
2 additions, 2 deletions
drivers/periph_common/flashpage.c
with
6 additions
and
6 deletions
drivers/include/periph/flashpage.h
+
4
−
4
View file @
1f409d09
...
...
@@ -130,7 +130,7 @@ static inline int flashpage_page(void *addr)
* @param[in] data data to write to the page, MUST be FLASHPAGE_SIZE
* byte. Set to NULL for page erase only.
*/
void
flashpage_write
(
int
page
,
void
*
data
);
void
flashpage_write
(
int
page
,
const
void
*
data
);
/**
* @brief Write any number of data bytes to a given location in the
...
...
@@ -153,7 +153,7 @@ void flashpage_write(int page, void *data);
* ensure it doesn't exceed the actual flash
* memory size.
*/
void
flashpage_write_raw
(
void
*
target_addr
,
void
*
data
,
size_t
len
);
void
flashpage_write_raw
(
void
*
target_addr
,
const
void
*
data
,
size_t
len
);
/**
* @brief Read the given page into the given memory location
...
...
@@ -174,7 +174,7 @@ void flashpage_read(int page, void *data);
* @return FLASHPAGE_OK if data in the page is identical to @p data
* @return FLASHPAGE_NOMATCH if data and page content diverge
*/
int
flashpage_verify
(
int
page
,
void
*
data
);
int
flashpage_verify
(
int
page
,
const
void
*
data
);
/**
* @brief Write the given page and verify the results
...
...
@@ -188,7 +188,7 @@ int flashpage_verify(int page, void *data);
* @return FLASHPAGE_OK on success
* @return FLASHPAGE_NOMATCH if data and page content diverge
*/
int
flashpage_write_and_verify
(
int
page
,
void
*
data
);
int
flashpage_write_and_verify
(
int
page
,
const
void
*
data
);
#ifdef __cplusplus
}
...
...
This diff is collapsed.
Click to expand it.
drivers/periph_common/flashpage.c
+
2
−
2
View file @
1f409d09
...
...
@@ -35,7 +35,7 @@ void flashpage_read(int page, void *data)
memcpy
(
data
,
flashpage_addr
(
page
),
FLASHPAGE_SIZE
);
}
int
flashpage_verify
(
int
page
,
void
*
data
)
int
flashpage_verify
(
int
page
,
const
void
*
data
)
{
assert
(
page
<
(
int
)
FLASHPAGE_NUMOF
);
...
...
@@ -47,7 +47,7 @@ int flashpage_verify(int page, void *data)
}
}
int
flashpage_write_and_verify
(
int
page
,
void
*
data
)
int
flashpage_write_and_verify
(
int
page
,
const
void
*
data
)
{
flashpage_write
(
page
,
data
);
return
flashpage_verify
(
page
,
data
);
...
...
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