Skip to content

Commit 218ce03

Browse files
committed
remove boot button which is unneeded since trackball accounts for it
1 parent d41e39e commit 218ce03

File tree

2 files changed

+1
-60
lines changed

2 files changed

+1
-60
lines changed

components/t-deck/include/t-deck.hpp

+1-32
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ namespace espp {
3838
/// - Keyboard
3939
/// - Audio
4040
/// - Interrupts
41-
/// - Buttons (boot)
4241
/// - I2C
4342
///
4443
/// For more information, see
@@ -370,19 +369,6 @@ class TDeck : public BaseComponent {
370369
/// if there is an ongoing SPI transaction
371370
void write_lcd_lines(int xs, int ys, int xe, int ye, const uint8_t *data, uint32_t user_data);
372371

373-
/////////////////////////////////////////////////////////////////////////////
374-
// Button
375-
/////////////////////////////////////////////////////////////////////////////
376-
377-
/// Initialize the boot button
378-
/// \param callback The callback function to call when the button is pressed
379-
/// \return true if the button was successfully initialized, false otherwise
380-
bool initialize_boot_button(const button_callback_t &callback = nullptr);
381-
382-
/// Get the boot button state
383-
/// \return The button state (true = button pressed, false = button released)
384-
bool boot_button_state() const;
385-
386372
/////////////////////////////////////////////////////////////////////////////
387373
// Audio
388374
/////////////////////////////////////////////////////////////////////////////
@@ -451,8 +437,6 @@ class TDeck : public BaseComponent {
451437
bool audio_task_callback(std::mutex &m, std::condition_variable &cv, bool &task_notified);
452438

453439
// common:
454-
// button (boot button)
455-
static constexpr gpio_num_t boot_button_io = GPIO_NUM_0; // active low
456440
// internal i2c (touchscreen, keyboard)
457441
static constexpr auto internal_i2c_port = I2C_NUM_0;
458442
static constexpr auto internal_i2c_clock_speed = 400 * 1000;
@@ -529,7 +513,7 @@ class TDeck : public BaseComponent {
529513
static constexpr gpio_num_t trackball_down = GPIO_NUM_3;
530514
static constexpr gpio_num_t trackball_left = GPIO_NUM_1;
531515
static constexpr gpio_num_t trackball_right = GPIO_NUM_2;
532-
static constexpr gpio_num_t trackball_btn = GPIO_NUM_0;
516+
static constexpr gpio_num_t trackball_btn = GPIO_NUM_0; // NOTE: this is the boot button
533517

534518
// uSD card
535519
static constexpr gpio_num_t sdcard_cs = GPIO_NUM_39;
@@ -553,17 +537,6 @@ class TDeck : public BaseComponent {
553537
// sdcard
554538
sdmmc_card_t *sdcard_{nullptr};
555539

556-
espp::Interrupt::PinConfig boot_button_interrupt_pin_{
557-
.gpio_num = boot_button_io,
558-
.callback =
559-
[this](const auto &event) {
560-
if (boot_button_callback_) {
561-
boot_button_callback_(event);
562-
}
563-
},
564-
.active_level = espp::Interrupt::ActiveLevel::LOW,
565-
.interrupt_type = espp::Interrupt::Type::ANY_EDGE,
566-
.pullup_enabled = true};
567540
espp::Interrupt::PinConfig touch_interrupt_pin_{
568541
.gpio_num = touch_interrupt,
569542
.callback =
@@ -623,10 +596,6 @@ class TDeck : public BaseComponent {
623596
.stack_size_bytes = CONFIG_TDECK_INTERRUPT_STACK_SIZE,
624597
.priority = 20}}};
625598

626-
// button
627-
std::atomic<bool> boot_button_initialized_{false};
628-
button_callback_t boot_button_callback_{nullptr};
629-
630599
// keyboard
631600
std::shared_ptr<TKeyboard> keyboard_{nullptr};
632601

components/t-deck/src/buttons.cpp

-28
This file was deleted.

0 commit comments

Comments
 (0)