![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
bae integrated final (may be)
Fork of BAE_FRDMTESIN2 by
main.cpp@8:667fbc82d634, 2014-12-15 (annotated)
- Committer:
- greenroshks
- Date:
- Mon Dec 15 05:58:23 2014 +0000
- Revision:
- 8:667fbc82d634
- Parent:
- 7:f06840d848e3
BAE FINAL INTEGRATED (may be)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
greenroshks | 0:8b0d43fe6c05 | 1 | #include "mbed.h" |
greenroshks | 0:8b0d43fe6c05 | 2 | #include "rtos.h" |
greenroshks | 0:8b0d43fe6c05 | 3 | #include "HK.h" |
greenroshks | 0:8b0d43fe6c05 | 4 | #include "slave.h" |
greenroshks | 0:8b0d43fe6c05 | 5 | #include "beacon.h" |
greenroshks | 0:8b0d43fe6c05 | 6 | #include "ACS.h" |
sakthipriya | 2:80b8a2e999f7 | 7 | #include "fault.h" |
greenroshks | 0:8b0d43fe6c05 | 8 | |
greenroshks | 8:667fbc82d634 | 9 | #define DEFAULT_POW_MODE 0 //power mode initialization |
greenroshks | 0:8b0d43fe6c05 | 10 | Serial pc(USBTX, USBRX); |
greenroshks | 0:8b0d43fe6c05 | 11 | |
greenroshks | 0:8b0d43fe6c05 | 12 | |
greenroshks | 0:8b0d43fe6c05 | 13 | |
sakthipriya | 5:255b43e8e21a | 14 | Timer t; //To know the time of execution each thread |
sakthipriya | 4:8f6c24eca109 | 15 | Timer t1; |
sakthipriya | 5:255b43e8e21a | 16 | //To know the time of entering of each thread |
greenroshks | 0:8b0d43fe6c05 | 17 | |
greenroshks | 8:667fbc82d634 | 18 | Thread *ptr_t_hk; //every 20 seconds |
greenroshks | 8:667fbc82d634 | 19 | Thread *ptr_t_acs; //every 10 seconds |
greenroshks | 8:667fbc82d634 | 20 | //Thread *ptr_t_acs_write2flash; |
greenroshks | 8:667fbc82d634 | 21 | Thread *ptr_t_bea; //every 30 seconds |
greenroshks | 8:667fbc82d634 | 22 | //Thread *ptr_t_bea_telecommand; |
greenroshks | 8:667fbc82d634 | 23 | //Thread *ptr_t_fault; //will be taken care by HK thread and interrupts |
greenroshks | 8:667fbc82d634 | 24 | Thread *ptr_t_i2c; //for interprocessor communication |
greenroshks | 8:667fbc82d634 | 25 | Thread *ptr_t_exec_tc; //Taking data from i2c mail box and execute the stuff |
greenroshks | 0:8b0d43fe6c05 | 26 | |
greenroshks | 0:8b0d43fe6c05 | 27 | |
greenroshks | 0:8b0d43fe6c05 | 28 | //-------------------------------------------------------------------------------------------------------------------------------------------------- |
greenroshks | 0:8b0d43fe6c05 | 29 | //TASK 2 : HK |
greenroshks | 0:8b0d43fe6c05 | 30 | //-------------------------------------------------------------------------------------------------------------------------------------------------- |
greenroshks | 0:8b0d43fe6c05 | 31 | |
greenroshks | 0:8b0d43fe6c05 | 32 | |
greenroshks | 8:667fbc82d634 | 33 | extern SensorData Sensor; |
greenroshks | 8:667fbc82d634 | 34 | void t_hk(void const *args) |
greenroshks | 0:8b0d43fe6c05 | 35 | { |
greenroshks | 8:667fbc82d634 | 36 | Sensor.power_mode = DEFAULT_POW_MODE; |
greenroshks | 0:8b0d43fe6c05 | 37 | while(1) |
greenroshks | 0:8b0d43fe6c05 | 38 | { |
greenroshks | 0:8b0d43fe6c05 | 39 | Thread::signal_wait(0x2); |
greenroshks | 0:8b0d43fe6c05 | 40 | |
greenroshks | 0:8b0d43fe6c05 | 41 | printf("\nTHIS IS HK %f\n",t1.read()); |
greenroshks | 8:667fbc82d634 | 42 | //t.start(); |
greenroshks | 8:667fbc82d634 | 43 | FAULTS(); |
greenroshks | 8:667fbc82d634 | 44 | POWER(Sensor.power_mode); |
greenroshks | 0:8b0d43fe6c05 | 45 | FUNC_HK_MAIN(); //Collecting HK data |
greenroshks | 0:8b0d43fe6c05 | 46 | //thread_2.signal_set(0x4); |
greenroshks | 8:667fbc82d634 | 47 | // FUNC_I2C_SLAVE_MAIN(24); //Put HK data to I2C thread instead |
greenroshks | 0:8b0d43fe6c05 | 48 | |
greenroshks | 8:667fbc82d634 | 49 | // t.stop(); |
greenroshks | 8:667fbc82d634 | 50 | //printf("The time to execute hk_acq is %f seconds\n",t.read()); |
greenroshks | 8:667fbc82d634 | 51 | //t.reset(); |
greenroshks | 0:8b0d43fe6c05 | 52 | } |
greenroshks | 0:8b0d43fe6c05 | 53 | } |
greenroshks | 0:8b0d43fe6c05 | 54 | |
greenroshks | 0:8b0d43fe6c05 | 55 | //--------------------------------------------------------------------------------------------------------------------------------------- |
greenroshks | 0:8b0d43fe6c05 | 56 | //TASK 1 : ACS |
greenroshks | 0:8b0d43fe6c05 | 57 | //--------------------------------------------------------------------------------------------------------------------------------------- |
greenroshks | 8:667fbc82d634 | 58 | /*typedef struct { |
greenroshks | 0:8b0d43fe6c05 | 59 | float mag_field; |
greenroshks | 0:8b0d43fe6c05 | 60 | float omega; |
greenroshks | 0:8b0d43fe6c05 | 61 | } sensor_data; |
greenroshks | 8:667fbc82d634 | 62 | */ |
greenroshks | 8:667fbc82d634 | 63 | //Mail <sensor_data, 16> q_acs; //Will be taken care of by HK structure every 20 seconds |
greenroshks | 0:8b0d43fe6c05 | 64 | |
greenroshks | 8:667fbc82d634 | 65 | /*void func_acs_readdata(sensor_data *ptr) |
greenroshks | 0:8b0d43fe6c05 | 66 | { |
greenroshks | 0:8b0d43fe6c05 | 67 | printf("Reading the data\n"); |
greenroshks | 0:8b0d43fe6c05 | 68 | ptr -> mag_field = 10; |
greenroshks | 0:8b0d43fe6c05 | 69 | ptr -> omega = 3; |
greenroshks | 0:8b0d43fe6c05 | 70 | } |
greenroshks | 0:8b0d43fe6c05 | 71 | |
greenroshks | 0:8b0d43fe6c05 | 72 | void func_acs_ctrlalgo() |
greenroshks | 0:8b0d43fe6c05 | 73 | { |
greenroshks | 0:8b0d43fe6c05 | 74 | printf("Executing control algo\n"); |
greenroshks | 0:8b0d43fe6c05 | 75 | } |
greenroshks | 0:8b0d43fe6c05 | 76 | |
greenroshks | 0:8b0d43fe6c05 | 77 | |
greenroshks | 0:8b0d43fe6c05 | 78 | |
greenroshks | 0:8b0d43fe6c05 | 79 | void func_acs_write2flash(sensor_data *ptr2) |
greenroshks | 0:8b0d43fe6c05 | 80 | { |
greenroshks | 0:8b0d43fe6c05 | 81 | printf("The magnetic field is %.2f T\n\r",ptr2->mag_field); |
greenroshks | 0:8b0d43fe6c05 | 82 | printf("The angular velocity is %.2f rad/s\n\r",ptr2->omega); |
greenroshks | 8:667fbc82d634 | 83 | }*/ |
greenroshks | 0:8b0d43fe6c05 | 84 | |
greenroshks | 8:667fbc82d634 | 85 | int acs_pflag = 1; //for executing acs power modes |
greenroshks | 0:8b0d43fe6c05 | 86 | void t_acs(void const *args) |
greenroshks | 0:8b0d43fe6c05 | 87 | { |
greenroshks | 8:667fbc82d634 | 88 | float *mag_field; |
greenroshks | 8:667fbc82d634 | 89 | float *omega; |
greenroshks | 8:667fbc82d634 | 90 | float *moment; |
greenroshks | 0:8b0d43fe6c05 | 91 | while(1) |
greenroshks | 0:8b0d43fe6c05 | 92 | { |
greenroshks | 0:8b0d43fe6c05 | 93 | Thread::signal_wait(0x1); |
greenroshks | 0:8b0d43fe6c05 | 94 | printf("\nTHIS IS ACS %f\n",t1.read()); |
greenroshks | 8:667fbc82d634 | 95 | // t.start(); |
greenroshks | 8:667fbc82d634 | 96 | // sensor_data *ptr = q_acs.alloc(); //done by HK instead |
greenroshks | 8:667fbc82d634 | 97 | |
greenroshks | 8:667fbc82d634 | 98 | //func_acs_readda=ta(ptr); |
greenroshks | 8:667fbc82d634 | 99 | mag_field= FUNC_ACS_MAG_EXEC(); //actual execution |
greenroshks | 8:667fbc82d634 | 100 | omega = FUNC_ACS_EXEC_GYR(); |
greenroshks | 0:8b0d43fe6c05 | 101 | |
greenroshks | 8:667fbc82d634 | 102 | |
greenroshks | 8:667fbc82d634 | 103 | //q_acs.put(ptr); //done by HK |
greenroshks | 8:667fbc82d634 | 104 | if(acs_pflag == 1) //for the respective power mode |
sakthipriya | 5:255b43e8e21a | 105 | { |
greenroshks | 8:667fbc82d634 | 106 | moment = FUNC_ACS_CNTRLALGO(mag_field,omega); |
greenroshks | 8:667fbc82d634 | 107 | FUNC_ACS_GENPWM(moment); //Generating PWM signal. |
sakthipriya | 5:255b43e8e21a | 108 | } |
greenroshks | 0:8b0d43fe6c05 | 109 | |
greenroshks | 8:667fbc82d634 | 110 | //t.reset(); |
greenroshks | 0:8b0d43fe6c05 | 111 | } |
greenroshks | 0:8b0d43fe6c05 | 112 | } |
greenroshks | 0:8b0d43fe6c05 | 113 | |
greenroshks | 8:667fbc82d634 | 114 | /*void t_acs_write2flash(void const *args) //unwanted thread |
greenroshks | 0:8b0d43fe6c05 | 115 | { |
greenroshks | 0:8b0d43fe6c05 | 116 | while(1) |
greenroshks | 0:8b0d43fe6c05 | 117 | { |
greenroshks | 0:8b0d43fe6c05 | 118 | //printf("Writing in the flash\n"); |
greenroshks | 0:8b0d43fe6c05 | 119 | osEvent evt = q_acs.get(); |
greenroshks | 0:8b0d43fe6c05 | 120 | if(evt.status == osEventMail) |
greenroshks | 0:8b0d43fe6c05 | 121 | { |
greenroshks | 0:8b0d43fe6c05 | 122 | sensor_data *ptr = (sensor_data*)evt.value.p; |
greenroshks | 0:8b0d43fe6c05 | 123 | func_acs_write2flash(ptr); |
greenroshks | 0:8b0d43fe6c05 | 124 | q_acs.free(ptr); |
greenroshks | 0:8b0d43fe6c05 | 125 | } |
greenroshks | 0:8b0d43fe6c05 | 126 | printf("Writing acs data in the flash\n"); |
greenroshks | 0:8b0d43fe6c05 | 127 | } |
greenroshks | 8:667fbc82d634 | 128 | }*/ |
greenroshks | 0:8b0d43fe6c05 | 129 | |
greenroshks | 0:8b0d43fe6c05 | 130 | |
greenroshks | 0:8b0d43fe6c05 | 131 | //---------------------------------------------------BEACON-------------------------------------------------------------------------------------------- |
greenroshks | 0:8b0d43fe6c05 | 132 | |
greenroshks | 0:8b0d43fe6c05 | 133 | int beac_flag=0; //To receive telecommand from ground. |
greenroshks | 0:8b0d43fe6c05 | 134 | |
greenroshks | 0:8b0d43fe6c05 | 135 | |
greenroshks | 8:667fbc82d634 | 136 | /*void t_bea_telecommand(void const *args) //taken care of by t_exec_tc |
greenroshks | 0:8b0d43fe6c05 | 137 | { |
greenroshks | 0:8b0d43fe6c05 | 138 | char c = pc.getc(); |
greenroshks | 0:8b0d43fe6c05 | 139 | if(c=='a') |
greenroshks | 0:8b0d43fe6c05 | 140 | { |
greenroshks | 0:8b0d43fe6c05 | 141 | printf("Telecommand detected\n"); |
greenroshks | 0:8b0d43fe6c05 | 142 | beac_flag=1; |
greenroshks | 0:8b0d43fe6c05 | 143 | } |
greenroshks | 0:8b0d43fe6c05 | 144 | } |
greenroshks | 8:667fbc82d634 | 145 | */ |
greenroshks | 0:8b0d43fe6c05 | 146 | void t_bea(void const *args) |
greenroshks | 0:8b0d43fe6c05 | 147 | { |
greenroshks | 0:8b0d43fe6c05 | 148 | |
greenroshks | 0:8b0d43fe6c05 | 149 | while(1) |
greenroshks | 0:8b0d43fe6c05 | 150 | { |
greenroshks | 0:8b0d43fe6c05 | 151 | Thread::signal_wait(0x3); |
greenroshks | 0:8b0d43fe6c05 | 152 | printf("\nTHIS IS BEACON %f\n",t1.read()); |
greenroshks | 8:667fbc82d634 | 153 | //t.start(); |
greenroshks | 0:8b0d43fe6c05 | 154 | |
greenroshks | 0:8b0d43fe6c05 | 155 | |
greenroshks | 0:8b0d43fe6c05 | 156 | |
greenroshks | 0:8b0d43fe6c05 | 157 | FUNC_BEA(); |
greenroshks | 0:8b0d43fe6c05 | 158 | |
greenroshks | 0:8b0d43fe6c05 | 159 | |
greenroshks | 8:667fbc82d634 | 160 | /*if(beac_flag==1) //beacon standby can be doe to |
greenroshks | 0:8b0d43fe6c05 | 161 | { |
greenroshks | 0:8b0d43fe6c05 | 162 | Thread::wait(600000); |
greenroshks | 0:8b0d43fe6c05 | 163 | beac_flag = 0; |
greenroshks | 8:667fbc82d634 | 164 | }*/ |
greenroshks | 0:8b0d43fe6c05 | 165 | |
greenroshks | 8:667fbc82d634 | 166 | //printf("The time to execute beacon thread is %f seconds\n",t.read()); |
greenroshks | 8:667fbc82d634 | 167 | //t.reset(); |
greenroshks | 0:8b0d43fe6c05 | 168 | } |
greenroshks | 0:8b0d43fe6c05 | 169 | } |
greenroshks | 0:8b0d43fe6c05 | 170 | |
greenroshks | 0:8b0d43fe6c05 | 171 | //--------------------------------------------------------------------------------------------------------------------------------------------------- |
greenroshks | 0:8b0d43fe6c05 | 172 | //TASK 4 : FAULT MANAGEMENT |
greenroshks | 0:8b0d43fe6c05 | 173 | //--------------------------------------------------------------------------------------------------------------------------------------------------- |
greenroshks | 0:8b0d43fe6c05 | 174 | //Dummy fault rectifier functions |
greenroshks | 0:8b0d43fe6c05 | 175 | |
sakthipriya | 2:80b8a2e999f7 | 176 | /*Mail<int,16> faults; |
greenroshks | 0:8b0d43fe6c05 | 177 | |
greenroshks | 0:8b0d43fe6c05 | 178 | void FUNC_FAULT_FUNCT1() |
greenroshks | 0:8b0d43fe6c05 | 179 | { |
greenroshks | 0:8b0d43fe6c05 | 180 | printf("\nFault 1 detected... \n"); |
greenroshks | 0:8b0d43fe6c05 | 181 | } |
greenroshks | 0:8b0d43fe6c05 | 182 | |
greenroshks | 0:8b0d43fe6c05 | 183 | void FUNC_FAULT_FUNCT2() |
greenroshks | 0:8b0d43fe6c05 | 184 | { |
greenroshks | 0:8b0d43fe6c05 | 185 | printf("\nFault 2 detected...\n"); |
greenroshks | 0:8b0d43fe6c05 | 186 | } |
greenroshks | 0:8b0d43fe6c05 | 187 | |
greenroshks | 0:8b0d43fe6c05 | 188 | void T_FAULT(void const *args) |
greenroshks | 0:8b0d43fe6c05 | 189 | { |
greenroshks | 0:8b0d43fe6c05 | 190 | while(1) |
greenroshks | 0:8b0d43fe6c05 | 191 | { |
greenroshks | 0:8b0d43fe6c05 | 192 | osEvent evt = faults.get(); |
greenroshks | 0:8b0d43fe6c05 | 193 | if(evt.status==osEventMail) |
greenroshks | 0:8b0d43fe6c05 | 194 | { |
greenroshks | 0:8b0d43fe6c05 | 195 | int *fault_id= (int *)evt.value.p; |
greenroshks | 0:8b0d43fe6c05 | 196 | switch(*fault_id) |
greenroshks | 0:8b0d43fe6c05 | 197 | { |
greenroshks | 0:8b0d43fe6c05 | 198 | case 1: FUNC_FAULT_FUNCT1(); |
greenroshks | 0:8b0d43fe6c05 | 199 | break; |
greenroshks | 0:8b0d43fe6c05 | 200 | case 2: FUNC_FAULT_FUNCT2(); |
greenroshks | 0:8b0d43fe6c05 | 201 | break; |
greenroshks | 0:8b0d43fe6c05 | 202 | } |
greenroshks | 0:8b0d43fe6c05 | 203 | faults.free(fault_id); |
greenroshks | 0:8b0d43fe6c05 | 204 | } |
greenroshks | 0:8b0d43fe6c05 | 205 | } |
sakthipriya | 2:80b8a2e999f7 | 206 | }*/ |
sakthipriya | 5:255b43e8e21a | 207 | |
raizel_varun | 6:e65b1ab79f36 | 208 | |
raizel_varun | 6:e65b1ab79f36 | 209 | |
greenroshks | 8:667fbc82d634 | 210 | /* |
sakthipriya | 2:80b8a2e999f7 | 211 | void T_FAULT(void const *args) |
sakthipriya | 4:8f6c24eca109 | 212 | { |
sakthipriya | 5:255b43e8e21a | 213 | Sensor.power_mode='0'; |
sakthipriya | 2:80b8a2e999f7 | 214 | while(1) |
sakthipriya | 2:80b8a2e999f7 | 215 | { |
sakthipriya | 2:80b8a2e999f7 | 216 | Thread :: signal_wait(0x2); |
sakthipriya | 2:80b8a2e999f7 | 217 | FAULTS(); |
sakthipriya | 5:255b43e8e21a | 218 | POWER(Sensor.power_mode); |
sakthipriya | 5:255b43e8e21a | 219 | //Sensor.power_mode++; //testing ... should be removed |
sakthipriya | 2:80b8a2e999f7 | 220 | } |
greenroshks | 0:8b0d43fe6c05 | 221 | } |
greenroshks | 8:667fbc82d634 | 222 | */ |
greenroshks | 0:8b0d43fe6c05 | 223 | //------------------------------------------------------------------------------------------------------------------------------------------------ |
greenroshks | 0:8b0d43fe6c05 | 224 | //SCHEDULER |
greenroshks | 0:8b0d43fe6c05 | 225 | //------------------------------------------------------------------------------------------------------------------------------------------------ |
sakthipriya | 4:8f6c24eca109 | 226 | int beacon_sc = 3; |
greenroshks | 0:8b0d43fe6c05 | 227 | uint16_t schedcount=1; |
greenroshks | 0:8b0d43fe6c05 | 228 | void t_sc(void const *args) |
greenroshks | 0:8b0d43fe6c05 | 229 | { |
greenroshks | 0:8b0d43fe6c05 | 230 | |
greenroshks | 0:8b0d43fe6c05 | 231 | printf("The value of i in scheduler is %d\n",schedcount); |
greenroshks | 0:8b0d43fe6c05 | 232 | if(schedcount == 65532) //to reset the counter |
greenroshks | 0:8b0d43fe6c05 | 233 | { |
greenroshks | 0:8b0d43fe6c05 | 234 | schedcount = 0; |
greenroshks | 0:8b0d43fe6c05 | 235 | } |
greenroshks | 0:8b0d43fe6c05 | 236 | |
greenroshks | 0:8b0d43fe6c05 | 237 | if(schedcount%1==0) |
greenroshks | 0:8b0d43fe6c05 | 238 | { |
greenroshks | 0:8b0d43fe6c05 | 239 | ptr_t_acs -> signal_set(0x1); |
greenroshks | 0:8b0d43fe6c05 | 240 | } |
greenroshks | 0:8b0d43fe6c05 | 241 | if(schedcount%2==0) |
greenroshks | 0:8b0d43fe6c05 | 242 | { |
greenroshks | 8:667fbc82d634 | 243 | // ptr_t_fault -> signal_set(0x2); |
greenroshks | 8:667fbc82d634 | 244 | ptr_t_hk -> signal_set(0x2); |
sakthipriya | 2:80b8a2e999f7 | 245 | |
greenroshks | 0:8b0d43fe6c05 | 246 | } |
sakthipriya | 4:8f6c24eca109 | 247 | if(schedcount%beacon_sc==0) |
greenroshks | 0:8b0d43fe6c05 | 248 | { |
greenroshks | 0:8b0d43fe6c05 | 249 | if(beac_flag==0) |
greenroshks | 0:8b0d43fe6c05 | 250 | { |
greenroshks | 0:8b0d43fe6c05 | 251 | |
greenroshks | 0:8b0d43fe6c05 | 252 | ptr_t_bea -> signal_set(0x3); |
greenroshks | 0:8b0d43fe6c05 | 253 | } |
greenroshks | 0:8b0d43fe6c05 | 254 | } |
greenroshks | 0:8b0d43fe6c05 | 255 | schedcount++; |
greenroshks | 0:8b0d43fe6c05 | 256 | } |
greenroshks | 0:8b0d43fe6c05 | 257 | |
greenroshks | 0:8b0d43fe6c05 | 258 | //--------------------------------------------------------------------------------------------------------------------------------------------- |
greenroshks | 0:8b0d43fe6c05 | 259 | |
greenroshks | 0:8b0d43fe6c05 | 260 | int main() |
greenroshks | 0:8b0d43fe6c05 | 261 | { |
greenroshks | 0:8b0d43fe6c05 | 262 | t1.start(); |
greenroshks | 0:8b0d43fe6c05 | 263 | |
greenroshks | 8:667fbc82d634 | 264 | ptr_t_hk = new Thread(t_hk); |
greenroshks | 0:8b0d43fe6c05 | 265 | ptr_t_acs = new Thread(t_acs); |
greenroshks | 8:667fbc82d634 | 266 | //ptr_t_acs_write2flash = new Thread(t_acs_write2flash); |
greenroshks | 0:8b0d43fe6c05 | 267 | ptr_t_bea = new Thread(t_bea); |
greenroshks | 8:667fbc82d634 | 268 | //ptr_t_bea_telecommand = new Thread(t_bea_telecommand); |
greenroshks | 8:667fbc82d634 | 269 | //ptr_t_fault = new Thread(T_FAULT); |
greenroshks | 0:8b0d43fe6c05 | 270 | //ptr_t_sc = new Thread(t_sc); |
greenroshks | 0:8b0d43fe6c05 | 271 | |
greenroshks | 8:667fbc82d634 | 272 | // ptr_t_fault -> set_priority(osPriorityRealtime); |
greenroshks | 0:8b0d43fe6c05 | 273 | ptr_t_acs->set_priority(osPriorityHigh); |
greenroshks | 8:667fbc82d634 | 274 | ptr_t_hk->set_priority(osPriorityNormal); |
greenroshks | 8:667fbc82d634 | 275 | //ptr_t_acs_write2flash->set_priority(osPriorityBelowNormal); |
greenroshks | 0:8b0d43fe6c05 | 276 | ptr_t_bea->set_priority(osPriorityAboveNormal); |
greenroshks | 8:667fbc82d634 | 277 | //ptr_t_bea_telecommand->set_priority(osPriorityIdle); |
greenroshks | 0:8b0d43fe6c05 | 278 | //ptr_t_sc->set_priority(osPriorityAboveNormal); |
greenroshks | 0:8b0d43fe6c05 | 279 | |
greenroshks | 0:8b0d43fe6c05 | 280 | |
greenroshks | 0:8b0d43fe6c05 | 281 | // ---------------------------------------------------------------------------------------------- |
greenroshks | 8:667fbc82d634 | 282 | //printf("\n T_FAULT priority is %d",ptr_t_fault->get_priority()); |
greenroshks | 0:8b0d43fe6c05 | 283 | printf("\n T_ACS priority is %d",ptr_t_acs->get_priority()); |
greenroshks | 8:667fbc82d634 | 284 | printf("\n T_HK_ACQ priority is %d",ptr_t_hk->get_priority()); |
greenroshks | 8:667fbc82d634 | 285 | //printf("\n T_ACS_WRITE2FLASH priority is %d",ptr_t_acs_write2flash->get_priority()); |
greenroshks | 0:8b0d43fe6c05 | 286 | printf("\n T_BEA priority is %d",ptr_t_bea->get_priority()); |
greenroshks | 0:8b0d43fe6c05 | 287 | RtosTimer t_sc_timer(t_sc,osTimerPeriodic); |
greenroshks | 0:8b0d43fe6c05 | 288 | t_sc_timer.start(10000); |
greenroshks | 0:8b0d43fe6c05 | 289 | printf("\n%f\n",t1.read()); |
greenroshks | 0:8b0d43fe6c05 | 290 | |
greenroshks | 0:8b0d43fe6c05 | 291 | while(1) |
raizel_varun | 7:f06840d848e3 | 292 | { |
greenroshks | 0:8b0d43fe6c05 | 293 | Thread::wait(10000); |
greenroshks | 0:8b0d43fe6c05 | 294 | ; |
greenroshks | 0:8b0d43fe6c05 | 295 | } |
greenroshks | 0:8b0d43fe6c05 | 296 | |
greenroshks | 0:8b0d43fe6c05 | 297 | } |