Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
cf1e47fc
Commit
cf1e47fc
authored
1 year ago
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
display: rotated scope 90deg for the usual orientation
parent
177f5c2a
No related branches found
No related tags found
No related merge requests found
Pipeline
#5517
passed
1 year ago
Stage: build
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/badge23/display.c
+2
-7
2 additions, 7 deletions
components/badge23/display.c
components/badge23/include/badge23/scope.h
+1
-3
1 addition, 3 deletions
components/badge23/include/badge23/scope.h
components/badge23/scope.c
+33
-27
33 additions, 27 deletions
components/badge23/scope.c
with
36 additions
and
37 deletions
components/badge23/display.c
+
2
−
7
View file @
cf1e47fc
...
...
@@ -67,13 +67,8 @@ void display_fill(uint16_t col){
}
void
display_draw_scope
(){
uint16_t
line
[
240
];
begin_scope_read
();
for
(
int
y
=
0
;
y
<
240
;
y
++
){
read_line_from_scope
(
&
(
line
[
0
]),
y
);
memcpy
(
&
ScreenBuff
[
y
*
240
],
line
,
sizeof
(
line
));
}
end_scope_read
();
if
(
!
scope_active
)
return
;
scope_write_to_framebuffer
(
&
ScreenBuff
);
GC9A01_Update
();
}
...
...
This diff is collapsed.
Click to expand it.
components/badge23/include/badge23/scope.h
+
1
−
3
View file @
cf1e47fc
...
...
@@ -10,6 +10,4 @@ typedef struct {
void
init_scope
(
uint16_t
size
);
void
write_to_scope
(
int16_t
value
);
void
begin_scope_read
();
void
end_scope_read
();
void
read_line_from_scope
(
uint16_t
*
line
,
int16_t
point
);
void
scope_write_to_framebuffer
(
uint16_t
*
framebuffer
);
This diff is collapsed.
Click to expand it.
components/badge23/scope.c
+
33
−
27
View file @
cf1e47fc
...
...
@@ -30,8 +30,17 @@ void begin_scope_read(){
scope
->
is_being_read
=
1
;
//best mutex
}
void
read_line_from_scope
(
uint16_t
*
line
,
int16_t
point
){
memset
(
line
,
0
,
480
);
void
end_scope_read
(){
if
(
scope
==
NULL
)
return
;
scope
->
is_being_read
=
0
;
//best mutex
}
void
scope_write_to_framebuffer
(
uint16_t
*
framebuffer
){
//assumes 240x240 16bit framebuffer for now
begin_scope_read
();
memset
(
framebuffer
,
0
,
240
*
240
*
sizeof
(
uint16_t
));
for
(
int
point
=
0
;
point
<
240
;
point
++
){
int16_t
startpoint
=
scope
->
write_head_position
-
point
;
while
(
startpoint
<
0
){
startpoint
+=
scope
->
buffer_size
;
...
...
@@ -53,11 +62,8 @@ void read_line_from_scope(uint16_t * line, int16_t point){
stop
=
inter
;
}
for
(
int16_t
i
=
start
;
i
<=
stop
;
i
++
){
line
[
i
]
=
255
;
framebuffer
[
point
+
i
*
240
]
=
255
;
}
}
void
end_scope_read
(){
if
(
scope
==
NULL
)
return
;
scope
->
is_being_read
=
0
;
//best mutex
end_scope_read
();
}
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