MCPcopy Create free account
hub / github.com/OAID/Tengine / LoadDevice

Method LoadDevice

executor/lib/device_driver.cpp:101–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool DriverManager::LoadDevice(Driver* driver, Device* device)
102{
103 if(driver->GetDeviceStatus(device) == kDevNormal)
104 return true;
105
106 const dev_id_t& dev_id = device->GetDeviceID();
107
108 DevExecutor* dev_executor = DevExecutorFactory::GetFactory()->Create(dev_id, dev_id);
109
110 if(dev_executor)
111 {
112 dev_executor->SetName(device->GetName());
113 dev_executor->Init();
114
115 dev_executor->BindDevice(device);
116
117 DevExecutorManager::RegisterDevExecutor(dev_executor);
118
119 device->Start();
120 dev_executor->Start();
121 }
122 else
123 {
124 device->Start();
125 }
126
127 return true;
128}
129
130bool DriverManager::UnloadDevice(Driver* driver, Device* device)
131{

Callers

nothing calls this directly

Calls 9

GetNameMethod · 0.80
GetDeviceStatusMethod · 0.45
CreateMethod · 0.45
SetNameMethod · 0.45
InitMethod · 0.45
BindDeviceMethod · 0.45
StartMethod · 0.45
ProbeDeviceMethod · 0.45
GetDeviceMethod · 0.45

Tested by

no test coverage detected