-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
pgm_read_float_unaligned()
ignores the second word
#8083
Comments
Do you intend to propose a Pull-Request ? |
@d-a-v :
perhaps if an agreement is formed; there may be some meaning that I don't know in the current behavior :) |
@d-a-v I was almost going to do that yesterday, but I'm fairly certain that Also, maybe doubles need to be considered, too?
|
@earlephilhower By the way, my IDE has in option "13" |
@dok-net :
https://github.com/earlephilhower/newlib-xtensa is more appropriate
like as below, if use of
this emits about 15 or 16 machine insns, thus it may not be inlining |
I don't think so; here's a naive patch, anyway. Please review thoroughly on your own schedule:
|
There is no I'll update newlib and throw out a new toolchain build w/the fix. |
And output
|
Was only reading out 16 bits worth of data, not 32, and corrupting the output. See esp8266/Arduino#8083
LGTM, thx @earlephilhower |
I beg to differ: mattairtech/ArduinoCore-samd@8b7398d :
Edit: OK, sorry, too fast, this of course is just another person's fork. ... Still researching.... |
@devyte You keep referring to SAMD Arduino for 32bit etc matters, can you give an opinion on |
The Arduino API (such as it is) does not have such a macro: |
I know, but why care about AVR on the ESPs, as I suggested, @devyte refers to SAMD in situations like this and I think that is appropriate. Why not further the state of the art, this ESP8266 core is compatible, a superset anyway, why restrict ourselves and the users, just while you are at it already? |
@earlephilhower It's a matter of need so far. On ATMEGA, sizeof(double) == sizeof(float) == 4. On the Due specifically, it's sizeof(double) == 8, but the Due apparently doesn't have alignment restrictions. So on the ESP there's sizeof(double) == 8, and alignment restrictions, don't you think that the |
The point was that it seems that the whole pgm_read_XXX stuff is deprecated since Arduino is moving forward w/Cortex chips which all can read from flash just fine w/o special magic. AVRs are Harvard architecture so need different instructions to read from flash vs. RAM. The Xeon's already paid for, though, so WTH. Fired off another build and will up the new tools JSON.
|
Update toolchain to fix pgm_read_float_unaligned Fixes #8083
Basic Infos
Platform
Settings in IDE
Problem Description
pgm_read_float_unaligned()
in 'tools/xtensa-lx106-elf/xtensa-lx106-elf/include/sys/pgmspace.h' should usepgm_read_dword_with_offset()
instead ofpgm_read_with_offset()
, as perpgm_read_dword_unaligned()
.MCVE Sketch
Debug Messages
With the abovementioned way,
The text was updated successfully, but these errors were encountered: