OIL_VERSION = "2.5";

IMPLEMENTATION trampoline {

    /* This fix the default STACKSIZE of tasks */
    TASK {
        UINT32 STACKSIZE = 300 ;
    } ;

    /* This fix the default STACKSIZE of ISRs */
    ISR {
        UINT32 STACKSIZE = 200 ;
    } ;
};

CPU readbutton {
  OS config {
    STATUS = EXTENDED;
	CPU_FREQ_MHZ = 8;
    
    BUILD = TRUE {
      TRAMPOLINE_BASE_PATH = "../../../../../..";
      APP_SRC = "readbutton.c";
      APP_NAME = "readbutton_exe";
      CFLAGS  = "-O0 -g3 -gdwarf-2 -ggdb"; //gdb usage
      LDFLAGS = "-Map=readbutton.map";
      //use either msp-gcc (provided with Energia)..
      // COMPILER  = "msp430-gcc";
      // ASSEMBLER = "msp430-gcc";
      // LINKER    = "msp430-ld";
      // COPIER    = "msp430-objcopy";
      //or GCC for MSP (provided by TI)
      COMPILER  = "msp430-elf-gcc";
      ASSEMBLER = "msp430-elf-gcc";
      LINKER    = "msp430-elf-ld";
      COPIER    = "msp430-elf-objcopy";
      SYSTEM = PYTHON;
    };
    SYSTEM_CALL = TRUE;
    MEMMAP = TRUE {
      COMPILER = gcc;
      LINKER = gnu_ld { SCRIPT = "script.ld"; };
      ASSEMBLER = gnu_as;
      MEMORY_PROTECTION = FALSE;
    };
  };
  
  APPMODE std {};
  
  TASK read_button {
    PRIORITY = 2;
    AUTOSTART = FALSE;
    ACTIVATION = 1;
    SCHEDULE = FULL;
  };

  ALARM read_button_alarm {
    COUNTER = SystemCounter;
    ACTION = ACTIVATETASK {
      TASK = read_button;
    };
    AUTOSTART = TRUE {
      APPMODE = std;
      ALARMTIME = 50;
      CYCLETIME = 50;
    };                                                                      
  };   
  
  TASK blink {
    PRIORITY = 1;
    AUTOSTART = FALSE;
    ACTIVATION = 1;
    SCHEDULE = FULL;
  };
  
  ALARM blink_alarm {
    COUNTER = SystemCounter;
    ACTION = ACTIVATETASK {
      TASK = blink;
    };
    AUTOSTART = TRUE {
      APPMODE = std;
      ALARMTIME = 100;
      CYCLETIME = 100;
    };                                                                      
  };
};