muorb: abs time on aDSP in sync with Linux side

This adds a call on startup of the muorb on the aDSP side to use an
offset for hrt_absolute_call(). This means that the hrt_absolute_call()
on the appsproc (Linux) side should now match the one on the aDSP
(QURT) side.
The accuracy still needs to be determined.
This commit is contained in:
Julian Oes
2016-04-06 15:31:30 +02:00
parent ae2c28677d
commit 2bce8f2803
6 changed files with 164 additions and 6 deletions

View File

@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include "px4muorb.hpp"
#include "uORBFastRpcChannel.hpp"
#include "uORBManager.hpp"
@@ -49,15 +50,27 @@ __END_DECLS
int px4muorb_orb_initialize()
{
HAP_power_request(100, 100, 1000);
// register the fastrpc muorb with uORBManager.
uORB::Manager::get_instance()->set_uorb_communicator(uORB::FastRpcChannel::GetInstance());
const char *argv[] = { "dspal", "start" };
const char *argv[] = {"dspal", "start"};
int argc = 2;
int rc;
rc = dspal_main(argc, (char **)argv);
return rc;
}
int px4muorb_set_absolute_time_offset(int32_t time_diff_us)
{
return hrt_set_absolute_time_offset(time_diff_us);
}
int px4muorb_get_absolute_time(uint64_t *time_us)
{
*time_us = hrt_absolute_time();
return 0;
}
int px4muorb_add_subscriber(const char *name)
{
int rc = 0;