Description
Describe the bug
There is only one button on the Nucleo L432KC, yet USER_BTN
is defined in the variant file.
Based on my tinkering, I would say the USER_BTN
is "pressed" by triggering the accelerometer. While I can see this as a handy feature, I think it is very misleading to call it USER_BTN
, instead of ACCEL_PIN
(or something of that nature).
To Reproduce
Complete source code which can be used to reproduce the issue. Please try to be as generic as possible (no extra code, extra hardware,...)
#define BUTTON USER_BTN // no user button available (triggered by accelerometer event)
// #define BUTTON 3 // behaves as expected with external momentary push button
volatile bool isr_fired = false;
void buttonISR () {
isr_fired = true;
}
void setup () {
::pinMode(LED_BUILTIN, OUTPUT);
::pinMode(BUTTON, INPUT);
::attachInterrupt(digitalPinToInterrupt(BUTTON), buttonISR, FALLING);
}
void loop () {
if (isr_fired) {
isr_fired = false;
::digitalWrite(LED_BUILTIN, HIGH);
::delay(250);
}
::digitalWrite(LED_BUILTIN, LOW);
}
Steps to reproduce the behavior:
- Plug
- Press USER_BTN (i.e. move or tap board)
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
From the Product Overview Page:
Desktop (please complete the following information):
- OS: Linux
- Arduino IDE version: 1.8.19
- STM32 core version: 2.2.0
- Tools menu settings if not the default: defaults
- Upload method: Mass Storage
Board (please complete the following information):
- Name: Nucleo L432KC
- Hardware Revision: ?
- Extra hardware used if any: N/A
Additional context
Add any other context about the problem here.