[usb] Enable the USB core on calculator plugged.

Change-Id: I5b8ab068936524e775bb77a4569a2601e5a9844a
This commit is contained in:
Léa Saviot
2018-03-30 15:56:06 +02:00
parent 29ab948fe6
commit ff82ca26f2
4 changed files with 11 additions and 0 deletions

View File

@@ -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;

View File

@@ -5,6 +5,7 @@ namespace Ion {
namespace USB {
bool isPlugged();
void removeSoftDisconnect();
void DFU();
}

View File

@@ -13,6 +13,10 @@ bool isPlugged() {
return Device::VbusPin.group().IDR()->get(Device::VbusPin.pin());
}
void removeSoftDisconnect() {
OTG.DCTL()->setSDIS(false);
}
}
}

View File

@@ -4,5 +4,8 @@ bool Ion::USB::isPlugged() {
return false;
}
void Ion::USB::removeSoftDisconnect() {
}
void Ion::USB::DFU() {
}