Closed Pr77Pr77 closed 4 months ago
我也遇到了同样的问题(甚至报错显示的行数都一样XD),退回开发板的上一个版本(2.0.17)可以临时解决问题,但是我确实想在3.0.0中使用,我尝试修改库文件使得编译通过,不过失败了。。 目前我通过报错与库文件中寻找到可能与问题相关的开发板文件有:rtc_io.h和gpio.h,但是我去乐鑫官网找到的从2.0.17迁移到3.0.0的文档中似乎没有提及这部分 Migration from 2.x to 3.0
The problem still exists with version 3.0.0.
Just use the new OneWire_direct_gpio.h You have to replace it with the old one in your library directory.
版本 3.0.0 仍然存在问题。
看来是onewire的库需要更新,使用@peff74 的链接获取新的.h文件并替换旧文件之后可以编译通过
Just use the new OneWire_direct_gpio.h You have to replace it with the old one in your library directory.
万分感谢
Duplicate of https://github.com/PaulStoffregen/OneWire/issues/132, which has already been fixed by https://github.com/PaulStoffregen/OneWire/pull/134.
@Pr77Pr77 please close this issue to keep the issue tracker tidy.
Replacing the OneWire_direct_gpio.h file works. Thank you.
I've tagged release 2.3.8. It had been prepared some time ago, but was forgotten after lack of community feedback.
我已经标记了版本 2.3.8。它早在一段时间前就准备好了,但由于缺乏社区反馈而被遗忘了。
😅😅😅😅😅😅😅😅😅
Description
The compiling of the OneWire libary with the pre-released ESP32 core version 3.0.0-alpha3 throws an errorwhile compiling the DS18x20_Temperature example.
Steps To Reproduce Problem
Install the latest version of OneWire (2.3.7) and the ESP32 core version 3.0.0-alpha3. Choose the board "ESP32 Dev Module" and compile the example "DS18x20_Temperature".
Hardware & Software
Board: ESP32 Dev Module Shields / modules used: I don't know Arduino IDE version: 2.3.2 Teensyduino version (if using Teensy): Not used Version info & package name (from Tools > Boards > Board Manager): esp32 by Espressif Systems Version 3.0.0-alpha3 Operating system & version: Windows 11 Any other software or hardware?: No
Arduino Sketch
DS18x20_Temperature example of OneWire:
Errors or Incorrect Output
In file included from [path to documents]\Arduino\libraries\OneWire\OneWire.cpp:144: [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'uint32_t directRead(uint32_t)': [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:134:17: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 134 | return (GPIO.in >> pin) & 0x1; | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:136:17: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 136 | return (GPIO.in1.val >> (pin - 32)) & 0x1; | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directWriteLow(uint32_t)': [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:149:9: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 149 | GPIO.out_w1tc = ((uint32_t)1 << pin); | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:151:9: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 151 | GPIO.out1_w1tc.val = ((uint32_t)1 << (pin - 32)); | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directWriteHigh(uint32_t)': [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:162:9: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 162 | GPIO.out_w1ts = ((uint32_t)1 << pin); | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:164:9: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 164 | GPIO.out1_w1ts.val = ((uint32_t)1 << (pin - 32)); | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directModeInput(uint32_t)': [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:187:13: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 187 | GPIO.enable_w1tc = ((uint32_t)1 << pin); | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:189:13: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 189 | GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32)); | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directModeOutput(uint32_t)': [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:213:13: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 213 | GPIO.enable_w1ts = ((uint32_t)1 << pin); | ^~~~ | PI [path to documents]\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:215:13: error: 'GPIO' was not declared in this scope; did you mean 'PI'? 215 | GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32)); | ^~~~ | PI