@@ -38,7 +38,6 @@ namespace espp {
38
38
// / - Keyboard
39
39
// / - Audio
40
40
// / - Interrupts
41
- // / - Buttons (boot)
42
41
// / - I2C
43
42
// /
44
43
// / For more information, see
@@ -370,19 +369,6 @@ class TDeck : public BaseComponent {
370
369
// / if there is an ongoing SPI transaction
371
370
void write_lcd_lines (int xs, int ys, int xe, int ye, const uint8_t *data, uint32_t user_data);
372
371
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
-
386
372
// ///////////////////////////////////////////////////////////////////////////
387
373
// Audio
388
374
// ///////////////////////////////////////////////////////////////////////////
@@ -451,8 +437,6 @@ class TDeck : public BaseComponent {
451
437
bool audio_task_callback (std::mutex &m, std::condition_variable &cv, bool &task_notified);
452
438
453
439
// common:
454
- // button (boot button)
455
- static constexpr gpio_num_t boot_button_io = GPIO_NUM_0; // active low
456
440
// internal i2c (touchscreen, keyboard)
457
441
static constexpr auto internal_i2c_port = I2C_NUM_0;
458
442
static constexpr auto internal_i2c_clock_speed = 400 * 1000 ;
@@ -529,7 +513,7 @@ class TDeck : public BaseComponent {
529
513
static constexpr gpio_num_t trackball_down = GPIO_NUM_3;
530
514
static constexpr gpio_num_t trackball_left = GPIO_NUM_1;
531
515
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
533
517
534
518
// uSD card
535
519
static constexpr gpio_num_t sdcard_cs = GPIO_NUM_39;
@@ -553,17 +537,6 @@ class TDeck : public BaseComponent {
553
537
// sdcard
554
538
sdmmc_card_t *sdcard_{nullptr };
555
539
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 };
567
540
espp::Interrupt::PinConfig touch_interrupt_pin_{
568
541
.gpio_num = touch_interrupt,
569
542
.callback =
@@ -623,10 +596,6 @@ class TDeck : public BaseComponent {
623
596
.stack_size_bytes = CONFIG_TDECK_INTERRUPT_STACK_SIZE,
624
597
.priority = 20 }}};
625
598
626
- // button
627
- std::atomic<bool > boot_button_initialized_{false };
628
- button_callback_t boot_button_callback_{nullptr };
629
-
630
599
// keyboard
631
600
std::shared_ptr<TKeyboard> keyboard_{nullptr };
632
601
0 commit comments