clean bomb and step 1
This commit is contained in:
@@ -161,6 +161,9 @@ bool get_touch_released(void) {
|
||||
}
|
||||
|
||||
static void poll_bottom_task(void *arg);
|
||||
static void receive_keypad(void);
|
||||
static void receive_button(void);
|
||||
static void receive_touch(void);
|
||||
|
||||
// static void IRAM_ATTR gpio_isr_handler(void* arg)
|
||||
// {
|
||||
@@ -196,6 +199,10 @@ void init_bottom_half() {
|
||||
//hook isr handler for specific gpio pin
|
||||
// gpio_isr_handler_add(BOTTOM_INTERUPT_PIN, gpio_isr_handler, NULL);
|
||||
|
||||
receive_keypad();
|
||||
receive_button();
|
||||
receive_touch();
|
||||
|
||||
xTaskCreate(poll_bottom_task, "poll_bottom", 4096, NULL, 10, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ esp_err_t play_raw(const char *fp) {
|
||||
i2s_channel_disable(tx_chan);
|
||||
free(read_buf);
|
||||
free(write_buf);
|
||||
fclose(fh);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
+17
-5
@@ -36,8 +36,9 @@
|
||||
|
||||
static const char *TFT_TAG = "tft_driver";
|
||||
|
||||
#define DISPLAY_HORIZONTAL_PIXELS 320
|
||||
#define DISPLAY_VERTICAL_PIXELS 480
|
||||
// rotation swaps the horizontal and vertical pixel counts
|
||||
#define DISPLAY_HORIZONTAL_PIXELS 480
|
||||
#define DISPLAY_VERTICAL_PIXELS 320
|
||||
#define DISPLAY_COMMAND_BITS 8
|
||||
#define DISPLAY_PARAMETER_BITS 8
|
||||
#define DISPLAY_REFRESH_HZ 40000000
|
||||
@@ -169,9 +170,9 @@ void initialize_display() {
|
||||
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_reset(lcd_handle));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_init(lcd_handle));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_invert_color(lcd_handle, false));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(lcd_handle, false));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_mirror(lcd_handle, true, false));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_invert_color(lcd_handle, true));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(lcd_handle, true));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_mirror(lcd_handle, false, true));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(lcd_handle, 0, 0));
|
||||
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_off(lcd_handle, false));
|
||||
@@ -199,6 +200,7 @@ void initialize_lvgl() {
|
||||
lv_disp_drv.flush_cb = lvgl_flush_cb;
|
||||
lv_disp_drv.draw_buf = &lv_disp_buf;
|
||||
lv_disp_drv.user_data = lcd_handle;
|
||||
// lv_disp_drv.rotated = LV_DISP_ROT_90;
|
||||
lv_display = lv_disp_drv_register(&lv_disp_drv);
|
||||
|
||||
ESP_LOGI(TFT_TAG, "Creating LVGL tick timer");
|
||||
@@ -271,11 +273,21 @@ void create_demo_ui() {
|
||||
lv_anim_start(&a);
|
||||
}
|
||||
|
||||
void tick_timer_task(void* arg) {
|
||||
while (1)
|
||||
{
|
||||
vTaskDelay(pdMS_TO_TICKS(10));
|
||||
lv_timer_handler();
|
||||
}
|
||||
}
|
||||
|
||||
void init_tft() {
|
||||
initialize_spi();
|
||||
initialize_display();
|
||||
initialize_lvgl();
|
||||
|
||||
xTaskCreate(tick_timer_task, "tick_lvgl", 4096, NULL, 5, NULL);
|
||||
|
||||
ESP_LOGI(TFT_TAG, "TFT initialization Successful");
|
||||
}
|
||||
|
||||
|
||||
@@ -55,20 +55,26 @@ uint8_t get_cut_wires(void) {
|
||||
return return_;
|
||||
}
|
||||
|
||||
bool get_button(void) {
|
||||
bool get_help_button(void) {
|
||||
return button_state;
|
||||
}
|
||||
bool get_button_pressed(void) {
|
||||
bool get_help_button_pressed(void) {
|
||||
bool return_ = button_pressed;
|
||||
button_pressed = false;
|
||||
return return_;
|
||||
}
|
||||
bool get_button_released(void) {
|
||||
bool get_help_button_released(void) {
|
||||
bool return_ = button_released;
|
||||
button_released = false;
|
||||
return return_;
|
||||
}
|
||||
|
||||
void clear_wires_pressed_released_cut(void) {
|
||||
wires_cut = 0;
|
||||
button_pressed = false;
|
||||
button_released = false;
|
||||
}
|
||||
|
||||
void strike(char* reason) {
|
||||
ESP_LOGW("strike!", "%s", reason);
|
||||
uint8_t reg = 6;
|
||||
|
||||
@@ -17,9 +17,11 @@ void init_wires(void);
|
||||
uint8_t get_wires(void);
|
||||
uint8_t get_cut_wires(void);
|
||||
|
||||
bool get_button(void);
|
||||
bool get_button_pressed(void);
|
||||
bool get_button_released(void);
|
||||
bool get_help_button(void);
|
||||
bool get_help_button_pressed(void);
|
||||
bool get_help_button_released(void);
|
||||
|
||||
void clear_wires_pressed_released_cut(void);
|
||||
|
||||
void set_leds(uint8_t led_states);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user