Skip to content

Issues with variants/watchy/pins_arduino.h #11737

@martindiv

Description

@martindiv

Board

FQBN: esp32:esp32:watchy:EraseFlash=all,Revision

Device Description

Watchy device available from SQFMI

Hardware Configuration

No external devices connected

Version

v3.3.0

Type

Bug

IDE Name

Arduino IDE

Operating System

Linux

Flash frequency

Unknown

PSRAM enabled

no

Upload speed

921600

Description

The file variants/watchy/pins_arduino.h is incorrectly using outdated GPIO_SEL_## macros to set the following macros:
#define UP_BTN_MASK (set from an #if/#elseif/#else block)
#define MENU_BTN_MASK
#define BACK_BTN_MASK
#define DOWN_BTN_MASK
#define ACC_INT_MASK

This isn't, however, just a mater of correcting the macros. These macros are bitmasks that need to be parsed through the BIT64() macro. Just changing the macros to, for instance:
#define UP_BTN_MASK GPIO_NUM_32
#define MENU_BTN_MASK GPIO_NUM_26
#define BACK_BTN_MASK GPIO_NUM_25
#define DOWN_BTN_MASK GPIO_NUM_4
#define ACC_INT_MASK GPIO_NUM_14

is incorrect. The macros actually need to look like:
#define UP_BTN_MASK (BIT64(GPIO_NUM_32))
#define MENU_BTN_MASK (BIT64(GPIO_NUM_26))
#define BACK_BTN_MASK (BIT64(GPIO_NUM_25))
#define DOWN_BTN_MASK (BIT64(GPIO_NUM_4))
#define ACC_INT_MASK (BIT64(GPIO_NUM_14))

Please note that UP_BTN_MASK is set from within an #if/#elseif/#else block and will be differen than shown here.

Sketch

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

Watchy watchy(settings);

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

void loop() {}

Debug Message

Compile time issues. No output.

Other Steps to Reproduce

The current file in this github directory has the incorrect settings.

In Arduino IDE:

  • Install the Espressif board set tool chains.
  • Set the board to Watchy. The board revision will default to "Watchy 2.0". Leave it that way.
  • The other compile time settings can be left at default values.
  • Attempt to compile the sketch provided here or the Basic example provided by the Watchy library (its the same sketch.)
  • Compile will fail with errors saying that GPIO_SEL_## (where ## is a number) is not defined. Compiler recommends using GPIO_NUM_## in stead.

Changing the macros to just the equivalent GPIO_NUM_## values will allow the code to compile but when uploaded to the Watchy device you will find that none of the buttons work and you will need to put the device into programming mode or open the watch and use a direct access programmer to recover. The GPIO_NUM_## numbers needs to be parsed through the macro BIT64() in order to work correctly.

Also note: BIT64() is required for only these macros:
#define UP_BTN_MASK (set from an #if/#elseif/#else block)
#define MENU_BTN_MASK
#define BACK_BTN_MASK
#define DOWN_BTN_MASK
#define ACC_INT_MASK

Finally: You can view the config.h file from the Watchy library source code as it appears to be the source for the data in variants/watchy/pins_arduino.h.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Type: 3rd party BoardsRelated to third-party/non-Espressif hardware boards.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions