Comments (9)
Can I ask you to pio pkg update -g -p gd32
again and test your original sketch, still without hardware pullups? I've tried to fix the bug in 5593435.
from arduinocore-gd32.
Could you remove the hardware pullups again and try this suggestion about the switched order?
#include <Arduino.h>
HardwareSerial Serial(PB7, PB6, 0);
void pinDidChange() {
Serial.println("pinDidChange");
}
void prepare() {
attachInterrupt(digitalPinToInterrupt(PA8), pinDidChange, CHANGE);
attachInterrupt(digitalPinToInterrupt(PA9), pinDidChange, CHANGE);
attachInterrupt(digitalPinToInterrupt(PA10), pinDidChange, CHANGE);
}
void setup() {
Serial.begin(115200);
Serial.println("EC11 Test");
// first setup interrupt (inits pin to "INPUT(_FLOATING)"
prepare();
// then activate their pullups
pinMode(PA9, INPUT_PULLUP);
pinMode(PA8, INPUT_PULLUP);
pinMode(PA10, INPUT_PULLUP);
}
void loop() {
delay(10);
// put your main code here, to run repeatedly:
}
from arduinocore-gd32.
work like a charm, thank you !
from arduinocore-gd32.
With what platformio.ini
is that exactly for reference?
We previously did have issues with pin modes being incorrect but I was convinced they're all properly fixed now in this file.
When you only do pinMode(PA9, INPUT_PULLUP);
, as the only command in setup()
and nothing in loop()
, is the pullup still off? We could have a bug in attachInterrupt
that resets the input mode back to INPUT
after all. Exchanging the order of prepare()
and pinMode(PA9, INPUT_PULLUP);
may be a workaround for this, but if that's true, then it's a bug.
from arduinocore-gd32.
Yes it's exactly like this. We have a bug.
ArduinoCore-GD32/cores/arduino/gd32/gpio_interrupt.c
Lines 48 to 62 in a178ad6
pinMode(x, INPUT_PULLUP);
should work perfectly fine, the only problem is that we're resetting it to input mode (without pullup or pulldown) during the attachInterrupt process. Will be fixed.
from arduinocore-gd32.
I use the board bluepill plus (https://github.com/WeActStudio/BluePill-Plus)
below is the ini file
[env:weact_bluepillplus_gd32f303cc]
platform = gd32
board = weact_bluepillplus_gd32f303cc
framework = arduino
from arduinocore-gd32.
oid gpio_interrupt_enable(uint32_t portNum, uint32_t pinNum, vo
in the future in case if I suspect some thing wrong with a function, I can I locate the right place right file as you did, say for example the interrupt? maybe I can do some pre-study/pre-investigation to help with.
from arduinocore-gd32.
it works! but this looks not compatible with standard Arduino "style" :-)
from arduinocore-gd32.
Exactly, that's why we're going to fix this bug in our code here. I think what's either correct is to simply not do the gpio_init() to INPUT_FLOATING (but still turn on the GPIO clock in case that's the first time the pin was used and there's no pinMode() done previously on it), or try to read the old pullup/pulldown mode and set it as the same. The first thing should be easier becasue it's just code removal and the INPUT_FLOATING case is the default GPIO configuration in all microcontrollers I've read.
from arduinocore-gd32.
Related Issues (20)
- freeRTOS for arduino support HOT 1
- Restore F170, F190 compilation
- DAC buffer on/off HOT 6
- EXTI GPIO: cannot assign callback to same pin number on different ports (GD32F130) HOT 2
- GD32F130 GPIO EXTI4-15 interrupt handler is slow, would be nice to be able to override it HOT 2
- Internal ADC Channel sampling HOT 2
- GD32F4XX SUPPORT HOT 1
- gpio_interrupt.c bug HOT 2
- Is there any arduino update for the GD32E23x board now? HOT 15
- Keep a structure similar to Arduino_Core_STM32 HOT 3
- GPIO mode mappings are wrong. Never get remapped to the SPL definitions. Needs rework HOT 3
- Move HardwareSerial to use Arduino HardwareSerial API HOT 1
- Keil Convert Arduino
- GD_PORT_GET(X) and GD_PIN_GET(X) encoding error HOT 1
- error: 'ltoa' was not declared in this scope; did you mean 'utoa'? HOT 1
- SimpleFOC HOT 10
- I2C on PB10 and PB11 HOT 6
- GD32F330F8P6 design guidelines HOT 13
- GD32F130xxxx clock support HOT 18
- I2C_slave hangs because of tx_buffer_ptr is never set back and *tx_buffer_ptr gets out of bounds.. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinocore-gd32.