Repository navigation
Open
Description
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
Reacted by kimstik
Metadata
Metadata
Assignees
Labels
No labels
Activity
terjeio commentedon Oct 3, 2024
See the readme IMPORTANT notice.
engeen-nl commentedon Oct 3, 2024
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.
Santi24Yt commentedon Nov 4, 2025
What dependencies could you be referring to?
I've changed the property name and it works for me but I have a very basic usage so it might not work for everyone else, I'm willing to make a pull request of what you suggest and other fixes if they are needed, it would be of great help if you could explain what do you mean by dependencies, you mean the git submodules?
Santi24Yt commentedon Nov 4, 2025
I forgot to mention, I did change it but also in all the submodules, hence my question if there might be other dependencies I might not be aware of
leouzz commentedon Mar 29, 2026
Confirmed resolved without changing either grblHAL or the SAMD core source.
The issue was a naming conflict on
synchronizedwith Arduino SAMD1.8.14(macro defined in the core).I fixed it by using Arduino SAMD
1.8.9; with that version, compile/upload works correctly.Santi24Yt commentedon Mar 31, 2026
Yes, it can be solved reverting to an old version, but it would be better to fix the core, supposedly it is a really simple fix