gd32: Add a "bootloader"

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/1086/head
Gergely Nagy 3 years ago committed by Jesse Vincent
parent 17ba4fb8e8
commit 4b8951d67c
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -23,6 +23,7 @@
#include "kaleidoscope/device/Base.h" #include "kaleidoscope/device/Base.h"
#include "kaleidoscope/driver/storage/GD32Flash.h" #include "kaleidoscope/driver/storage/GD32Flash.h"
#include "kaleidoscope/driver/bootloader/gd32/Base.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {
@ -31,6 +32,7 @@ namespace gd32 {
struct EvalStorageProps: kaleidoscope::driver::storage::GD32FlashProps {}; struct EvalStorageProps: kaleidoscope::driver::storage::GD32FlashProps {};
struct EvalProps: kaleidoscope::device::BaseProps { struct EvalProps: kaleidoscope::device::BaseProps {
typedef kaleidoscope::driver::bootloader::gd32::Base BootLoader;
typedef EvalStorageProps StorageProps; typedef EvalStorageProps StorageProps;
typedef kaleidoscope::driver::storage::GD32Flash<StorageProps> Storage; typedef kaleidoscope::driver::storage::GD32Flash<StorageProps> Storage;
static constexpr const char *short_name = "GD32Eval"; static constexpr const char *short_name = "GD32Eval";

@ -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 <http://www.gnu.org/licenses/>.
*/
#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
Loading…
Cancel
Save