[Tinyos-beta-commits] CVS: tinyos-1.x/beta/AT45DB/tests FMakefile, NONE, 1.1 FormatC.nc, NONE, 1.1 FormatM.nc, NONE, 1.1 RandRW.nc, 1.2, 1.3

David Gay idgay at users.sourceforge.net
Wed Jun 8 14:44:25 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/AT45DB/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25696

Modified Files:
	RandRW.nc 
Added Files:
	FMakefile FormatC.nc FormatM.nc 
Log Message:
storage table tests


--- NEW FILE: FMakefile ---
COMPONENT=FormatC
PFLAGS += -I..
include $(MAKERULES)


--- NEW FILE: FormatC.nc ---
configuration FormatC { }
implementation {
  components Main, FormatM, FormatStorageC, LedsC;

  Main.StdControl -> FormatM;
  FormatM.FormatStorage -> FormatStorageC;
  FormatM.Leds -> LedsC;
}

--- NEW FILE: FormatM.nc ---
module FormatM {
  provides interface StdControl;
  uses {
    interface Leds;
    interface FormatStorage;
  }
}
implementation {
  command result_t StdControl.init() {
    call Leds.init();
    return SUCCESS;
  }

  void rcheck(result_t ok) {
    if (ok == FAIL)
      call Leds.redOn();
  }

  command result_t StdControl.start() {
    call Leds.yellowOn();

    call FormatStorage.init();

    rcheck(call FormatStorage.allocateFixed(11, 0, 256));
    rcheck(!call FormatStorage.allocateFixed(22, 65536L, 1025));
    rcheck(!call FormatStorage.allocateFixed(22, 65534L, 1024));
    rcheck(call FormatStorage.allocateFixed(22, 65536L, 1024));
    rcheck(call FormatStorage.allocateFixed(12, 1024, 32768L));
    rcheck(call FormatStorage.allocate(1, 262144L));
    rcheck(!call FormatStorage.allocate(2, 262144L));
    rcheck(!call FormatStorage.allocate(1, 256));
    rcheck(call FormatStorage.commit());

    return SUCCESS;
  }

  command result_t StdControl.stop() {
    return SUCCESS;
  }

  event void FormatStorage.commitDone(storage_result_t result) {
    if (result == STORAGE_OK)
      call Leds.greenOn();
    else
      call Leds.redOn();
  }
}

Index: RandRW.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/AT45DB/tests/RandRW.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RandRW.nc	7 Jun 2005 16:58:33 -0000	1.2
--- RandRW.nc	8 Jun 2005 21:44:23 -0000	1.3
***************
*** 96,100 ****
    command result_t StdControl.start() {
      state = S_MOUNT;
!     rcheck(call Mount.mount(0));
      return SUCCESS;
    }
--- 96,100 ----
    command result_t StdControl.start() {
      state = S_MOUNT;
!     rcheck(call Mount.mount(1));
      return SUCCESS;
    }



More information about the Tinyos-beta-commits mailing list