Skip to content
Snippets Groups Projects
Commit e33cefb8 authored by moon2's avatar moon2 :speech_balloon:
Browse files

crappy captouch in c

parent f8c05e2a
No related branches found
No related tags found
No related merge requests found
...@@ -23,3 +23,6 @@ user.props ...@@ -23,3 +23,6 @@ user.props
# MacOS desktop metadata files # MacOS desktop metadata files
.DS_Store .DS_Store
#ctags
tags
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
//#include <string.h> //#include <string.h>
#include "esp_log.h" #include "esp_log.h"
#include "driver/i2c.h" #include "driver/i2c.h"
#include <stdint.h>
static const char *TAG = "captouch"; static const char *TAG = "captouch";
...@@ -153,6 +154,12 @@ static void IRAM_ATTR gpio_isr_handler(void* arg) ...@@ -153,6 +154,12 @@ static void IRAM_ATTR gpio_isr_handler(void* arg)
xQueueSendFromISR(gpio_evt_queue, &chip, NULL); xQueueSendFromISR(gpio_evt_queue, &chip, NULL);
} }
void manual_captouch_readout(uint8_t top)
{
struct ad714x_chip* chip = top ? (&chip_top) : (&chip_bot);
xQueueSendFromISR(gpio_evt_queue, &chip, NULL);
}
void espan_handle_captouch(uint16_t pressed_top, uint16_t pressed_bot); void espan_handle_captouch(uint16_t pressed_top, uint16_t pressed_bot);
static uint16_t pressed_top, pressed_bot; static uint16_t pressed_top, pressed_bot;
......
#pragma once #pragma once
#include <stdint.h>
void captouch_init(void); void captouch_init(void);
void captouch_print_debug_info(void); void captouch_print_debug_info(void);
void gpio_event_handler(void * arg); void gpio_event_handler(void * arg);
void manual_captouch_readout(uint8_t top);
void captouch_get_cross(int paddle, int * x, int * y); void captouch_get_cross(int paddle, int * x, int * y);
...@@ -100,7 +100,7 @@ void os_app_main(void) ...@@ -100,7 +100,7 @@ void os_app_main(void)
audio_init(); audio_init();
leds_init(); leds_init();
//display_init(); //display_init();
//captouch_init(); captouch_init();
mp_hal_stdout_tx_str("task inits done\n\r"); mp_hal_stdout_tx_str("task inits done\n\r");
//play_bootsound(); //play_bootsound();
...@@ -115,6 +115,11 @@ void os_app_main(void) ...@@ -115,6 +115,11 @@ void os_app_main(void)
int i = 0; int i = 0;
void * asdasd = &i; void * asdasd = &i;
while(1) { while(1) {
manual_captouch_readout(1);
vTaskDelay(10 / portTICK_PERIOD_MS);
manual_captouch_readout(0);
vTaskDelay(10 / portTICK_PERIOD_MS);
continue; continue;
i = (i + 1) % 10; i = (i + 1) % 10;
if(!(i == 2 || i == 8)) continue; if(!(i == 2 || i == 8)) continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment