mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
ahrs: process SPI messages while idle
This makes the AHRS continually process SPI messages while waiting for new samples to be ready. This has the side effect of making the CPU utilization on the AHRS pin at 99-100% (ie. we make use of all of our otherwise idle time). git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1581 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
93ef510946
commit
80c92ba54b
@ -323,8 +323,10 @@ int main()
|
||||
|
||||
// Delay for valid data
|
||||
idle_counter = 0;
|
||||
while( ahrs_state != AHRS_DATA_READY )
|
||||
do {
|
||||
idle_counter ++;
|
||||
process_spi_request();
|
||||
} while ( ahrs_state != AHRS_DATA_READY );
|
||||
|
||||
ahrs_state = AHRS_PROCESSING;
|
||||
|
||||
@ -419,9 +421,6 @@ int main()
|
||||
PIOS_COM_SendFormattedStringNonBlocking(PIOS_COM_AUX, "m: %d %d %d\r\n", mag_data.raw.axis[0], mag_data.raw.axis[1], mag_data.raw.axis[2]);
|
||||
PIOS_COM_SendFormattedStringNonBlocking(PIOS_COM_AUX, "q: %d %d %d %d\r\n", (int16_t)(Nav.q[0] * 1000), (int16_t)(Nav.q[1] * 1000), (int16_t)(Nav.q[2] * 1000), (int16_t)(Nav.q[3] * 1000));
|
||||
#endif
|
||||
|
||||
process_spi_request();
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user