Merge pull request #8 from keyboardio/f/dont-break-on-x86

This change hacks up HostPowerManagement to make it a noop on X86
pull/365/head
Jesse Vincent 6 years ago committed by GitHub
commit 282926214a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,7 @@
// This is a terrible hack until Arduino#6964 gets implemented. // This is a terrible hack until Arduino#6964 gets implemented.
// It makes the `_usbSuspendState` symbol available to us. // It makes the `_usbSuspendState` symbol available to us.
extern u8 _usbSuspendState; extern uint8_t _usbSuspendState;
namespace kaleidoscope { namespace kaleidoscope {
@ -30,6 +30,8 @@ bool HostPowerManagement::was_suspended_ = false;
bool HostPowerManagement::initial_suspend_ = true; bool HostPowerManagement::initial_suspend_ = true;
EventHandlerResult HostPowerManagement::beforeEachCycle() { EventHandlerResult HostPowerManagement::beforeEachCycle() {
#ifdef __AVR__
if ((_usbSuspendState & (1 << SUSPI))) { if ((_usbSuspendState & (1 << SUSPI))) {
if (!initial_suspend_) { if (!initial_suspend_) {
if (!was_suspended_) { if (!was_suspended_) {
@ -47,6 +49,7 @@ EventHandlerResult HostPowerManagement::beforeEachCycle() {
hostPowerManagementEventHandler(Resume); hostPowerManagementEventHandler(Resume);
} }
} }
#endif
return EventHandlerResult::OK; return EventHandlerResult::OK;
} }

Loading…
Cancel
Save