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
03891bc2
Commit
03891bc2
authored
2 years ago
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
captouch: updated espidf version in readme and added task to timer
parent
6d6f6dec
Branches
raw_captouch_old
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
components/badge23/espan.c
+23
-6
23 additions, 6 deletions
components/badge23/espan.c
with
24 additions
and
7 deletions
README.md
+
1
−
1
View file @
03891bc2
...
@@ -26,7 +26,7 @@ Please transfer all .py files in python_payload/ for using the demo payload.
...
@@ -26,7 +26,7 @@ Please transfer all .py files in python_payload/ for using the demo payload.
$ cd ~
$ cd ~
$ git clone https://github.com/espressif/esp-idf.git
$ git clone https://github.com/espressif/esp-idf.git
$ cd esp-idf
$ cd esp-idf
$ git checkout v4.4
$ git checkout v4.4
.4
$ git submodule update --init --recursive
$ git submodule update --init --recursive
$ cd esp-idf
$ cd esp-idf
...
...
This diff is collapsed.
Click to expand it.
components/badge23/espan.c
+
23
−
6
View file @
03891bc2
...
@@ -34,6 +34,9 @@ static const char *TAG = "espan";
...
@@ -34,6 +34,9 @@ static const char *TAG = "espan";
#error "i2c not implemented for this badge generation"
#error "i2c not implemented for this badge generation"
#endif
#endif
static
QueueHandle_t
i2c_queue
=
NULL
;
static
uint8_t
dummy_data
;
static
esp_err_t
i2c_master_init
(
void
)
static
esp_err_t
i2c_master_init
(
void
)
{
{
int
i2c_master_port
=
I2C_MASTER_NUM
;
int
i2c_master_port
=
I2C_MASTER_NUM
;
...
@@ -52,12 +55,19 @@ static esp_err_t i2c_master_init(void)
...
@@ -52,12 +55,19 @@ static esp_err_t i2c_master_init(void)
return
i2c_driver_install
(
i2c_master_port
,
conf
.
mode
,
I2C_MASTER_RX_BUF_DISABLE
,
I2C_MASTER_TX_BUF_DISABLE
,
0
);
return
i2c_driver_install
(
i2c_master_port
,
conf
.
mode
,
I2C_MASTER_RX_BUF_DISABLE
,
I2C_MASTER_TX_BUF_DISABLE
,
0
);
}
}
#define CAPTOUCH_POLLING_PERIOD
23
#define CAPTOUCH_POLLING_PERIOD
10
static
uint8_t
hw_init_done
=
0
;
static
uint8_t
hw_init_done
=
0
;
void
i2c_task
(
TimerHandle_t
data
){
void
i2c_timer
(
TimerHandle_t
data
){
update_button_state
();
xQueueSend
(
i2c_queue
,
&
dummy_data
,
0
);
}
void
i2c_task
(
void
*
data
){
while
(
1
){
xQueueReceive
(
i2c_queue
,
&
dummy_data
,
portMAX_DELAY
);
captouch_read_cycle
();
captouch_read_cycle
();
update_button_state
();
}
}
}
void
os_app_main
(
void
)
void
os_app_main
(
void
)
...
@@ -73,8 +83,15 @@ void os_app_main(void)
...
@@ -73,8 +83,15 @@ void os_app_main(void)
captouch_init
();
captouch_init
();
display_init
();
display_init
();
TimerHandle_t
i2c
=
xTimerCreate
(
"I2C task"
,
pdMS_TO_TICKS
(
CAPTOUCH_POLLING_PERIOD
),
pdTRUE
,
(
void
*
)
0
,
*
i2c_task
);
i2c_queue
=
xQueueCreate
(
1
,
1
);
if
(
xTimerStart
(
i2c
,
0
)
!=
pdPASS
)
ESP_LOGI
(
TAG
,
"I2C task initialization failed"
);
TaskHandle_t
i2c_task_handle
;
//xTaskCreate(&i2c_task, "I2C task", 4096, NULL, configMAX_PRIORITIES , &i2c_task_handle);
xTaskCreatePinnedToCore
(
&
i2c_task
,
"I2C task"
,
4096
,
NULL
,
configMAX_PRIORITIES
-
1
,
&
i2c_task_handle
,
0
);
TimerHandle_t
i2c_timer_handle
=
xTimerCreate
(
"I2C timer"
,
pdMS_TO_TICKS
(
CAPTOUCH_POLLING_PERIOD
),
pdTRUE
,
(
void
*
)
0
,
*
i2c_timer
);
if
(
xTimerStart
(
i2c_timer_handle
,
0
)
!=
pdPASS
)
ESP_LOGI
(
TAG
,
"I2C task initialization failed"
);
hw_init_done
=
1
;
hw_init_done
=
1
;
}
}
...
...
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