| var Msgs = xdc.useModule("local.apps.hello_2.Msgs"); |
| |
| /* minimize footprint for MSP430 targets */ |
| if (Program.cpu.deviceName.match(/MSP430/)) { |
| /* use the LoggerUart ILogger service provider */ |
| var Logger = xdc.useModule("local.runtime.LoggerUart"); |
| |
| print("optimizing footprint for the MSP430 ..."); |
| Program.argSize = 0; /* don't need arc/argv support */ |
| Program.stack = 0x100; /* don't need much stack for this app */ |
| Program.heap = 0; /* don't need a heap from the runtime */ |
| |
| /* use SysUart to eliminate buffers used by SysMin/SysStd */ |
| var SysUart = xdc.useModule("local.runtime.SysUart"); |
| var System = xdc.useModule("xdc.runtime.System"); |
| System.SupportProxy = SysUart; |
| System.maxAtexitHandlers = 0; /* save 20B RAM; don't need atexit() */ |
| |
| /* set STATIC_POLICY, runtime creation support/overhead is eliminated */ |
| var Types = xdc.useModule('xdc.runtime.Types'); |
| var Defaults = xdc.useModule("xdc.runtime.Defaults"); |
| Defaults.common$.memoryPolicy = Types.STATIC_POLICY; |
| Defaults.common$.fxntab = false; |
| |
| /* the following saves almost 1KB of FLASH (strings are eliminated) */ |
| var Text = xdc.useModule("xdc.runtime.Text"); |
| Text.isLoaded = false; |
| } |
| else { |
| /* use the LoggerSys ILogger service provider */ |
| var Logger = xdc.useModule("xdc.runtime.LoggerSys"); |
| } |
| |
| /* create and bind a logger for all non-module code */ |
| var Main = xdc.useModule("xdc.runtime.Main"); |
| var Diags = xdc.useModule("xdc.runtime.Diags"); |
| Main.common$.logger = Logger.create(); |
| Main.common$.diags_ENTRY = Diags.ALWAYS_ON; |