Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
f4grx
NuttX RTOS
Commits
2596b14c
Commit
2596b14c
authored
7 years ago
by
Jussi Kivilinna
Committed by
Gregory Nutt
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mtd/w25: add missing locking and fix SPI_SELECT usage for w25_unprotect
parent
e379491d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/mtd/w25.c
+8
-6
8 additions, 6 deletions
drivers/mtd/w25.c
with
8 additions
and
6 deletions
drivers/mtd/w25.c
+
8
−
6
View file @
2596b14c
...
...
@@ -440,19 +440,16 @@ static inline int w25_readid(struct w25_dev_s *priv)
#ifndef CONFIG_W25_READONLY
static
void
w25_unprotect
(
FAR
struct
w25_dev_s
*
priv
)
{
/*
Select this FLASH part
*/
/*
Lock and configure the SPI bus
*/
SPI_SELECT
(
priv
->
spi
,
SPIDEV_FLASH
(
0
),
true
);
w25_lock
(
priv
->
spi
);
/* Send "Write enable (WREN)" */
w25_wren
(
priv
);
/* Re-select this FLASH part (This might not be necessary... but is it shown in
* the SST25 timing diagrams from which this code was leveraged.)
*/
/* Select this FLASH part */
SPI_SELECT
(
priv
->
spi
,
SPIDEV_FLASH
(
0
),
false
);
SPI_SELECT
(
priv
->
spi
,
SPIDEV_FLASH
(
0
),
true
);
/* Send "Write enable status (EWSR)" */
...
...
@@ -463,6 +460,11 @@ static void w25_unprotect(FAR struct w25_dev_s *priv)
SPI_SEND
(
priv
->
spi
,
0
);
SPI_SEND
(
priv
->
spi
,
0
);
/* Deselect the FLASH and unlock the bus */
SPI_SELECT
(
priv
->
spi
,
SPIDEV_FLASH
(
0
),
false
);
w25_unlock
(
priv
->
spi
);
}
#endif
...
...
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