]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerC.nc
Fix the Deluge rollback gesture and increase the total number of Deluge images to...
[tinyos-2.x.git] / tos / lib / net / Deluge / FlashVolumeManager / FlashVolumeManagerC.nc
index f05d8310aae5f05a8873572eff6ec62cc5a7e814..7ef0c385ac711e4c81d07b211793ecfe3a8ead59 100644 (file)
  */
 
 #include "AM.h"
+#include "StorageVolumes.h"
 
 generic configuration FlashVolumeManagerC(am_id_t AMId)
 {
 #ifdef DELUGE  
-  provides interface Notify<uint8_t>;
+  provides interface Notify<uint8_t> as DissNotify;
+  provides interface Notify<uint8_t> as ReprogNotify;
 #endif
   uses {
     interface BlockRead[uint8_t img_num];
     interface BlockWrite[uint8_t img_num];
+#ifdef DELUGE
     interface DelugeStorage[uint8_t img_num];
+#endif
   }
 }
 
@@ -45,21 +49,29 @@ implementation
              new FlashVolumeManagerP(),
              NoLedsC, LedsC;
   
-  FlashVolumeManagerP.BlockRead[0] = BlockRead[0];
-  FlashVolumeManagerP.BlockWrite[0] = BlockWrite[0];
-  FlashVolumeManagerP.DelugeStorage[0] = DelugeStorage[0];
-  FlashVolumeManagerP.BlockRead[1] = BlockRead[1];
-  FlashVolumeManagerP.BlockWrite[1] = BlockWrite[1];
-  FlashVolumeManagerP.DelugeStorage[1] = DelugeStorage[1];
+  FlashVolumeManagerP.BlockRead[VOLUME_GOLDENIMAGE] = BlockRead[VOLUME_GOLDENIMAGE];
+  FlashVolumeManagerP.BlockWrite[VOLUME_GOLDENIMAGE] = BlockWrite[VOLUME_GOLDENIMAGE];
+  FlashVolumeManagerP.BlockRead[VOLUME_DELUGE1] = BlockRead[VOLUME_DELUGE1];
+  FlashVolumeManagerP.BlockWrite[VOLUME_DELUGE1] = BlockWrite[VOLUME_DELUGE1];
+  FlashVolumeManagerP.BlockRead[VOLUME_DELUGE2] = BlockRead[VOLUME_DELUGE2];
+  FlashVolumeManagerP.BlockWrite[VOLUME_DELUGE2] = BlockWrite[VOLUME_DELUGE2];
+  FlashVolumeManagerP.BlockRead[VOLUME_DELUGE3] = BlockRead[VOLUME_DELUGE3];
+  FlashVolumeManagerP.BlockWrite[VOLUME_DELUGE3] = BlockWrite[VOLUME_DELUGE3];
   FlashVolumeManagerP.SerialAMSender -> SerialAMSenderC;
   FlashVolumeManagerP.SerialAMReceiver -> SerialAMReceiverC;
-  FlashVolumeManagerP.Leds -> LedsC;
+  FlashVolumeManagerP.Leds -> NoLedsC;
 
 #ifdef DELUGE  
   components NetProgC, new TimerMilliC();
+  
   FlashVolumeManagerP.NetProg -> NetProgC;
   FlashVolumeManagerP.Timer -> TimerMilliC;
-  
-  Notify = FlashVolumeManagerP.Notify;
+  FlashVolumeManagerP.DelugeStorage[VOLUME_GOLDENIMAGE] = DelugeStorage[VOLUME_GOLDENIMAGE];
+  FlashVolumeManagerP.DelugeStorage[VOLUME_DELUGE1] = DelugeStorage[VOLUME_DELUGE1];
+  FlashVolumeManagerP.DelugeStorage[VOLUME_DELUGE2] = DelugeStorage[VOLUME_DELUGE2];
+  FlashVolumeManagerP.DelugeStorage[VOLUME_DELUGE3] = DelugeStorage[VOLUME_DELUGE3];
+  DissNotify = FlashVolumeManagerP.DissNotify;
+  ReprogNotify = FlashVolumeManagerP.ReprogNotify;
 #endif
 }