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 BAE_vr2_1_4 by
Diff: main.cpp
- Revision:
- 2:7aede71f4c22
- Parent:
- 1:bd715ccef1bb
diff -r bd715ccef1bb -r 7aede71f4c22 main.cpp
--- a/main.cpp Wed Dec 17 09:18:36 2014 +0000
+++ b/main.cpp Wed Dec 17 09:46:36 2014 +0000
@@ -24,7 +24,7 @@
//Thread *ptr_t_bea_telecommand;
//Thread *ptr_t_fault;
Thread *ptr_t_i2c;
-
+Thread *ptr_t_wdt;
@@ -219,6 +219,20 @@
}
}
*/
+/*-------------------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------WATCHDOG----------------------------------------------------------------------------*/
+DigitalOut trigger(PIN63); // has to be changed
+void T_WDT(void const * args)
+{
+ trigger = 1;
+ while(true)
+ {
+ Thread::signal_wait(0x5); //signal set from scheduler or sthing. r RTOS timer nce the timing is finalized
+ printf("\nEntered WD\n");
+ trigger = !trigger;
+ }
+}
+
//---------------------------------------------------------------------------------------------------------------------------------------------------
//TASK 5 : i2c data
//---------------------------------------------------------------------------------------------------------------------------------------------------
@@ -300,6 +314,7 @@
}
}
+
printf("\ndone\n\r");
}
@@ -419,6 +434,7 @@
if(schedcount%1==0)
{
ptr_t_acs -> signal_set(0x1);
+ ptr_t_wdt -> signal_set(0x5);
}
if(schedcount%2==0)
{
@@ -451,6 +467,7 @@
//ptr_t_fault = new Thread(T_FAULT);
ptr_t_i2c = new Thread(C_T_I2C_BAE);
//ptr_t_sc = new Thread(t_sc);
+ ptr_t_wdt = new Thread(T_WDT);
interrupt_fault();
@@ -462,6 +479,7 @@
ptr_t_bea->set_priority(osPriorityAboveNormal);
//ptr_t_bea_telecommand->set_priority(osPriorityIdle);
//ptr_t_sc->set_priority(osPriorityAboveNormal);
+ ptr_t_wdt -> set_priority(osPriorityIdle);
// ----------------------------------------------------------------------------------------------
