Load sizes for variable-size controllers in CLI mode

This commit is contained in:
Adam Honse 2020-03-20 13:50:54 -05:00
parent ce9508aa88
commit 69651b3f91
2 changed files with 10 additions and 11 deletions

View file

@ -7,8 +7,7 @@
#include "RGBController.h"
#include "i2c_smbus.h"
extern std::vector<i2c_smbus_interface*> busses;
extern std::vector<RGBController*> rgb_controllers;
static std::vector<RGBController*> rgb_controllers;
struct DeviceOptions
{
@ -325,8 +324,10 @@ void ApplyOptions(DeviceOptions& options)
}
}
int cli_main(int argc, char *argv[])
int cli_main(int argc, char *argv[], std::vector<RGBController *> rgb_controllers_in)
{
rgb_controllers = rgb_controllers_in;
if (argc == 2 && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")))
{
PrintHelp();
@ -339,8 +340,6 @@ int cli_main(int argc, char *argv[])
return 0;
}
DetectRGBControllers();
Options options;
if (!ProcessOptions(argc, argv, &options))
{