mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-17 17:01:58 +08:00
Merge commit 'ec76f615851fd6a347cedaeb7b58e585840843f7' into libfibre
This commit is contained in:
@@ -55,6 +55,7 @@ ENV THIRD_PARTY=/
|
||||
# Set up entrypoint
|
||||
RUN echo "#!/bin/bash" > /entrypoint.sh && \
|
||||
echo "set -euo pipefail" >> /entrypoint.sh && \
|
||||
echo "rm -rdf build/*" >> /entrypoint.sh && \
|
||||
echo "echo building \$@" >> /entrypoint.sh && \
|
||||
echo "tup generate --config \$@ /tmp/build.sh" >> /entrypoint.sh && \
|
||||
echo "exec /usr/bin/bash -x -e /tmp/build.sh" >> /entrypoint.sh && \
|
||||
|
||||
@@ -135,3 +135,10 @@ if STRIP then
|
||||
outputs={outname}
|
||||
}
|
||||
end
|
||||
|
||||
if string.find(machine, "x86_64.*-apple-.*") then
|
||||
tup.frule{
|
||||
inputs=outname,
|
||||
command='^c^ chmod 644 %f',
|
||||
}
|
||||
end
|
||||
@@ -125,9 +125,9 @@ Context* fibre::open(EventLoop* event_loop) {
|
||||
auto static_backends_good = for_each_in_tuple(BackendInitializer{ctx},
|
||||
ctx->static_backends);
|
||||
|
||||
// TODO: check static_backends_good
|
||||
|
||||
if (all(static_backends_good)) {
|
||||
if (!all(static_backends_good)) {
|
||||
// TODO: shutdown backends
|
||||
FIBRE_LOG(E) << "some backends failed to initialize";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -216,8 +216,12 @@ void Domain::start_discovery(Callback<void, Object*, Interface*> on_found_object
|
||||
}
|
||||
|
||||
void Domain::stop_discovery() {
|
||||
auto on_lost_object = on_lost_object_;
|
||||
on_found_object_ = nullptr;
|
||||
on_lost_object_ = nullptr;
|
||||
if (root_object_) {
|
||||
on_lost_object.invoke(root_object_);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -249,14 +253,14 @@ void Domain::on_found_channels(ChannelDiscoveryResult result) {
|
||||
void Domain::on_found_root_object(LegacyObjectClient* obj_client, std::shared_ptr<LegacyObject> obj) {
|
||||
root_object_ = reinterpret_cast<Object*>(obj.get());
|
||||
root_intf_ = reinterpret_cast<Interface*>(obj->intf.get());
|
||||
on_found_object_.invoke(reinterpret_cast<Object*>(obj.get()),
|
||||
reinterpret_cast<Interface*>(obj->intf.get()));
|
||||
on_found_object_.invoke(root_object_, root_intf_);
|
||||
}
|
||||
|
||||
void Domain::on_lost_root_object(LegacyObjectClient* obj_client) {
|
||||
auto root_object = root_object_;
|
||||
root_object_ = nullptr;
|
||||
root_intf_ = nullptr;
|
||||
on_lost_object_.invoke(reinterpret_cast<Object*>(obj_client->root_obj_.get()));
|
||||
on_lost_object_.invoke(reinterpret_cast<Object*>(root_object));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -423,11 +423,8 @@ FIBRE_PUBLIC void libfibre_subscribe_to_interface(LibFibreInterface* interface,
|
||||
* callback of libfibre_subscribe_to_interface().
|
||||
* @param child_obj_ptr: If and only if the function succeeds, the variable that
|
||||
* this argument points to is set to the requested subobject. The returned
|
||||
* object handle is only guaranteed to remain valid until the next
|
||||
* iteration of the libfibre event loop or until any other libfibre
|
||||
* function (other than libfibre_ref_obj()) is invoked. If the
|
||||
* application intends to keep the object handle around it must call
|
||||
* libfibre_ref_obj() immediately.
|
||||
* object handle is only guaranteed to remain valid for as long as the
|
||||
* parent object handle is valid.
|
||||
* @returns: kFibreOk or kFibreInvalidArgument
|
||||
*/
|
||||
FIBRE_PUBLIC LibFibreStatus libfibre_get_attribute(LibFibreObject* parent_obj, LibFibreAttribute* attr, LibFibreObject** child_obj_ptr);
|
||||
|
||||
@@ -265,6 +265,7 @@ LibFibreCtx* libfibre_open(LibFibreEventLoop event_loop) {
|
||||
ctx->fibre_ctx = fibre::open(ctx->event_loop);
|
||||
|
||||
if (!ctx->fibre_ctx) {
|
||||
FIBRE_LOG(E) << "fibre::open failed";
|
||||
delete ctx->event_loop;
|
||||
delete ctx;
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user