Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
3d830415
Commit
3d830415
authored
9 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
esp8266/esp_mphal: Add ets_esf_free_bufs(), etc. functions.
Returning free number of various WiFi driver packet buffers.
parent
7b7c99fe
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
esp8266/esp_mphal.c
+22
-0
22 additions, 0 deletions
esp8266/esp_mphal.c
esp8266/esp_mphal.h
+3
-0
3 additions, 0 deletions
esp8266/esp_mphal.h
with
25 additions
and
0 deletions
esp8266/esp_mphal.c
+
22
−
0
View file @
3d830415
...
...
@@ -234,3 +234,25 @@ void mp_hal_pin_config_od(mp_hal_pin_obj_t pin_id) {
GPIO_REG_READ
(
GPIO_ENABLE_ADDRESS
)
|
(
1
<<
pin
->
phys_port
));
ETS_GPIO_INTR_ENABLE
();
}
// Get pointer to esf_buf bookkeeping structure
void
*
ets_get_esf_buf_ctlblk
(
void
)
{
// Get literal ptr before start of esf_rx_buf_alloc func
extern
void
*
esf_rx_buf_alloc
();
return
((
void
**
)
esf_rx_buf_alloc
)[
-
1
];
}
// Get number of esf_buf free buffers of given type, as encoded by index
// idx 0 corresponds to buf types 1, 2; 1 - 4; 2 - 5; 3 - 7; 4 - 8
// Only following buf types appear to be used:
// 1 - tx buffer, 5 - management frame tx buffer; 8 - rx buffer
int
ets_esf_free_bufs
(
int
idx
)
{
uint32_t
*
p
=
ets_get_esf_buf_ctlblk
();
uint32_t
*
b
=
(
uint32_t
*
)
p
[
idx
];
int
cnt
=
0
;
while
(
b
)
{
b
=
(
uint32_t
*
)
b
[
0x20
/
4
];
cnt
++
;
}
return
cnt
;
}
This diff is collapsed.
Click to expand it.
esp8266/esp_mphal.h
+
3
−
0
View file @
3d830415
...
...
@@ -77,4 +77,7 @@ void mp_hal_pin_config_od(mp_hal_pin_obj_t pin);
#define mp_hal_pin_read(p) pin_get(p)
#define mp_hal_pin_write(p, v) pin_set((p), (v))
void
*
ets_get_esf_buf_ctlblk
(
void
);
int
ets_esf_free_bufs
(
int
idx
);
#endif // _INCLUDED_MPHAL_H_
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