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
Service Desk
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
dos
flow3r firmware
Commits
8c3473cc
Commit
8c3473cc
authored
1 year ago
by
moon2
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed rev1 button bug
parent
06b0d3fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/badge23/spio.c
+9
-9
9 additions, 9 deletions
components/badge23/spio.c
with
9 additions
and
9 deletions
components/badge23/spio.c
+
9
−
9
View file @
8c3473cc
...
...
@@ -19,11 +19,11 @@ static int8_t rightbutton = 0;
static
void
_init_buttons
(){
//configure all buttons as pullup
uint64_t
mask
=
0
;
mask
|=
(
1
<<
RIGHT_BUTTON_LEFT
);
mask
|=
(
1
<<
RIGHT_BUTTON_RIGHT
);
mask
|=
(
1
<<
LEFT_BUTTON_LEFT
);
mask
|=
(
1
<<
LEFT_BUTTON_MID
);
mask
|=
(
1
<<
LEFT_BUTTON_RIGHT
);
mask
|=
(
1
ULL
<<
RIGHT_BUTTON_LEFT
);
mask
|=
(
1
ULL
<<
RIGHT_BUTTON_RIGHT
);
mask
|=
(
1
ULL
<<
LEFT_BUTTON_LEFT
);
mask
|=
(
1
ULL
<<
LEFT_BUTTON_MID
);
mask
|=
(
1
ULL
<<
LEFT_BUTTON_RIGHT
);
gpio_config_t
cfg
=
{
.
pin_bit_mask
=
mask
,
.
mode
=
GPIO_MODE_INPUT
,
...
...
@@ -95,10 +95,10 @@ static void _init_buttons(){
void
update_button_state
(){
uint8_t
port
;
esp_err_t
ret
=
i2c_master_read_from_device
(
I2C_MASTER_NUM
,
0
b1101101
,
&
port
,
sizeof
(
port
),
TIMEOUT_MS
/
portTICK_PERIOD_MS
);
uint8_t
rr
=
port
&
(
1
<<
RIGHT_BUTTON_RIGHT
);
uint8_t
rm
=
port
&
(
1
<<
RIGHT_BUTTON_MID
);
uint8_t
rl
=
port
&
(
1
<<
RIGHT_BUTTON_LEFT
);
uint8_t
lr
=
port
&
(
1
<<
LEFT_BUTTON_RIGHT
);
uint8_t
rr
=
port
&
(
1
ULL
<<
RIGHT_BUTTON_RIGHT
);
uint8_t
rm
=
port
&
(
1
ULL
<<
RIGHT_BUTTON_MID
);
uint8_t
rl
=
port
&
(
1
ULL
<<
RIGHT_BUTTON_LEFT
);
uint8_t
lr
=
port
&
(
1
ULL
<<
LEFT_BUTTON_RIGHT
);
uint8_t
ll
=
gpio_get_level
(
LEFT_BUTTON_LEFT
);
uint8_t
lm
=
gpio_get_level
(
LEFT_BUTTON_MID
);
...
...
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