Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of cdms_rtos_summer_lite by
Revision 0:0e52cd8d26c8, committed 2015-06-08
- Comitter:
- pradeepvk2208
- Date:
- Mon Jun 08 10:51:30 2015 +0000
- Child:
- 1:d89391152298
- Commit message:
- high;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Jun 08 10:51:30 2015 +0000
@@ -0,0 +1,87 @@
+#include "mbed.h"
+#include "rtos.h"
+
+Serial pc(USBTX, USBRX);
+
+
+Thread *ptr_hk_bae;
+Thread *ptr_hk_cdms;
+Thread *ptr_hk_payload;
+
+Timer t1;
+
+
+
+void HK_BAE(void const *args)
+{
+ while(1)
+ {
+ Thread::signal_wait(0x1);
+ printf("Entered HK_BAE");
+ }
+}
+void HK_CDMS(void const *args)
+{
+ while(1)
+ {
+ Thread::signal_wait(0x2);
+ printf("Entered HK_CDMS");
+ }
+}
+void HK_PAYLOAD(void const *args)
+{
+ while(1)
+ {
+ Thread::signal_wait(0x3);
+ printf("Entered HK_PAYLOAD");
+ }
+}
+
+uint16_t schedcount=1;
+
+void T_SC(void const *args)
+{
+
+ printf("The value of i in scheduler is %d\n",schedcount);
+ if(schedcount == 65532) //to reset the counter
+ {
+ schedcount = 0;
+ }
+
+ if(schedcount%20==0)
+ {
+ ptr_hk_bae -> signal_set(0x1);
+ ptr_hk_cdms -> signal_set(0x2);
+ ptr_hk_payload -> signal_set(0x3);
+ }
+ schedcount++;
+}
+
+
+int main()
+{
+ ptr_hk_bae = new Thread (HK_BAE);
+ ptr_hk_cdms=new Thread (HK_CDMS);
+ ptr_hk_payload=new Thread (HK_PAYLOAD);
+
+ ptr_hk_bae->set_priority(osPriorityAboveNormal);
+ ptr_hk_cdms->set_priority(osPriorityHigh);
+ ptr_hk_payload->set_priority(osPriorityNormal);
+
+ printf("\n T_HK_BAE priority is %d",ptr_hk_bae->get_priority());
+ printf("\n T_HK_CDMS priority is %d",ptr_hk_cdms->get_priority());
+ printf("\n T_HK_PAYLOAD priority is %d",ptr_hk_payload->get_priority());
+
+ RtosTimer t_sc_timer(T_SC,osTimerPeriodic);
+ t_sc_timer.start(1000);
+
+ while(1)
+ {
+ Thread::wait(5000);
+ }
+
+
+
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Mon Jun 08 10:51:30 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#e45e4ac7c3c8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jun 08 10:51:30 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cbbeb26dbd92 \ No newline at end of file
