mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 12:10:03 +02:00
[usb] Enable the USB core on calculator plugged.
Change-Id: I5b8ab068936524e775bb77a4569a2601e5a9844a
This commit is contained in:
@@ -12,6 +12,9 @@ USBTimer::USBTimer(AppsContainer * container) :
|
||||
bool USBTimer::fire() {
|
||||
bool needRedrawing = false;
|
||||
if (Ion::USB::isPlugged()) {
|
||||
if (!m_previousPluggedState) {
|
||||
Ion::USB::removeSoftDisconnect();
|
||||
}
|
||||
if (!m_previousPluggedState && GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate) {
|
||||
m_container->displayExamModePopUp(false);
|
||||
needRedrawing = true;
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Ion {
|
||||
namespace USB {
|
||||
|
||||
bool isPlugged();
|
||||
void removeSoftDisconnect();
|
||||
void DFU();
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@ bool isPlugged() {
|
||||
return Device::VbusPin.group().IDR()->get(Device::VbusPin.pin());
|
||||
}
|
||||
|
||||
void removeSoftDisconnect() {
|
||||
OTG.DCTL()->setSDIS(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,8 @@ bool Ion::USB::isPlugged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Ion::USB::removeSoftDisconnect() {
|
||||
}
|
||||
|
||||
void Ion::USB::DFU() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user