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
1951b9df
Commit
1951b9df
authored
9 years ago
by
Max Neklyudov
Committed by
Gregory Nutt
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve m25px driver
parent
0369facb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Documentation
+1
-1
1 addition, 1 deletion
Documentation
drivers/mtd/Kconfig
+4
-0
4 additions, 0 deletions
drivers/mtd/Kconfig
drivers/mtd/m25px.c
+9
-1
9 additions, 1 deletion
drivers/mtd/m25px.c
include/nuttx/sched.h
+1
-1
1 addition, 1 deletion
include/nuttx/sched.h
with
15 additions
and
3 deletions
Documentation
@
35343cbe
Subproject commit
d1d8974e7a8c743ed2ee102a93ad73478755a080
Subproject commit
35343cbe6660bb07d9fee4c2e5af0dd450313c14
This diff is collapsed.
Click to expand it.
drivers/mtd/Kconfig
+
4
−
0
View file @
1951b9df
...
...
@@ -408,6 +408,10 @@ config M25P_SPIMODE
int "M25P SPI mode"
default 0
config M25P_SPIFREQUENCY
int "M25P SPI Frequency"
default 20000000
config M25P_MANUFACTURER
hex "M25P manufacturers ID"
default 0x20
...
...
This diff is collapsed.
Click to expand it.
drivers/mtd/m25px.c
+
9
−
1
View file @
1951b9df
...
...
@@ -69,6 +69,10 @@
# define CONFIG_M25P_SPIMODE SPIDEV_MODE0
#endif
#ifndef CONFIG_M25P_SPIFREQUENCY
# define CONFIG_M25P_SPIFREQUENCY 20000000
#endif
/* Various manufacturers may have produced the parts. 0x20 is the manufacturer ID
* for the STMicro MP25x serial FLASH. If, for example, you are using the a Macronix
* International MX25 serial FLASH, the correct manufacturer ID would be 0xc2.
...
...
@@ -137,6 +141,7 @@
#define M25P_M25P32_NSECTORS 64
#define M25P_M25P32_PAGE_SHIFT 8
/* Page size 1 << 8 = 256 */
#define M25P_M25P32_NPAGES 16384
#define M25P_M25PX32_SUBSECT_SHIFT 12
/* Sub-Sector size 1 << 12 = 4,096 */
/* M25P64 capacity is 8,338,608 bytes:
* (128 sectors) * (65,536 bytes per sector)
...
...
@@ -285,7 +290,7 @@ static void m25p_lock(FAR struct spi_dev_s *dev)
SPI_SETMODE
(
dev
,
CONFIG_M25P_SPIMODE
);
SPI_SETBITS
(
dev
,
8
);
(
void
)
SPI_HWFEATURES
(
dev
,
0
);
(
void
)
SPI_SETFREQUENCY
(
dev
,
20000000
);
(
void
)
SPI_SETFREQUENCY
(
dev
,
CONFIG_M25P_SPIFREQUENCY
);
}
/************************************************************************************
...
...
@@ -383,6 +388,9 @@ static inline int m25p_readid(struct m25p_dev_s *priv)
priv
->
nsectors
=
M25P_M25P32_NSECTORS
;
priv
->
pageshift
=
M25P_M25P32_PAGE_SHIFT
;
priv
->
npages
=
M25P_M25P32_NPAGES
;
#ifdef CONFIG_M25P_SUBSECTOR_ERASE
priv
->
subsectorshift
=
M25P_M25PX32_SUBSECT_SHIFT
;
#endif
return
OK
;
}
else
if
(
capacity
==
M25P_M25P64_CAPACITY
)
...
...
This diff is collapsed.
Click to expand it.
include/nuttx/sched.h
+
1
−
1
View file @
1951b9df
...
...
@@ -852,7 +852,7 @@ void sched_suspend_scheduler(FAR struct tcb_s *tcb);
* to application code.
*
* Input Parameters:
* tcb - The TCB of the thread
to be restarted
.
* tcb - The TCB of the thread.
*
* Returned Value:
* None
...
...
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