Closed chalojak closed 2 years ago
As a temporary workaround you can change type of intpart, intpart1 and intpart2 from float to double.
Sorry, this is a known bug currently, and we're working on it to fix it. Please use the 2.0 release version for the moment.
Hm, strange, I just tried to compile for the Due (with VSCode) and standard _config.h and it compiled without errors. Did you change something already, @dukess?
Nope. This may be a specificity of Arduino Studio compiler/library.
Nope. This may be a specificity of Arduino Studio compiler/library.
I confirm that I could compile the v2.0 without an error, but it occurred in the v2.1 in the same compiler.
út 30. 8. 2022 v 15:13 odesílatel Serguei S. Dukachev < @.***> napsal:
Nope. This may be a specificity of Arduino Studio compiler/library.
— Reply to this email directly, view it on GitHub https://github.com/fredlcore/BSB-LAN/issues/477#issuecomment-1231650413, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKR7VPOFHEZIYJW7ZSNRSRDV3YCGVANCNFSM6AAAAAAQAKOSWQ . You are receiving this because you authored the thread.Message ID: @.***>
Yes, we have added a function call that works perfectly fine in our development environment, but we're not using Arduino IDE. The cmath library looks the same on both environments, so it must be compiler specific. @dukess: Is it safe to just change all intpart* variables from float to double? Then I can do that quickly.
We can add definitions:
#if defined(__SAM3X8E__)
double intpart;
#else
float intpart;
#endif
Should be fixed now with @dukess' latest changes in code. Please check if it now works, @chalojak and reopen the issue if the problem still persists.
Yepp, now it works! :) Great - thanks!
Yes, I confirm that it works too. Thanks for the prompt support and amazing project!
BSB-LAN Version 2.1 - 30.07.2022
Architecture Arduino Due
Bus system NA
Describe the bug Arduino does compile the code and returns an error, see below.
Logs `Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Due (Programming Port)"
In file included from C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\BSB_LAN.ino:1202:0:
C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\include\get_cmdtbl_values.h: In function 'float get_next_prognr(float, int)':
C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\include\get_cmdtbl_values.h:59:33: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
In file included from C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\BSB_LAN.ino:1202:0:
C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\include\get_cmdtbl_values.h:78:27: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\include\get_cmdtbl_values.h:79:31: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\include\get_cmdtbl_values.h:85:37: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
C:\Users\jakub.chaloupka\Downloads\BSB-LAN-master\BSB_LAN\BSB_LAN.ino: In function 'int findLine(float, uint16_t, uint32_t*)':
BSB_LAN:1280:49: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
BSB_LAN:1284:71: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
BSB_LAN:1290:47: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
BSB_LAN:1300:50: error: cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'
exit status 1
cannot convert 'float' to 'double' for argument '2' to 'double modf(double, double*)'`
Additional context Add any other context about the problem here.