Skip to content
Snippets Groups Projects
Commit 5ff305e4 authored by moon2's avatar moon2 :speech_balloon: Committed by q3k
Browse files

crappy captouch in c

parent b7e0ec32
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
//#include <string.h>
#include "esp_log.h"
#include "driver/i2c.h"
#include <stdint.h>
static const char *TAG = "captouch";
......@@ -153,6 +154,12 @@ static void IRAM_ATTR gpio_isr_handler(void* arg)
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);
static uint16_t pressed_top, pressed_bot;
......
#pragma once
#include <stdint.h>
void captouch_init(void);
void captouch_print_debug_info(void);
void gpio_event_handler(void * arg);
void manual_captouch_readout(uint8_t top);
void captouch_get_cross(int paddle, int * x, int * y);
......@@ -100,7 +100,7 @@ void os_app_main(void)
audio_init();
leds_init();
//display_init();
//captouch_init();
captouch_init();
mp_hal_stdout_tx_str("task inits done\n\r");
//play_bootsound();
......@@ -115,6 +115,11 @@ void os_app_main(void)
int i = 0;
void * asdasd = &i;
while(1) {
manual_captouch_readout(1);
vTaskDelay(10 / portTICK_PERIOD_MS);
manual_captouch_readout(0);
vTaskDelay(10 / portTICK_PERIOD_MS);
continue;
i = (i + 1) % 10;
if(!(i == 2 || i == 8)) continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment