-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility issue with AVR DxCore Family #124
Comments
Fallback mode did not work for me, when F_CPU clock is 4 MHz or below. |
Thank you nurazur. It took me hours to find why the avr32db28 did not read the ds18b20. Troubleshooting ended after reading you above. Your comment has a tipo. So to recap for those encountering the same problem. OneWire/util/OneWire_direct_gpio.h Line 18 in dbf2033
add to the end of line: || defined (ARDUINO_avrdb)
|
typo in my previous post is corrected. Sorry for the inconvenience. |
Also stumbled across this one today (had to add ARDUINO_avrdd to line 18). |
Description
OneWire wont work on the new AVR Dx Series chips using board variant from SpenceKonde.
modified \Libraries\OneWire\2.3.7\OneWire\util\OneWire_direct_gpio.h
added condition in case ARDUINO_avrdb is defiend to achieve fall back mode and added following code modification.
this should work with DA series and other boards with proper condition in to fall back mode.
#if defined(ARDUINO_avrdb)
#define PIN_TO_BASEREG(pin) (0)
#define PIN_TO_BITMASK(pin) (pin)
#define IO_REG_TYPE uint8_t
#define IO_REG_BASE_ATTR
#define IO_REG_MASK_ATTR
#define DIRECT_READ(base, pin) digitalRead(pin)
#define DIRECT_WRITE_LOW(base, pin) digitalWrite(pin, LOW)
#define DIRECT_WRITE_HIGH(base, pin) digitalWrite(pin, HIGH)
#define DIRECT_MODE_INPUT(base, pin) pinMode(pin,INPUT)
#define DIRECT_MODE_OUTPUT(base, pin) pinMode(pin,OUTPUT)
#warning "OneWire. Fallback mode. Using API calls for pinMode,digitalRead and digitalWrite. Operation of this library is not guaranteed on this architecture."
#elif defined(AVR)
The text was updated successfully, but these errors were encountered: