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.
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of workinQM_5thJan_azad by
Diff: main.cpp
- Revision:
- 18:3662058a7c10
- Parent:
- 17:fc782f7548c6
- Child:
- 19:79e69017c855
diff -r fc782f7548c6 -r 3662058a7c10 main.cpp --- a/main.cpp Fri May 13 11:56:49 2016 +0000 +++ b/main.cpp Sat May 14 11:19:13 2016 +0000 @@ -37,6 +37,11 @@ uint8_t ACS_ATS_ENABLE = 1; uint8_t ACS_DATA_ACQ_ENABLE = 1; uint8_t ACS_STATE = 4; +/*added for removing the stuck/hang problem*/ +/*does it work? now doing it in main*/ +extern uint8_t BCN_FEN; +extern void FCTN_BCN_FEN(void const *args); +Timeout timeout_bcn; //.....................eps...................// //eps init @@ -350,6 +355,8 @@ PWM3 = 0; //clear pwm pins } } //else for acs control off +/// + printf("\n\rlow power crossed and pwm no hang"); ACS_MAIN_STATUS = 0; //clear ACS_MAIN_STATUS flag } @@ -637,14 +644,22 @@ if(schedcount%2==0) { - // F_EPS(); + printf("\n\rreached scheduler part2 "); + //F_EPS(); + //F_BCN(); } + printf("\n\rexited scheduler part2 "); if(schedcount%3==0) - { // F_ACS(); - // F_BCN(); + { + printf("\n\rreached scheduler part3 "); + //F_ACS(); + F_BCN(); } schedcount++; - printf("\n\r exited scheduler"); + //t_start.start(); + printf("\n\r did increment %d",schedcount); + printf("\n\r ex h"); + printf("\n\r time taken %f",t_start.read()); } Timer t_flag; @@ -776,7 +791,7 @@ //............................// FCTN_ACS_INIT(); FCTN_EPS_INIT(); - //FCTN_BCN_INIT(); + FCTN_BCN_INIT(); FLAG(); @@ -828,6 +843,22 @@ t_start.start(); pc.printf("\n\rStarted scheduler %f\n\r",t_start.read()); + + RtosTimer bcn_start_timer(FCTN_BCN_FEN,osTimerOnce); + /*later change it to 30 min 1800 seconds*/ + bcn_start_timer.start(10000); + + /*for calling bcn_fen function after 30 min as of now say 40 sec*/ + /*but it will be called again and again */ + +/// even this doesn't work if(t_start.read()>38 && t_start.read()<43) +/// if(BCN_FEN==0) +/// { +/// FCTN_BCN_FEN(); +/// printf("\n\r entered the condition \n"); +/// } + +// it won't work timeout_bcn.attach(&FCTN_BCN_FEN,42.0); //FCTN_BAE_INIT(); while(1); //required to prevent main from terminating