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
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
492fd5cb
Commit
492fd5cb
authored
10 years ago
by
Josef Gajdusek
Committed by
Paul Sokolovsky
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
esp8266: Enable setting CPU frequency to 160MHz
parent
a16715ac
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
esp8266/esp_mphal.c
+0
-4
0 additions, 4 deletions
esp8266/esp_mphal.c
esp8266/etshal.h
+0
-1
0 additions, 1 deletion
esp8266/etshal.h
esp8266/modpyb.c
+8
-2
8 additions, 2 deletions
esp8266/modpyb.c
with
8 additions
and
7 deletions
esp8266/esp_mphal.c
+
0
−
4
View file @
492fd5cb
...
...
@@ -93,7 +93,3 @@ void HAL_Delay(uint32_t Delay) {
void
mp_hal_set_interrupt_char
(
int
c
)
{
// TODO
}
uint32_t
mp_hal_get_cpu_freq
(
void
)
{
return
ets_get_cpu_frequency
();
}
This diff is collapsed.
Click to expand it.
esp8266/etshal.h
+
0
−
1
View file @
492fd5cb
...
...
@@ -5,6 +5,5 @@ void ets_isr_unmask();
void
ets_install_putc1
();
void
ets_isr_attach
();
void
uart_div_modify
();
uint32_t
ets_get_cpu_frequency
();
#endif // _INCLUDED_ETSHAL_H_
This diff is collapsed.
Click to expand it.
esp8266/modpyb.c
+
8
−
2
View file @
492fd5cb
...
...
@@ -81,10 +81,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_info_obj, 0, 1, pyb_info);
STATIC
mp_obj_t
pyb_freq
(
mp_uint_t
n_args
,
const
mp_obj_t
*
args
)
{
if
(
n_args
==
0
)
{
// get
return
mp_obj_new_int
(
mp_hal
_get_cpu_freq
()
*
1000000
);
return
mp_obj_new_int
(
system
_get_cpu_freq
()
*
1000000
);
}
else
{
// set
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_ValueError
,
"can't change freq"
));
mp_int_t
freq
=
mp_obj_get_int
(
args
[
0
])
/
1000000
;
if
(
freq
!=
80
&&
freq
!=
160
)
{
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_ValueError
,
"frequency can only be either 80Mhz or 160MHz"
));
}
system_update_cpu_freq
(
freq
);
return
mp_const_none
;
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
pyb_freq_obj
,
0
,
1
,
pyb_freq
);
...
...
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