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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
e15a1188
Commit
e15a1188
authored
May 25, 2023
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
moved i2c into freertos timer
parent
daec4e3d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/badge23/espan.c
+9
-8
9 additions, 8 deletions
components/badge23/espan.c
with
9 additions
and
8 deletions
components/badge23/espan.c
+
9
−
8
View file @
e15a1188
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include
"esp_log.h"
#include
"esp_log.h"
#include
"driver/i2c.h"
#include
"driver/i2c.h"
#include
"driver/spi_master.h"
#include
"driver/spi_master.h"
#include
<freertos/timers.h>
#include
<stdio.h>
#include
<stdio.h>
#include
<string.h>
#include
<string.h>
...
@@ -54,6 +55,11 @@ static esp_err_t i2c_master_init(void)
...
@@ -54,6 +55,11 @@ static esp_err_t i2c_master_init(void)
#define CAPTOUCH_POLLING_PERIOD 15
#define CAPTOUCH_POLLING_PERIOD 15
static
uint8_t
hw_init_done
=
0
;
static
uint8_t
hw_init_done
=
0
;
void
i2c_task
(
TimerHandle_t
data
){
update_button_state
();
captouch_read_cycle
();
}
void
os_app_main
(
void
)
void
os_app_main
(
void
)
{
{
ESP_LOGI
(
TAG
,
"Starting on %s..."
,
badge23_hw_name
);
ESP_LOGI
(
TAG
,
"Starting on %s..."
,
badge23_hw_name
);
...
@@ -66,15 +72,10 @@ void os_app_main(void)
...
@@ -66,15 +72,10 @@ void os_app_main(void)
init_buttons
();
init_buttons
();
captouch_init
();
captouch_init
();
display_init
();
display_init
();
hw_init_done
=
1
;
while
(
1
)
{
vTaskDelay
((
CAPTOUCH_POLLING_PERIOD
)
/
portTICK_PERIOD_MS
);
update_button_state
();
captouch_read_cycle
();
}
ESP_ERROR_CHECK
(
i2c_driver_delete
(
I2C_MASTER_NUM
));
TimerHandle_t
i2c
=
xTimerCreate
(
"I2C task"
,
pdMS_TO_TICKS
(
CAPTOUCH_POLLING_PERIOD
),
pdTRUE
,
(
void
*
)
0
,
*
i2c_task
);
ESP_LOGI
(
TAG
,
"I2C de-initialized successfully"
);
if
(
xTimerStart
(
i2c
,
0
)
!=
pdPASS
)
ESP_LOGI
(
TAG
,
"I2C task initialization failed"
);
hw_init_done
=
1
;
}
}
uint8_t
hardware_is_initialized
(){
uint8_t
hardware_is_initialized
(){
...
...
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