Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multipass
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
derf
multipass
Commits
41f6b6d6
Commit
41f6b6d6
authored
6 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
MSP430: Show calculated real timer frequency on 'info"
parent
20037a10
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
src/arch/msp430fr5969lp/Makefile.inc
+1
-1
1 addition, 1 deletion
src/arch/msp430fr5969lp/Makefile.inc
src/arch/msp430fr5969lp/model.py
+48
-0
48 additions, 0 deletions
src/arch/msp430fr5969lp/model.py
with
49 additions
and
1 deletion
src/arch/msp430fr5969lp/Makefile.inc
+
1
−
1
View file @
41f6b6d6
...
...
@@ -86,7 +86,7 @@ arch_help:
arch_info
:
@
echo
"CPU Freq:
${
cpu_freq
}
Hz"
@
echo
"Timer Freq:
${
timer_freq
}
Hz"
@
echo
"Timer Freq:
${
timer_freq
}
Hz
->
$(
shell src/arch/msp430fr5969lp/model.py f_timer "
${
cpu_freq
}
" "
${
timer_freq
}
"
)
"
@
echo
"I2C Freq:
${
i2c_freq
}
Hz"
.PHONY
:
arch_clean arch_help arch_info monitor program
This diff is collapsed.
Click to expand it.
src/arch/msp430fr5969lp/model.py
0 → 100755
+
48
−
0
View file @
41f6b6d6
#!/usr/bin/env python3
import
numpy
as
np
import
sys
# include/arch/msp430fr5969lp/driver/timer.h
def
get_timer_frequency
(
f_cpu
,
f_timer
):
if
f_cpu
==
16000000
:
ta0_main_div
=
8
elif
f_cpu
==
8000000
:
ta0_main_div
=
4
elif
f_cpu
==
4000000
:
ta0_main_div
=
2
elif
f_cpu
==
1000000
:
ta0_main_div
=
1
else
:
raise
ValueError
(
"
Invalid f_cpu
"
)
if
f_cpu
==
1000000
:
if
f_timer
>=
1000
:
divisor
=
1
counter
=
1000
/
(
f_timer
/
1000
)
elif
f_timer
>=
20
:
divisor
=
1
counter
=
1000000
/
f_timer
else
:
divisor
=
8
*
2
counter
=
62500
/
f_timer
else
:
if
f_timer
>=
1000
:
divisor
=
ta0_main_div
*
1
counter
=
2000
/
(
f_timer
/
1000
)
else
:
divisor
=
ta0_main_div
*
1
counter
=
2000000
/
f_timer
return
f_cpu
/
divisor
/
int
(
counter
)
module
=
sys
.
argv
[
1
]
if
module
==
'
f_timer
'
and
len
(
sys
.
argv
)
==
4
:
try
:
f_cpu
=
int
(
sys
.
argv
[
2
])
f_timer
=
int
(
sys
.
argv
[
3
])
except
:
sys
.
exit
(
0
)
if
f_cpu
!=
0
and
f_timer
!=
0
:
print
(
'
{:.2f}
'
.
format
(
get_timer_frequency
(
f_cpu
,
f_timer
)))
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