Skip to content

Conversation

SuGlider
Copy link
Collaborator

@SuGlider SuGlider commented Aug 16, 2025

Description of Change

Based on user report, the Watchy pins-arduino.h causes compilation error.
It shall follow https://github.com/sqfmi/Watchy/blob/master/src/config.h

Test Scenarios

Select Watchy board and try to compile a basic sketch
The board revision will default to "Watchy 2.0". Leave it that way.

Open Arduino IDE Examples -> Watchy -> WatchFaces -> Basic.ino

#include <Watchy.h>
#include "settings.h"

Watchy watchy(settings);

void setup() {
  watchy.init();
}

void loop() {}

Error Message that shall be fixed with this PR:

In file included from C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\cores\esp32/Arduino.h:43,
                 from C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.h:4,
                 from C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:1:
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp: In member function 'void Watchy::deepSleep()':
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:46:23: error: 'GPIO_SEL_26' was not declared in this scope; did you mean 'GPIO_NUM_26'?
   46 | #define MENU_BTN_MASK GPIO_SEL_26
      |                       ^~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:50:23: note: in expansion of macro 'MENU_BTN_MASK'
   50 | #define BTN_PIN_MASK  MENU_BTN_MASK | BACK_BTN_MASK | UP_BTN_MASK | DOWN_BTN_MASK
      |                       ^~~~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:129:7: note: in expansion of macro 'BTN_PIN_MASK'
  129 |       BTN_PIN_MASK,
      |       ^~~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:47:23: error: 'GPIO_SEL_25' was not declared in this scope; did you mean 'GPIO_NUM_25'?
   47 | #define BACK_BTN_MASK GPIO_SEL_25
      |                       ^~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:50:39: note: in expansion of macro 'BACK_BTN_MASK'
   50 | #define BTN_PIN_MASK  MENU_BTN_MASK | BACK_BTN_MASK | UP_BTN_MASK | DOWN_BTN_MASK
      |                                       ^~~~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:129:7: note: in expansion of macro 'BTN_PIN_MASK'
  129 |       BTN_PIN_MASK,
      |       ^~~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:42:21: error: 'GPIO_SEL_35' was not declared in this scope; did you mean 'GPIO_NUM_35'?
   42 | #define UP_BTN_MASK GPIO_SEL_35
      |                     ^~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:50:55: note: in expansion of macro 'UP_BTN_MASK'
   50 | #define BTN_PIN_MASK  MENU_BTN_MASK | BACK_BTN_MASK | UP_BTN_MASK | DOWN_BTN_MASK
      |                                                       ^~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:129:7: note: in expansion of macro 'BTN_PIN_MASK'
  129 |       BTN_PIN_MASK,
      |       ^~~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:48:23: error: 'GPIO_SEL_4' was not declared in this scope; did you mean 'GPIO_NUM_4'?
   48 | #define DOWN_BTN_MASK GPIO_SEL_4
      |                       ^~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:50:69: note: in expansion of macro 'DOWN_BTN_MASK'
   50 | #define BTN_PIN_MASK  MENU_BTN_MASK | BACK_BTN_MASK | UP_BTN_MASK | DOWN_BTN_MASK
      |                                                                     ^~~~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:129:7: note: in expansion of macro 'BTN_PIN_MASK'
  129 |       BTN_PIN_MASK,
      |       ^~~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp: In member function 'virtual void Watchy::handleButtonPress()':
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:46:23: error: 'GPIO_SEL_26' was not declared in this scope; did you mean 'GPIO_NUM_26'?
   46 | #define MENU_BTN_MASK GPIO_SEL_26
      |                       ^~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:138:19: note: in expansion of macro 'MENU_BTN_MASK'
  138 |   if (wakeupBit & MENU_BTN_MASK) {
      |                   ^~~~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:47:23: error: 'GPIO_SEL_25' was not declared in this scope; did you mean 'GPIO_NUM_25'?
   47 | #define BACK_BTN_MASK GPIO_SEL_25
      |                       ^~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:174:24: note: in expansion of macro 'BACK_BTN_MASK'
  174 |   else if (wakeupBit & BACK_BTN_MASK) {
      |                        ^~~~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:42:21: error: 'GPIO_SEL_35' was not declared in this scope; did you mean 'GPIO_NUM_35'?
   42 | #define UP_BTN_MASK GPIO_SEL_35
      |                     ^~~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:187:24: note: in expansion of macro 'UP_BTN_MASK'
  187 |   else if (wakeupBit & UP_BTN_MASK) {
      |                        ^~~~~~~~~~~
C:\Users\esp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\watchy/pins_arduino.h:48:23: error: 'GPIO_SEL_4' was not declared in this scope; did you mean 'GPIO_NUM_4'?
   48 | #define DOWN_BTN_MASK GPIO_SEL_4
      |                       ^~~~~~~~~~
C:\Users\esp\Documents\Arduino\libraries\Watchy\src\Watchy.cpp:199:24: note: in expansion of macro 'DOWN_BTN_MASK'
  199 |   else if (wakeupBit & DOWN_BTN_MASK) {
      |                        ^~~~~~~~~~~~~

Related links

Closes #11737

@SuGlider SuGlider added this to the 3.3.0 milestone Aug 16, 2025
@SuGlider SuGlider self-assigned this Aug 16, 2025
@SuGlider SuGlider added the Type: 3rd party Boards Related to third-party/non-Espressif hardware boards. label Aug 16, 2025
@SuGlider SuGlider requested a review from P-R-O-C-H-Y as a code owner August 16, 2025 13:24
@SuGlider SuGlider marked this pull request as draft August 16, 2025 13:25
Copy link
Contributor

github-actions bot commented Aug 16, 2025

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello SuGlider, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against b756680

@SuGlider SuGlider moved this from In Progress to In Review in Arduino ESP32 Core Project Roadmap Sep 3, 2025
@SuGlider SuGlider added the Status: Review needed Issue or PR is awaiting review label Sep 3, 2025
@SuGlider SuGlider marked this pull request as ready for review September 3, 2025 17:30
@SuGlider SuGlider added the Type: Bug 🐛 All bugs label Sep 3, 2025
@SuGlider SuGlider requested a review from Copilot September 3, 2025 18:06
Copilot

This comment was marked as outdated.

@SuGlider SuGlider requested a review from Copilot September 3, 2025 18:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes compilation errors in the Watchy device pins configuration by replacing deprecated GPIO_SEL_* constants with BIT64() macro calls. The issue was causing builds to fail when using the Watchy board with Arduino IDE examples.

  • Replaces hardcoded GPIO_SEL_* constants with dynamic BIT64() macro calculations
  • Removes version-specific UP_BTN_MASK definitions and consolidates mask definitions
  • Updates all button and interrupt pin masks to use the corrected format

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@me-no-dev
Copy link
Member

@P-R-O-C-H-Y PTAL

@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Sep 4, 2025
@me-no-dev me-no-dev merged commit f9bc177 into master Sep 4, 2025
11 checks passed
@me-no-dev me-no-dev deleted the fix/watchy_pin_mask branch September 4, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Merge Pull Request is ready to be merged Type: Bug 🐛 All bugs Type: 3rd party Boards Related to third-party/non-Espressif hardware boards.
Projects
Development

Successfully merging this pull request may close these issues.

Issues with variants/watchy/pins_arduino.h
4 participants