Device cleanup (#592)
- Replaced device_find_\* usage by device_get_\* variants. - Removed deprecated device_find_\* functions. - Improved reliability of Bluetooth scanning, pairing, connection, and HID host lifecycle behavior, including peer auto-connect handling. - Improved Bluetooth/USB status indicators and clarified “Eject failed” alerts with the affected mount path.
This commit is contained in:
committed by
GitHub
parent
3354924359
commit
d1f06cb774
@@ -19,7 +19,7 @@ constexpr auto* TAG = "RtcTime";
|
||||
|
||||
Device* RtcTimeService::findRtcDevice() {
|
||||
if (!rtcDevice) {
|
||||
rtcDevice = device_find_first_active_by_type(&RTC_TYPE);
|
||||
device_get_first_active_by_type(&RTC_TYPE, &rtcDevice);
|
||||
}
|
||||
return rtcDevice;
|
||||
}
|
||||
@@ -130,6 +130,11 @@ void RtcTimeService::onStop(ServiceContext& serviceContext) {
|
||||
kernel::unsubscribeSystemEvent(timeEventSubscription);
|
||||
timeEventSubscription = 0;
|
||||
}
|
||||
|
||||
if (rtcDevice) {
|
||||
device_put(rtcDevice);
|
||||
rtcDevice = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
extern const ServiceManifest manifest = {
|
||||
|
||||
Reference in New Issue
Block a user