hkstore

Dependencies:   SDFileSystem mbed-rtos mbed

Fork of rtcfinalcodeyuppie by Pradeep Kotipalli

Revision:
6:ee97f01e6b7d
Parent:
5:3979ca24777a
--- a/main.cpp	Tue Feb 03 17:10:21 2015 +0000
+++ b/main.cpp	Thu Feb 05 22:32:29 2015 +0000
@@ -1,12 +1,73 @@
-#include "rtsc.h"
+#include "mbed.h"
+#include "rtos.h"
+#include "hk.h"
+ 
+InterruptIn data_ready(D10);
+InterruptIn data_ready1(D6);
+int init=0;
+char data_receive[25];
+
+
+
+Thread * ptr_t_hk;
+Thread * ptr_t_i2c1;
+
+
+void FUNC_HK_DATA()
+{
+    storedata(data_receive,25);
+}
+void FUNC_SCIENCE_DATA()
+{
+    printf("Saved Science in SD");
+}
+
+void T_I2C_HK(void const *args)
+{
+      
+      while(1)
+    {
+        Thread::signal_wait(0x1);
+        FUNC_HK_DATA();
+    }
+}
+
+void T_I2C_MASTER_FSLAVE1(void const *args)
+{
+      while(1)
+    {
+        Thread::signal_wait(0x2);
+        FUNC_SCIENCE_DATA();
+    }
+}
+void FUNC_INT()
+{
+  
+   ptr_t_hk->signal_set(0x1);
+     
+}
+void FUNC_INT1()
+{
+  
+   ptr_t_i2c1->signal_set(0x2);
+     
+}
+
+
+int main()
+
+{
+    if(init==0)
+    {
+        init_rtc();
+        init++;
+    }
+    ptr_t_hk = new Thread (T_I2C_HK);
+    data_ready.rise(&FUNC_INT);
+    ptr_t_i2c1= new Thread (T_I2C_MASTER_FSLAVE1);
+    data_ready1.rise(&FUNC_INT1);
+}
 
 
 
 
-int main() 
-{
- 
-    storedata();
-}
-    
-   
\ No newline at end of file