]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/tosboot/avr/ProgFlashM.nc
Proper MSP_BSL_FLAGS for telosa and telosb based platforms using TMI modular tos...
[tinyos-2.x.git] / tos / lib / tosboot / avr / ProgFlashM.nc
index 8bada2d6757a84d3150623489f7706865537389d..898ebc64888daa24ba9f8a0a65d5d5c411781638 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 
-/*                                                                     tab:2
+/*
  *
  *
  * "Copyright (c) 2000-2005 The Regents of the University  of California.  
@@ -36,7 +36,7 @@ module ProgFlashM {
 
 implementation {
 
-#include <boot.h>
+#include <avr/boot.h>
 
   command error_t ProgFlash.write(in_flash_addr_t addr, uint8_t* buf, in_flash_addr_t len) {
 
@@ -46,17 +46,17 @@ implementation {
     if ( addr + len > TOSBOOT_START )
       return FAIL;    
 
-    boot_page_erase( addr );
+    boot_page_erase_safe( addr );
     while( boot_rww_busy() )
-      boot_rww_enable();
+      boot_rww_enable_safe();
     
     for ( i = 0; i < len; i += 2 )
-      boot_page_fill( addr + i, *wordBuf++ );
+      boot_page_fill_safe( addr + i, *wordBuf++ );
 
-    boot_page_write( addr );
+    boot_page_write_safe( addr );
     
     while ( boot_rww_busy() )
-      boot_rww_enable();
+      boot_rww_enable_safe();
     
     return SUCCESS;