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

Conflict with the latest arduino toolset for SAMD21 'synchronized' keyword #4

Open
engeen-nl opened this issue Oct 1, 2024 · 2 comments

Comments

@engeen-nl
Copy link

engeen-nl commented Oct 1, 2024

Conflict with the latest arduino toolset for SAMD21 'synchronized' keyword:

c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c: In function 'driver_init':
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c:1098:20: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
     hal.get_micros = micros;
                    ^
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c:1131:5: warning: implicit declaration of function 'my_plugin_init'; did you mean '__lock_init'? [-Wimplicit-function-declaration]
     my_plugin_init();
     ^~~~~~~~~~~~~~
     __lock_init
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c: In function 'STEPPER_IRQHandler':
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c:1143:5: warning: assignment of read-only location '1107308544->COUNT32.INTFLAG.bit.MC0'
     STEPPER_TIMER->COUNT32.INTFLAG.bit.MC0 = 1;
     ^~~~~~~~~~~~~
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c: In function 'STEPPULSE_IRQHandler':
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c:1150:5: warning: assignment of read-only location '1107307520->COUNT16.INTFLAG.bit.MC0'
     STEP_TIMER->COUNT16.INTFLAG.bit.MC0 = 1;
     ^~~~~~~~~~
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c: In function 'STEPPULSE_Delayed_IRQHandler':
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c:1157:5: warning: assignment of read-only location '1107307520->COUNT16.INTFLAG.bit.MC0'
     STEP_TIMER->COUNT16.INTFLAG.bit.MC0 = 1;
     ^~~~~~~~~~
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c: In function 'DEBOUNCE_IRQHandler':
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\driver.c:1172:5: warning: assignment of read-only location '1107305472->INTFLAG.bit.OVF'
     DEBOUNCE_TIMER->INTFLAG.bit.OVF = 1;
     ^~~~~~~~~~~~~~
In file included from C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/SafeRingBuffer.h:25:0,
                 from C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Uart.h:23,
                 from C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\variants\mkrwan1300/variant.h:158,
                 from C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Arduino.h:51,
                 from c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\usb_serial.cpp:26:
C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/sync.h:28:22: error: expected unqualified-id before 'for'
 #define synchronized for (__Guard __guard; __guard.enter(); )
                      ^
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\grbl/spindle_control.h:70:17: note: in expansion of macro 'synchronized'
                 synchronized     :1;
                 ^~~~~~~~~~~~
C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/sync.h:28:44: error: '__guard' does not name a type; did you mean '__Guard'?
 #define synchronized for (__Guard __guard; __guard.enter(); )
                                            ^
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\grbl/spindle_control.h:70:17: note: in expansion of macro 'synchronized'
                 synchronized     :1;
                 ^~~~~~~~~~~~
C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/sync.h:28:61: error: expected unqualified-id before ')' token
 #define synchronized for (__Guard __guard; __guard.enter(); )
                                                             ^
c:\Users\Peter\Nextcloud\Projects\Arduino\libraries\grblHAL_MKRZERO\src\grbl/spindle_control.h:70:17: note: in expansion of macro 'synchronized'
                 synchronized     :1;
                 ^~~~~~~~~~~~

Could we please rename synchronized to issynchronized?

See also terjeio/grblHAL#224

@terjeio terjeio transferred this issue from grblHAL/core Oct 2, 2024
@terjeio
Copy link
Contributor

terjeio commented Oct 3, 2024

See the readme IMPORTANT notice.

@engeen-nl
Copy link
Author

Noted before, just wanted to provide a workaround for those who want to use the latest build tools. We want to go forward.

As you wrote, the solution is in the core. Would changing the property name to "isSynchronized" break any dependencies?

Alternatively you can use #ifdef ARDUINO to change the name only for arduino builds. But all dependencies still need the same name change too.

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