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: ACS.cpp
- Revision:
- 88:d9d647e3701f
- Parent:
- 66:a5d2b8dc6b9e
- Child:
- 89:d50f09fab17f
--- a/ACS.cpp Sat Dec 17 13:32:52 2016 +0000 +++ b/ACS.cpp Sat Dec 24 09:51:19 2016 +0000 @@ -1318,13 +1318,14 @@ if((error!=0) || (sensor!=0)) { - if( (error&1 == 1) || (sensor&1 == 1) || (sensor&16 == 16) ) + if( (error&4 == 4) || (sensor&4 == 4) || (sensor&64 == 64) ) { acs_pc.printf("error in gyro.\n \r"); gyro_error = 1; } - if( (error&4 == 4) || (sensor&4 == 4) || (sensor&64 == 64) ) + + if( (error&1 == 1) || (sensor&1 == 1) || (sensor&16 == 16) ) { acs_pc.printf("error in mag.Exiting.\n \r"); @@ -1592,7 +1593,7 @@ acs_pc.printf(" Sensor 2 data acq failure.Go to sensor 1 again.\n \r"); ATS2_SW_ENABLE = 1; wait_ms(5); //In status change 00 to 01 for sensor 1, other two bits are same - ATS1_SW_ENABLE = 1; + ATS1_SW_ENABLE = 0; wait_ms(5); ACS_ATS_STATUS = (ACS_ATS_STATUS&0x3F)|0x40; return acq; @@ -1878,7 +1879,7 @@ acs_pc.printf(" Sensor 2 data acq failure.Go to sensor 1 again.\n \r"); ATS2_SW_ENABLE = 1; wait_ms(5); - ATS1_SW_ENABLE = 1; + ATS1_SW_ENABLE = 0; ACS_ATS_STATUS = (ACS_ATS_STATUS&0xF0)|0x0C; //Update not working and switch back to 1 if(acq == 1) {