]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/mulle/chips/at45db/HplAt45dbP.nc
Added support for BLIP on Mulle.
[tinyos-2.x.git] / tos / platforms / mulle / chips / at45db / HplAt45dbP.nc
index 021e16674eecdc8d57bc63cdcc017b97c10e0f9f..dfa681b1c81ef9d8987027882f4e764648517eab 100644 (file)
@@ -69,7 +69,8 @@
  *
  * @author Henrik Makitaavola <henrik.makitaavola@gmail.com>
  */
-
+#include "m16c62p_printf.h"
 module HplAt45dbP
 {
   provides
@@ -89,11 +90,19 @@ module HplAt45dbP
 }
 implementation
 {
+  // TODO(Henrik) Move init code to a SplitControl interface and
+  //              change the busy wait into a TimerMilli.startOneShot.
   command error_t Init.init() {
+       call WP.makeOutput();
+       call WP.set();
+       call RESET.makeOutput();
+       call RESET.set();
     call Select.makeOutput();
     call Select.set();
     call VCC.makeOutput();
     call VCC.clr();
+       // The device needs 20ms before is accepts a write.
+       call BusyWait.wait(20000);
     return SUCCESS;
   }