mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Migrate to a new global config object.
This commit is contained in:
@@ -23,9 +23,9 @@ static std::shared_ptr<CandidateDevice> selectDevice()
|
||||
"no devices found (is one plugged in? Do you have the "
|
||||
"appropriate permissions?");
|
||||
|
||||
if (globalConfig().usb().has_serial())
|
||||
if (globalConfig()->usb().has_serial())
|
||||
{
|
||||
auto wantedSerial = globalConfig().usb().serial();
|
||||
auto wantedSerial = globalConfig()->usb().serial();
|
||||
for (auto& c : candidates)
|
||||
{
|
||||
if (c->serial == wantedSerial)
|
||||
@@ -63,10 +63,10 @@ USB* get_usb_impl()
|
||||
{
|
||||
/* Special case for certain configurations. */
|
||||
|
||||
if (globalConfig().usb().has_greaseweazle() &&
|
||||
globalConfig().usb().greaseweazle().has_port())
|
||||
if (globalConfig()->usb().has_greaseweazle() &&
|
||||
globalConfig()->usb().greaseweazle().has_port())
|
||||
{
|
||||
const auto& conf = globalConfig().usb().greaseweazle();
|
||||
const auto& conf = globalConfig()->usb().greaseweazle();
|
||||
log("Using GreaseWeazle on serial port {}", conf.port());
|
||||
return createGreaseWeazleUsb(conf.port(), conf);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ USB* get_usb_impl()
|
||||
candidate->serial,
|
||||
candidate->serialPort);
|
||||
return createGreaseWeazleUsb(
|
||||
candidate->serialPort, globalConfig().usb().greaseweazle());
|
||||
candidate->serialPort, globalConfig()->usb().greaseweazle());
|
||||
|
||||
default:
|
||||
error("internal");
|
||||
|
||||
Reference in New Issue
Block a user