Skip to content

Commit

Permalink
Manage everloop size
Browse files Browse the repository at this point in the history
  • Loading branch information
kdpatino committed Jun 1, 2018
1 parent acfe98e commit cb08e96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/driver_everloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ namespace matrix_malos {
bool EverloopDriver::ProcessConfig(const pb::driver::DriverConfig& config) {
pb::io::EverloopImage image(config.image());

if (MatrixLeds() != image.led_size()) {
std::string error_msg("WARNING: Invalid number of Leds it must be =");
error_msg += std::to_string(MatrixLeds());
zmq_push_error_->Send(error_msg);
return false;
}

matrix_hal::EverloopImage image_for_hal(MatrixLeds());
int idx = 0;
for (const pb::io::LedValue& value : image.led()) {
Expand Down
2 changes: 1 addition & 1 deletion src/malos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int RunServer() {
std::cerr << std::endl;

matrix_hal::MatrixIOBus* bus = new matrix_hal::MatrixIOBus();

if (!bus->Init()) return false;

DriverManager driver_manager(kBasePort, kUnsecureBindScope);
Expand Down

0 comments on commit cb08e96

Please sign in to comment.