Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tudelft-quadrupel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Computer and Embedded Systems Engineering
Embedded Systems Lab
tudelft-quadrupel
Commits
972c9c91
Verified
Commit
972c9c91
authored
Mar 7, 2023
by
Jonathan Brouwer
Browse files
Options
Downloads
Plain Diff
Merge branch 'remove_pin20' into 2-read-imu
parents
7629ef93
258bddb5
No related branches found
No related tags found
4 merge requests
!11
Resolve "Reading MPU over I2C hangs"
,
!10
Resolve "Reading MPU over I2C hangs": Attempt 4
,
!9
Resolve "Reading MPU over I2C hangs"
,
!8
Resolve "Template code hangs on reading yaw, pitch, and roll."
Pipeline
#818197
passed
Mar 7, 2023
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Cargo.toml
+1
-1
1 addition, 1 deletion
Cargo.toml
src/initialize.rs
+0
-1
0 additions, 1 deletion
src/initialize.rs
src/motor.rs
+0
-11
0 additions, 11 deletions
src/motor.rs
with
1 addition
and
13 deletions
Cargo.toml
+
1
−
1
View file @
972c9c91
[package]
name
=
"tudelft-quadrupel"
version
=
"2.0.
0
"
version
=
"2.0.
1
"
edition
=
"2021"
authors
=
[
"Anne Stijns <anstijns@gmail.com>"
,
...
...
This diff is collapsed.
Click to expand it.
src/initialize.rs
+
0
−
1
View file @
972c9c91
...
...
@@ -97,7 +97,6 @@ pub fn initialize(heap_memory: &'static mut [MaybeUninit<u8>], debug: bool) {
&
mut
cortex_m_peripherals
.NVIC
,
&
mut
nrf51_peripherals
.PPI
,
&
mut
nrf51_peripherals
.GPIOTE
,
gpio
.p0_20
,
);
if
debug
{
let
_
=
send_bytes
(
b"MOTOR driver initialized
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
src/motor.rs
+
0
−
11
View file @
972c9c91
use
crate
::
mutex
::
Mutex
;
use
crate
::
nrf51_hal
::
prelude
::
OutputPin
;
use
crate
::
once_cell
::
OnceCell
;
use
cortex_m
::
peripheral
::
NVIC
;
use
nrf51_hal
::
gpio
::
p0
::
P0_20
;
use
nrf51_hal
::
gpio
::{
Disconnected
,
Level
,
Output
,
PushPull
};
use
nrf51_pac
::{
interrupt
,
Interrupt
,
GPIOTE
,
PPI
};
struct
Motors
{
...
...
@@ -11,7 +8,6 @@ struct Motors {
motor_max
:
u16
,
timer1
:
nrf51_pac
::
TIMER1
,
timer2
:
nrf51_pac
::
TIMER2
,
pin20
:
P0_20
<
Output
<
PushPull
>>
,
}
const
MOTOR_0_PIN
:
u8
=
21
;
...
...
@@ -63,18 +59,13 @@ pub(crate) fn initialize(
nvic
:
&
mut
NVIC
,
ppi
:
&
mut
PPI
,
gpiote
:
&
mut
GPIOTE
,
pin20
:
P0_20
<
Disconnected
>
,
)
{
// Configure pin20
let
pin20
=
pin20
.into_push_pull_output
(
Level
::
Low
);
MOTORS
.modify
(|
motors
|
{
motors
.initialize
(
Motors
{
motor_values
:
[
0
;
4
],
motor_max
:
400
,
timer1
,
timer2
,
pin20
,
});
// Configure GPIOTE. GPIOTE is stands for GPIO tasks and events.
...
...
@@ -270,11 +261,9 @@ unsafe fn TIMER1() {
motors
.timer1.tasks_capture
[
2
]
.write
(|
w
|
w
.bits
(
1
));
if
motors
.timer1.cc
[
2
]
.read
()
.bits
()
<
500
{
motors
.pin20
.set_high
()
.unwrap
();
// Safety: Any time is allowed
motors
.timer1.cc
[
0
]
.write
(|
w
|
w
.bits
(
u32
::
from
(
1000
+
motors
.motor_values
[
0
])));
motors
.timer1.cc
[
1
]
.write
(|
w
|
w
.bits
(
u32
::
from
(
1000
+
motors
.motor_values
[
1
])));
motors
.pin20
.set_low
()
.unwrap
();
}
}
}
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