inline void SystemWidget::SwitchKernel() { #ifdef KOBO KoboModel model = DetectKoboModel(); if (model != KoboModel::MINI && model != KoboModel::GLO && model != KoboModel::TOUCH2 && model != KoboModel::GLO_HD && model != KoboModel::AURA2 && ShowMessageBox(_T("This feature was designed for the Kobo Mini, Touch 2.0, Glo HD and Aura 2, but this is not one. Use at your own risk. Continue?"), _T("USB-OTG"), MB_YESNO) != IDYES) return; const char *otg_kernel_image, *kobo_kernel_image; switch (model) { case KoboModel::GLO_HD: case KoboModel::TOUCH2: otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.glohd.otg"; kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.glohd"; break; case KoboModel::AURA2: otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.aura2.otg"; kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.aura2"; break; default: otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.otg"; kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.kobo"; } const char *kernel_image = IsKoboOTGKernel() ? kobo_kernel_image : otg_kernel_image; if (!KoboInstallKernel(kernel_image)) { ShowMessageBox(_T("Failed to activate kernel."), _("Error"), MB_OK); return; } KoboReboot(); #endif }
inline void SystemWidget::SwitchKernel() { #ifdef KOBO const char *otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.otg"; const char *kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.kobo"; const char *kernel_image = IsKoboOTGKernel() ? kobo_kernel_image : otg_kernel_image; if (!KoboInstallKernel(kernel_image)) { ShowMessageBox(_T("Failed to activate kernel."), _("Error"), MB_OK); return; } KoboReboot(); #endif }
inline void SystemWidget::SwitchKernel() { #ifdef KOBO if (DetectKoboModel() != KoboModel::MINI && ShowMessageBox(_T("This feature was designed for the Kobo Mini, but this is not one. Use at your own risk. Continue?"), _T("USB-OTG"), MB_YESNO) != IDYES) return; const char *otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.otg"; const char *kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.kobo"; const char *kernel_image = IsKoboOTGKernel() ? kobo_kernel_image : otg_kernel_image; if (!KoboInstallKernel(kernel_image)) { ShowMessageBox(_T("Failed to activate kernel."), _("Error"), MB_OK); return; } KoboReboot(); #endif }