Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rtic_f4xx_nucleo
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edvin Åkerfeldt
rtic_f4xx_nucleo
Commits
ea64a4ec
Commit
ea64a4ec
authored
Dec 9, 2020
by
Edvin Åkerfeldt
Browse files
Options
Downloads
Patches
Plain Diff
Added ticking
parent
b875d605
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/dsi_debug.rs
+22
-5
22 additions, 5 deletions
examples/dsi_debug.rs
with
22 additions
and
5 deletions
examples/dsi_debug.rs
+
22
−
5
View file @
ea64a4ec
...
...
@@ -13,11 +13,16 @@ use stm32f4::stm32f413::GPIOA;
//const bit_string: u16 = 0x0;
//const bit_string: u16 = 0xFFFF;
const
bit_string
:
u16
=
0x0FFF
;
//actual string 0b1_01111101_1111
//actual string 0b1_01111101_1111
(send value 255)
//const bit_s: u32 = 0b10_0110101010100110_10101010; // Start stop high 26 bits (start pos 25)
//const bit_s: u32 = 0b01_0110101010100110_01010101; // Start stop low
const
bit_s
:
u32
=
0b10_0101010101010101_10101010
;
// actual string 0b1_00000000_1111 (send value 0)
//const bit_s: u32 = 0b10_0101010101010101_10101010; // Start stop high
const
WAIT_TICKS
:
u16
=
240
;
//const bit_string: u16 = 0xF000;
/*(
0x0FFF full
...
...
@@ -36,6 +41,7 @@ const APP: () = {
dwt
:
DWT
,
ON
:
bool
,
point
:
u16
,
tick
:
u16
,
}
#[init]
...
...
@@ -63,13 +69,20 @@ const APP: () = {
let
gpioa
=
cx
.device.GPIOA
;
gpioa
.moder
.modify
(|
_
,
w
|
unsafe
{
w
.moder5
()
.bits
(
1
)
});
gpioa
.moder
.modify
(|
_
,
w
|
unsafe
{
w
.moder6
()
.bits
(
1
)
});
/*
unsafe {
(*GPIOA::ptr()).odr.modify(|_, w| w.odr5().bit(true));
}
*/
let
mut
point
:
u16
=
25
;
let
mut
tick
:
u16
=
0
;
init
::
LateResources
{
dwt
:
cx
.core.DWT
,
ON
:
false
,
point
:
point
,
tick
:
tick
,
}
}
...
...
@@ -87,11 +100,10 @@ const APP: () = {
}
}
#[task(binds
=
SysTick,
resources
=
[
ON,
point]
,)]
#[task(binds
=
SysTick,
resources
=
[
ON,
point
,
tick
]
,)]
fn
syst
(
cx
:
syst
::
Context
)
{
let
r
=
cx
.resources
;
if
*
r
.point
!=
0
{
if
*
r
.point
!=
0
&&
false
{
let
m
=
bit_s
>>
*
r
.point
&
0x1
;
unsafe
{
if
m
==
1
{
...
...
@@ -105,6 +117,11 @@ const APP: () = {
unsafe
{
(
*
GPIOA
::
ptr
())
.odr
.modify
(|
_
,
w
|
w
.odr5
()
.bit
(
false
));
}
*
r
.tick
=
*
r
.tick
+
1
;
if
*
r
.tick
>=
WAIT_TICKS
{
*
r
.point
=
25
;
*
r
.tick
=
0
;
}
}
/*
let r = cx.resources;
...
...
...
...
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