Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DC motor driver hat
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
Container 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
Software
DC motor driver hat
Commits
85f8c997
Commit
85f8c997
authored
5 months ago
by
Samuel Tardieu
Browse files
Options
Downloads
Patches
Plain Diff
Use tuple as documented to return firmware version
parent
7bd439aa
No related branches found
No related tags found
1 merge request
!43
Use tuple as documented to return firmware version
Pipeline
#99083
canceled
5 months ago
Stage: check
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
firmware-updater/src/bootloader.rs
+2
-6
2 additions, 6 deletions
firmware-updater/src/bootloader.rs
tele0592/src/device.rs
+2
-2
2 additions, 2 deletions
tele0592/src/device.rs
with
4 additions
and
8 deletions
firmware-updater/src/bootloader.rs
+
2
−
6
View file @
85f8c997
...
...
@@ -9,12 +9,8 @@ use tele0592::{
use
crate
::
elf_loader
::
Segment
;
fn
version_from_bytes
(
bytes
:
[
u8
;
3
])
->
Version
{
Version
::
new
(
u64
::
from
(
bytes
[
0
]),
u64
::
from
(
bytes
[
1
]),
u64
::
from
(
bytes
[
2
]),
)
fn
version_from_bytes
((
major
,
minor
,
patch
):
(
u8
,
u8
,
u8
))
->
Version
{
Version
::
new
(
u64
::
from
(
major
),
u64
::
from
(
minor
),
u64
::
from
(
patch
))
}
pub
enum
ActiveProgram
{
...
...
This diff is collapsed.
Click to expand it.
tele0592/src/device.rs
+
2
−
2
View file @
85f8c997
...
...
@@ -64,10 +64,10 @@ pub trait Device {
///
/// # Errors
/// This method may fail if the communication with the board fails.
fn
firmware_version
(
&
mut
self
)
->
Result
<
[
u8
;
3
]
,
Self
::
I2cError
>
{
fn
firmware_version
(
&
mut
self
)
->
Result
<
(
u8
,
u8
,
u8
)
,
Self
::
I2cError
>
{
let
mut
result
=
[
0
;
3
];
self
.write_read
([
CMD_FIRMWARE_VERSION
],
&
mut
result
)
?
;
Ok
(
result
)
Ok
(
result
.into
()
)
}
/// Identify the program currently running on the board as the
...
...
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