var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Event = xdc.useModule("ti.sysbios.knl.Event");
var GPIO = xdc.useModule('ti.drivers.GPIO');
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
//var Ndk = xdc.loadPackage('ti.ndk.config');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
//var DhcpClient = xdc.useModule('ti.ndk.config.DhcpClient');
var GateHwi = xdc.useModule('ti.sysbios.gates.GateHwi');
var GateSwi = xdc.useModule('ti.sysbios.gates.GateSwi');
var GateTask = xdc.useModule('ti.sysbios.gates.GateTask');
var Timer = xdc.useModule('ti.sysbios.hal.Timer');

/*
 * Uncomment this line to globally disable Asserts.
 * All modules inherit the default from the 'Defaults' module.  You
 * can override these defaults on a per-module basis using Module.common$.
 * Disabling Asserts will save code space and improve runtime performance.
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
 */

/*
 * Uncomment this line to keep module names from being loaded on the target.
 * The module name strings are placed in the .const section. Setting this
 * parameter to false will save space in the .const section.  Error and
 * Assert messages will contain an "unknown module" prefix instead
 * of the actual module name.
Defaults.common$.namedModule = false;
 */

/*
 * Minimize exit handler array in System.  The System module includes
 * an array of functions that are registered with System_atexit() to be
 * called by System_exit().
 */
///////System.maxAtexitHandlers = 4;

/*
 * Uncomment this line to disable the Error print function.
 * We lose error information when this is disabled since the errors are
 * not printed.  Disabling the raiseHook will save some code space if
 * your app is not using System_printf() since the Error_print() function
 * calls System_printf().
Error.raiseHook = null;
 */

/*
 * Uncomment this line to keep Error, Assert, and Log strings from being
 * loaded on the target.  These strings are placed in the .const section.
 * Setting this parameter to false will save space in the .const section.
 * Error, Assert and Log message will print raw ids and args instead of
 * a formatted message.
Text.isLoaded = false;
 */

/*
 * Uncomment this line to disable the output of characters by SysMin
 * when the program exits.  SysMin writes characters to a circular buffer.
 * This buffer can be viewed using the SysMin Output view in ROV.
SysMin.flushAtExit = false;
 */

/*
 * The BIOS module will create the default heap for the system.
 * Specify the size of this default heap.
 */
BIOS.heapSize = 65535;  // 48KB

/*
 * Build a custom SYS/BIOS library from sources.
 */
BIOS.libType = BIOS.LibType_Custom;
//want more debug?
//BIOS.libType = BIOS.LibType_Instrumented;

/* System stack size (used by ISRs and Swis) */
Program.stack = 8192;

/* Circular buffer size for System_printf() */
////////SysMin.bufSize = 0x200;


System.SupportProxy = SysMin;
System.extendedFormats = '%$L%$S%$F%f';
Clock.tickPeriod = 50;
GPIO.libType = GPIO.LibType_NonInstrumented;
Task.idleTaskStackSize = 768;

// app::
// WARNING --> 	Any modifications to the reset vector address need to get propogated to 
//				the bootloader linker file, the app linker file, and the bpp.h #defines 
//				related to flash address start points
//
ti_sysbios_family_arm_m3_Hwi.resetVectorAddress = 0x00040000;
// app::
// <-- WARNING  Any modifications to the reset vector address need to get propogated to 
//				the bootloader linker file, the app linker file, and the bpp.h #defines 
//				related to flash address start points
//



var ti_sysbios_family_arm_m3_Hwi0Params = new ti_sysbios_family_arm_m3_Hwi.Params();
ti_sysbios_family_arm_m3_Hwi0Params.instance.name = "ti_sysbios_family_arm_m3_Hwi0";
Program.global.ti_sysbios_family_arm_m3_Hwi0 = ti_sysbios_family_arm_m3_Hwi.create(15, "&WatchdogIntHandler", ti_sysbios_family_arm_m3_Hwi0Params);
SysMin.bufSize = 2048;
