Block and SuperBlock minor cleanup

This commit is contained in:
Daniel Agar
2017-06-02 22:01:16 -04:00
committed by Lorenz Meier
parent 1671c32238
commit 3d6792c019
3 changed files with 54 additions and 50 deletions
+11 -17
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (C) 2012 PX4 Development Team. All rights reserved.
* Copyright (C) 2012-2017 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,25 +37,20 @@
* Controller library code
*/
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "Block.hpp"
#include "BlockParam.hpp"
#include <cstring>
#include <uORB/Subscription.hpp>
#include <uORB/Publication.hpp>
#include "Block.hpp"
#include "BlockParam.hpp"
namespace control
{
Block::Block(SuperBlock *parent, const char *name) :
_name(name),
_parent(parent),
_dt(0)
_parent(parent)
{
if (getParent() != nullptr) {
getParent()->getChildren().add(this);
@@ -93,7 +88,7 @@ void Block::updateParams()
if (count++ > maxParamsPerBlock) {
char name[blockNameLengthMax];
getName(name, blockNameLengthMax);
printf("exceeded max params for block: %s\n", name);
PX4_ERR("exceeded max params for block: %s", name);
break;
}
@@ -112,7 +107,7 @@ void Block::updateSubscriptions()
if (count++ > maxSubscriptionsPerBlock) {
char name[blockNameLengthMax];
getName(name, blockNameLengthMax);
printf("exceeded max subscriptions for block: %s\n", name);
PX4_ERR("exceeded max subscriptions for block: %s", name);
break;
}
@@ -130,7 +125,7 @@ void Block::updatePublications()
if (count++ > maxPublicationsPerBlock) {
char name[blockNameLengthMax];
getName(name, blockNameLengthMax);
printf("exceeded max publications for block: %s\n", name);
PX4_ERR("exceeded max publications for block: %s", name);
break;
}
@@ -149,7 +144,7 @@ void SuperBlock::setDt(float dt)
if (count++ > maxChildrenPerBlock) {
char name[blockNameLengthMax];
getName(name, blockNameLengthMax);
printf("exceeded max children for block: %s\n", name);
PX4_ERR("exceeded max children for block: %s", name);
break;
}
@@ -167,7 +162,7 @@ void SuperBlock::updateChildParams()
if (count++ > maxChildrenPerBlock) {
char name[blockNameLengthMax];
getName(name, blockNameLengthMax);
printf("exceeded max children for block: %s\n", name);
PX4_ERR("exceeded max children for block: %s", name);
break;
}
@@ -185,7 +180,7 @@ void SuperBlock::updateChildSubscriptions()
if (count++ > maxChildrenPerBlock) {
char name[blockNameLengthMax];
getName(name, blockNameLengthMax);
printf("exceeded max children for block: %s\n", name);
PX4_ERR("exceeded max children for block: %s", name);
break;
}
@@ -203,7 +198,7 @@ void SuperBlock::updateChildPublications()
if (count++ > maxChildrenPerBlock) {
char name[blockNameLengthMax];
getName(name, blockNameLengthMax);
printf("exceeded max children for block: %s\n", name);
PX4_ERR("exceeded max children for block: %s", name);
break;
}
@@ -212,7 +207,6 @@ void SuperBlock::updateChildPublications()
}
}
} // namespace control
template class List<uORB::SubscriptionNode *>;