Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mobile-transceiver-software
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
CATS
mobile-transceiver-software
Commits
eed829f4
Commit
eed829f4
authored
1 year ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
fix race condition that could cause crashes and reboots
parent
8f758663
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#4333
passed
1 year ago
Stage: lint
Stage: build
Stage: build-flasher
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.rs
+9
-3
9 additions, 3 deletions
src/main.rs
src/radio.rs
+7
-3
7 additions, 3 deletions
src/radio.rs
with
16 additions
and
6 deletions
src/main.rs
+
9
−
3
View file @
eed829f4
...
...
@@ -12,10 +12,14 @@ mod shell;
mod
status
;
mod
voltage
;
use
systick_monotonic
::
fugit
::
Instant
;
pub
const
MAX_PACKET_LEN
:
usize
=
8191
;
pub
const
SYS_TICK_FREQ
:
u32
=
1000
;
#[rtic::app(device
=
stm32f4xx_hal::pac,
peripherals
=
true
,
dispatchers
=
[
USART6]
)]
pub
type
MyInstant
=
Instant
<
u64
,
1
,
{
SYS_TICK_FREQ
}
>
;
#[rtic::app(device
=
stm32f4xx_hal::pac,
peripherals
=
true
,
dispatchers
=
[
USART1,
USART6]
)]
mod
app
{
use
cortex_m
::
singleton
;
use
hal
::{
...
...
@@ -260,7 +264,7 @@ mod app {
)
}
#[task(priority
=
2
,
local
=
[
]
,
shared
=
[
red
,
radio
,
config
,
status
])]
#[task(priority
=
3
,
local
=
[
]
,
shared
=
[
red
,
radio
,
config
,
status
])]
fn
radio_tick
(
mut
ctx
:
radio_tick
::
Context
)
{
(
ctx
.shared.radio
,
ctx
.shared.config
)
.lock
(|
r
,
c
|
{
r
.as_mut
()
...
...
@@ -404,7 +408,9 @@ mod app {
ctx
.local.gps_enable
.set_high
();
ctx
.local.green
.set_low
();
ctx
.shared.red
.lock
(|
red
|
red
.set_low
());
ctx
.shared.radio
.lock
(|
r
|
r
.as_mut
()
.map
(|
x
|
x
.sleep
()));
ctx
.shared
.radio
.lock
(|
r
|
r
.as_mut
()
.map
(|
x
|
x
.sleep
()
.unwrap
()));
}
}
...
...
This diff is collapsed.
Click to expand it.
src/radio.rs
+
7
−
3
View file @
eed829f4
use
ham_cats
::{
buffer
::
Buffer
,
identity
::
Identity
,
packet
::
Packet
};
use
rand
::{
rngs
::
SmallRng
,
Rng
,
SeedableRng
};
use
rf4463
::{
config
::
RADIO_CONFIG_CATS
,
error
::
TransferError
,
Rf4463
};
use
rf4463
::{
config
::
RADIO_CONFIG_CATS
,
error
::{
RfError
,
TransferError
},
Rf4463
,
};
use
rtic
::
Mutex
;
use
stm32f4xx_hal
::{
gpio
,
...
...
@@ -51,8 +55,8 @@ impl<'a> RadioManager<'a> {
})
}
pub
fn
sleep
(
&
mut
self
)
{
//
self.radio.sleep()
pub
fn
sleep
(
&
mut
self
)
->
Result
<
(),
RfError
<
spi
::
Error
>>
{
self
.radio
.sleep
()
}
pub
fn
get_temp
(
&
mut
self
)
->
Option
<
i8
>
{
...
...
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