diff --git a/plugins/Kaleidoscope-Hardware-GD32-Eval/src/kaleidoscope/device/gd32/Eval.h b/plugins/Kaleidoscope-Hardware-GD32-Eval/src/kaleidoscope/device/gd32/Eval.h index 81ccc265..b88ae4dc 100644 --- a/plugins/Kaleidoscope-Hardware-GD32-Eval/src/kaleidoscope/device/gd32/Eval.h +++ b/plugins/Kaleidoscope-Hardware-GD32-Eval/src/kaleidoscope/device/gd32/Eval.h @@ -23,6 +23,7 @@ #include "kaleidoscope/device/Base.h" #include "kaleidoscope/driver/storage/GD32Flash.h" +#include "kaleidoscope/driver/bootloader/gd32/Base.h" namespace kaleidoscope { namespace device { @@ -31,6 +32,7 @@ namespace gd32 { struct EvalStorageProps: kaleidoscope::driver::storage::GD32FlashProps {}; struct EvalProps: kaleidoscope::device::BaseProps { + typedef kaleidoscope::driver::bootloader::gd32::Base BootLoader; typedef EvalStorageProps StorageProps; typedef kaleidoscope::driver::storage::GD32Flash Storage; static constexpr const char *short_name = "GD32Eval"; diff --git a/src/kaleidoscope/driver/bootloader/gd32/Base.h b/src/kaleidoscope/driver/bootloader/gd32/Base.h new file mode 100644 index 00000000..73ca94f6 --- /dev/null +++ b/src/kaleidoscope/driver/bootloader/gd32/Base.h @@ -0,0 +1,37 @@ +/* -*- mode: c++ -*- + * kaleidoscope::driver::bootloader::gd32::base -- GD32 Base Bootloader Driver + * Copyright (C) 2021 Keyboard.io, Inc + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#pragma once + +#include "kaleidoscope/driver/bootloader/Base.h" + +namespace kaleidoscope { +namespace driver { +namespace bootloader { +namespace gd32 { + +class Base: public kaleidoscope::driver::bootloader::Base { + public: + static void rebootBootloader() { + NVIC_SystemReset(); + } +}; + +} // namespace gd32 +} // namespace bootloader +} // namespace driver +} // namespace kaleidoscope