-
Notifications
You must be signed in to change notification settings - Fork 2
Library compile error when using Arduino CI #2
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
Comments
I think this may be related to Arduino CI #120. I've been able to work around the problem with some code proposed there. |
Looks like fun. The bug in my code is likely here: https://github.com/Arduino-CI/arduino_ci/blob/master/cpp/arduino/avr/io.h#L99 #define _SFR_IO8(io_addr) (io_addr) // this macro is all we need from the sfr file
#define DDRE _SFR_IO8(0x0D) Which results in my implementation produces this nonsense for According to this forum post that should really be based on these 2 macros: #define _MMIO_BYTE(mem_addr) (*(volatile uint8_t *)(mem_addr))
#define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) + __SFR_OFFSET) So my initial thought is that this can be fixed with some type of cast, possibly involving a reference to a statically-allocated array. I'll have to think more about that, and definitely add a unit test to prevent regressing it. |
Just to be clear here, was this issue supposed to be opened against SD and not |
I started here because I wasn't sure where the problem was and because I thought that even if the problem was in |
Seems to be working fine with 0.4.0. |
The command
bundle exec arduino_ci_remote.rb --skip-unittests
shows that all the examples compile fine in the Arduino IDE. But when I runbundle exec arduino_ci_remote.rb --skip-compilation
I geterror: cannot take the address of an rvalue of type 'int'
(see below).DDRE
comes from#define DDRE _SFR_IO8(0x0D)
which uses#define _SFR_IO8(io_addr) (io_addr)
. So, it appears that the code is trying to do something likevolatile uint8_t* ddr = &0x0D;
,which does seem odd. Perhaps 0x0D is supposed to be an address?
@ianfixes, @per1234, do you have any advice?
Note that this is where I ran into #186.
The text was updated successfully, but these errors were encountered: