Skip to content
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

warning: unused variable 'reg' #74

Open
brunohorta82 opened this issue Jul 28, 2019 · 3 comments · May be fixed by #78
Open

warning: unused variable 'reg' #74

brunohorta82 opened this issue Jul 28, 2019 · 3 comments · May be fixed by #78

Comments

@brunohorta82
Copy link

.pio/libdeps/esp12e/OneWire_ID1/OneWire.cpp: In member function 'uint8_t OneWire::reset()':
.pio/libdeps/esp12e/OneWire_ID1/OneWire.cpp:167:24: warning: unused variable 'reg' [-Wunused-variable]
volatile IO_REG_TYPE *reg IO_REG_BASE_ATTR = baseReg;
^
.pio/libdeps/esp12e/OneWire_ID1/OneWire.cpp: In member function 'void OneWire::write_bit(uint8_t)':
.pio/libdeps/esp12e/OneWire_ID1/OneWire.cpp:201:24: warning: unused variable 'reg' [-Wunused-variable]
volatile IO_REG_TYPE *reg IO_REG_BASE_ATTR = baseReg;
^
.pio/libdeps/esp12e/OneWire_ID1/OneWire.cpp: In member function 'uint8_t OneWire::read_bit()':
.pio/libdeps/esp12e/OneWire_ID1/OneWire.cpp:229:24: warning: unused variable 'reg' [-Wunused-variable]
volatile IO_REG_TYPE *reg IO_REG_BASE_ATTR = baseReg;

nomis added a commit to nomis/OneWire that referenced this issue Sep 28, 2019
@nomis nomis linked a pull request Sep 28, 2019 that will close this issue
@9a4gl
Copy link

9a4gl commented Sep 1, 2020

Please merge nomis fix for this warning, same fix has to be applied to ESP32 as I actually had same warning on ESP32.

9a4gl pushed a commit to 9a4gl/OneWire that referenced this issue Sep 9, 2020
@zfields
Copy link

zfields commented Apr 13, 2021

Using v2.3.5 I ran into the same warning with the ESP32. It is easy to reproduce, add the Warnings: All flag to the Arduino IDE.

@zeroject
Copy link

zeroject commented Feb 9, 2023

Please merge this branch as thoose viabels are not used. If someone has this problem open OneWire.cpp in your documents and delete "volatile IO_REG_TYPE *reg IO_REG_BASE_ATTR = baseReg;" from the functions Readbit WriteBit and reset and your program should compile and work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants