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

Compilation error when adding an assignment statement #3

Open
TechSavvySam opened this issue Jan 13, 2025 · 9 comments
Open

Compilation error when adding an assignment statement #3

TechSavvySam opened this issue Jan 13, 2025 · 9 comments
Assignees

Comments

@TechSavvySam
Copy link

I can declare a float value and use it returning the default value, but as soon as I add an assignment statement to my code I get a compilation error. I was developing on the cloud and had the problem and then I downloaded to my local IDE and have the same problem.

Here's the code:

float LowVoltageTrigger;
EEPROMStorage<float> permLowVoltageTrigger(0,12.2);
...
 permLowVoltageTrigger.set(LowVoltageTrigger);

Here's the error:

WARNING: library EEPROM-Storage claims to run on particle-photon, particle-electron, avr architecture(s) and may be incompatible with your current board which runs on renesas_uno architecture(s).
In file included from /Users/xxxxxxxx/Library/CloudStorage/OneDrive-xxxxxxxx.com/Active/APU Control/APUResearch2/APUResearch2.ino:2:0:
/Users/xxxxxxxx/Documents/Arduino/libraries/EEPROM-Storage/src/EEPROM-Storage.h: In instantiation of 'void EEPROMStorage<T>::set(const T&) const [with T = float]':
/Users/xxxxxxxx/Library/CloudStorage/OneDrive-xxxxxxxx.com/Active/APU Control/APUResearch2/APUResearch2.ino:447:46:   required from here
/Users/xxxxxxxx/Documents/Arduino/libraries/EEPROM-Storage/src/EEPROM-Storage.h:273:7: error: passing 'const EEPROMStorage<float>' as 'this' argument discards qualifiers [-fpermissive]
       EEPROM.update(this->checksumAddress(), checksum);
       ^~~~~~
/Users/xxxxxxxx/Documents/Arduino/libraries/EEPROM-Storage/src/EEPROM-Storage.h:314:14: note:   in call to 'uint16_t EEPROMStorage<T>::checksumAddress() [with T = float; uint16_t = short unsigned int]'
     uint16_t checksumAddress()
              ^~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1
@TechSavvySam
Copy link
Author

TechSavvySam commented Jan 13, 2025

https://forum.arduino.cc/t/saving-object-reference/341145/6

I'm guessing maybe you've only compiled this for Particle, which is why it won't even compile for Arduino.

WARNING: library EEPROM-Storage claims to run on particle-photon, particle-electron, avr architecture(s) and may be incompatible with your current board which runs on renesas_uno architecture(s).

It doesn't seem there's a way in the Arduino cloud to report issues with libraries, so I guess it's up to each person to try it to see that it doesn't work.

If you update it soon, I'll be glad to test the update for you to see if it fixes the issue.

@porrey
Copy link
Owner

porrey commented Jan 14, 2025

The library was originally tested on an Uno and a Particle Photon. What board are you using? Looks like an Uno R4 Arm Cortex?

@porrey
Copy link
Owner

porrey commented Jan 14, 2025

I confirmed this is failing on the R4 board. I'll take a look at the code and try to fix it.

@porrey porrey self-assigned this Jan 15, 2025
porrey added a commit that referenced this issue Jan 15, 2025
@TechSavvySam
Copy link
Author

The library was originally tested on an Uno and a Particle Photon. What board are you using? Looks like an Uno R4 Arm Cortex?

Correct. Uno R4 WIFI

@TechSavvySam
Copy link
Author

TechSavvySam commented Jan 15, 2025

I confirmed this is failing on the R4 board. I'll take a look at the code and try to fix it.

Any idea when this update will show up on Arduino Cloud? I'm new to Arduino so I don't know how often Github updates flow to Arduino Cloud. I'd like to test it so I can get feedback to you quickly.

@porrey
Copy link
Owner

porrey commented Jan 15, 2025

I pushed a fix to the branch called v1.0.2. I do not have an Uno R4, but I did ensure it compiles. I reran my tests an a Mega and a Particle Photon and all tests passed.

@TechSavvySam
Copy link
Author

I pushed a fix to the branch called v1.0.2. I do not have an Uno R4, but I did ensure it compiles. I reran my tests an a Mega and a Particle Photon and all tests passed.

I just saw that. Let me download that to my local IDE and test it. Then if it works, I'll let you know and you should mark it as supporting the R4

@TechSavvySam
Copy link
Author

Thanks. I pulled v1.0.2 branch and tested on Arduino UNO R4 WiFi and it the code compiles and works.

@porrey
Copy link
Owner

porrey commented Jan 15, 2025

The code has been merged and released. The Arduino library manager should pick it up within 24 hours.

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

No branches or pull requests

2 participants