Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Heizung
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
c3pb
Heizung
Commits
e1cbf643
Commit
e1cbf643
authored
1 year ago
by
Benjamin Koch
Browse files
Options
Downloads
Patches
Plain Diff
try features and groups in program info
parent
7855909a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
firmware/rust1/src/bin/heizung.rs
+7
-0
7 additions, 0 deletions
firmware/rust1/src/bin/heizung.rs
firmware/rust1/src/program_info.rs
+23
-6
23 additions, 6 deletions
firmware/rust1/src/program_info.rs
with
30 additions
and
6 deletions
firmware/rust1/src/bin/heizung.rs
+
7
−
0
View file @
e1cbf643
...
@@ -760,5 +760,12 @@ pub static PROGRAM_INFO: [u8; 4096] = {
...
@@ -760,5 +760,12 @@ pub static PROGRAM_INFO: [u8; 4096] = {
(
28
,
"Current Measurement Channel 1"
),
(
28
,
"Current Measurement Channel 1"
),
(
29
,
"VCC Measurement"
),
(
29
,
"VCC Measurement"
),
])
])
.program_feature
(
"abc"
)
.program_feature
(
"abc2"
)
.program_feature
(
"abc 3"
)
.program_feature_group_with_flags
([
'C'
,
'3'
],
2
,
"def"
,
heizung
::
program_info
::
GroupFlags
::
ADVANCED
)
.feature
(
"abc 4"
)
.feature
(
"abc 5"
)
.group_done
()
.build
()
.build
()
};
};
This diff is collapsed.
Click to expand it.
firmware/rust1/src/program_info.rs
+
23
−
6
View file @
e1cbf643
...
@@ -7,6 +7,12 @@ pub struct ProgramInfoBuilder {
...
@@ -7,6 +7,12 @@ pub struct ProgramInfoBuilder {
data_end_offset
:
usize
,
data_end_offset
:
usize
,
}
}
pub
struct
ProgramInfoBuilderForGroup
{
builder
:
ProgramInfoBuilder
,
tag
:
[
char
;
2
],
id
:
u32
,
}
#[repr(u16)]
#[repr(u16)]
#[allow(non_camel_case_types)]
#[allow(non_camel_case_types)]
#[derive(Clone,
Copy,
PartialEq,
Eq,
PartialOrd,
Ord)]
#[derive(Clone,
Copy,
PartialEq,
Eq,
PartialOrd,
Ord)]
...
@@ -225,13 +231,13 @@ impl ProgramInfoBuilder {
...
@@ -225,13 +231,13 @@ impl ProgramInfoBuilder {
.push_string
(
value
)
.push_string
(
value
)
}
}
const
fn
bi_named_group
(
self
:
Self
,
tag
:
[
char
;
2
],
id
:
u32
,
flags
:
u16
,
group_tag
:
u16
,
group_id
:
u32
,
label
:
&
str
)
->
Self
{
const
fn
bi_named_group
(
self
:
Self
,
tag
:
[
char
;
2
],
id
:
u32
,
flags
:
u16
,
group_tag
:
[
char
;
2
]
,
group_id
:
u32
,
label
:
&
str
)
->
Self
{
self
.push_current_info_ptr
()
self
.push_current_info_ptr
()
.push_u16
(
Self
::
BINARY_INFO_TYPE_NAMED_GROUP
)
.push_u16
(
Self
::
BINARY_INFO_TYPE_NAMED_GROUP
)
.push_tag
(
tag
)
.push_tag
(
tag
)
.push_u32
(
id
)
.push_u32
(
id
)
.push_u16
(
flags
)
.push_u16
(
flags
)
.push_
u16
(
group_tag
)
.push_
tag
(
group_tag
)
.push_u32
(
group_id
)
.push_u32
(
group_id
)
.push_string
(
label
)
.push_string
(
label
)
}
}
...
@@ -312,12 +318,13 @@ impl ProgramInfoBuilder {
...
@@ -312,12 +318,13 @@ impl ProgramInfoBuilder {
pub
const
fn
boot2_name
(
self
:
Self
,
attr
:
&
str
)
->
Self
{
pub
const
fn
boot2_name
(
self
:
Self
,
attr
:
&
str
)
->
Self
{
self
.bi_string
(
Self
::
BINARY_INFO_TAG_RASPBERRY_PI
,
Self
::
BINARY_INFO_ID_RP_BOOT2_NAME
,
attr
)
self
.bi_string
(
Self
::
BINARY_INFO_TAG_RASPBERRY_PI
,
Self
::
BINARY_INFO_ID_RP_BOOT2_NAME
,
attr
)
}
}
pub
const
fn
program_feature_group
(
self
:
Self
,
tag
:
u16
,
id
:
u32
,
label
:
&
str
)
->
Self
{
pub
const
fn
program_feature_group
(
self
:
Self
,
tag
:
[
char
;
2
]
,
id
:
u32
,
label
:
&
str
)
->
ProgramInfoBuilderForGroup
{
self
.program_feature_group_with_flags
(
tag
,
id
,
label
,
GroupFlags
::
NONE
)
self
.program_feature_group_with_flags
(
tag
,
id
,
label
,
GroupFlags
::
NONE
)
}
}
pub
const
fn
program_feature_group_with_flags
(
self
:
Self
,
tag
:
u16
,
id
:
u32
,
label
:
&
str
,
flags
:
GroupFlags
)
->
Self
{
pub
const
fn
program_feature_group_with_flags
(
self
:
Self
,
tag
:
[
char
;
2
],
id
:
u32
,
label
:
&
str
,
flags
:
GroupFlags
)
->
ProgramInfoBuilderForGroup
{
self
.bi_named_group
(
Self
::
BINARY_INFO_TAG_RASPBERRY_PI
,
Self
::
BINARY_INFO_ID_RP_PROGRAM_FEATURE
,
let
builder
=
self
.bi_named_group
(
Self
::
BINARY_INFO_TAG_RASPBERRY_PI
,
Self
::
BINARY_INFO_ID_RP_PROGRAM_FEATURE
,
flags
as
u16
,
tag
,
id
,
label
)
flags
as
u16
,
tag
,
id
,
label
);
ProgramInfoBuilderForGroup
{
builder
,
tag
,
id
}
}
}
pub
const
fn
pins_with_func
(
self
:
Self
,
func
:
PinFunction
,
pins
:
&
[
u8
])
->
Self
{
pub
const
fn
pins_with_func
(
self
:
Self
,
func
:
PinFunction
,
pins
:
&
[
u8
])
->
Self
{
...
@@ -374,3 +381,13 @@ impl ProgramInfoBuilder {
...
@@ -374,3 +381,13 @@ impl ProgramInfoBuilder {
append_names
(
self
,
pins
,
1
)
append_names
(
self
,
pins
,
1
)
}
}
}
}
impl
ProgramInfoBuilderForGroup
{
pub
const
fn
feature
(
mut
self
:
Self
,
name
:
&
str
)
->
Self
{
self
.builder
=
self
.builder
.bi_string
(
self
.tag
,
self
.id
,
name
);
self
}
pub
const
fn
group_done
(
self
:
Self
)
->
ProgramInfoBuilder
{
self
.builder
}
}
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