Bläddra i källkod

+ define macros with information about the memory sizes of a MCU: FPC_FLASHBASE, FPC_FLASHSIZE, FPC_SRAMBASE, FPC_SRAMSIZE, FPC_EEPROMBASE, FPC_EEPROMSIZE, FPC_BOOTBASE, FPC_BOOTSIZE, resolves issue #29365

git-svn-id: trunk@33236 -
florian 9 år sedan
förälder
incheckning
4e64fe77ac
1 ändrade filer med 17 tillägg och 0 borttagningar
  1. 17 0
      compiler/options.pas

+ 17 - 0
compiler/options.pas

@@ -4027,6 +4027,23 @@ if (target_info.abi = abi_eabihf) then
   for i:=low(tfeature) to high(tfeature) do
     if i in features then
       def_system_macro('FPC_HAS_FEATURE_'+featurestr[i]);
+
+   if ControllerSupport and (target_info.system in systems_embedded) and
+     (init_settings.controllertype<>ct_none) then
+     begin
+       with embedded_controllers[init_settings.controllertype] do
+         begin
+           set_system_macro('FPC_FLASHBASE',tostr(flashbase));
+           set_system_macro('FPC_FLASHSIZE',tostr(flashsize));
+           set_system_macro('FPC_SRAMBASE',tostr(srambase));
+           set_system_macro('FPC_SRAMSIZE',tostr(sramsize));
+           set_system_macro('FPC_EEPROMBASE',tostr(eeprombase));
+           set_system_macro('FPC_EEPROMSIZE',tostr(eepromsize));
+           set_system_macro('FPC_BOOTBASE',tostr(bootbase));
+           set_system_macro('FPC_BOOTSIZE',tostr(bootsize));
+         end;
+     end;
+
   option.free;
   Option:=nil;