* don't load the controller unit if the currently compiled unit *is* the controller unit (which might happen if one compiles the controller unit as part of a program)

This commit is contained in:
Sven/Sarah Barth 2022-06-15 22:49:22 +02:00
parent d8196a6ffe
commit c3f27a2f1c

View File

@ -410,7 +410,8 @@ implementation
{ CPU targets with microcontroller support can add a controller specific unit }
if ControllerSupport and (target_info.system in (systems_embedded+systems_freertos)) and
(current_settings.controllertype<>ct_none) and
(embedded_controllers[current_settings.controllertype].controllerunitstr<>'') then
(embedded_controllers[current_settings.controllertype].controllerunitstr<>'') and
(embedded_controllers[current_settings.controllertype].controllerunitstr<>current_module.modulename^) then
AddUnit(embedded_controllers[current_settings.controllertype].controllerunitstr);
{$pop}
{$ifdef XTENSA}