Signed-off-by: Gergely Nagy <algernon@keyboard.io>pull/1086/head
parent
a524bd21a6
commit
17ba4fb8e8
@ -0,0 +1,47 @@
|
||||
/* -*- mode: c++ -*-
|
||||
* kaleidoscope::driver::storage::GD32Flash -- Storage driver with GD32 flash backend
|
||||
* 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
|
||||
|
||||
#if defined(ARDUINO_ARCH_GD32) || defined(KALEIDOSCOPE_VIRTUAL_BUILD)
|
||||
|
||||
#include "kaleidoscope/driver/storage/Base.h"
|
||||
#include "FlashStorage.h"
|
||||
#include "FlashAsEEPROM.h"
|
||||
|
||||
namespace kaleidoscope {
|
||||
namespace driver {
|
||||
namespace storage {
|
||||
|
||||
struct GD32FlashProps : kaleidoscope::driver::storage::BaseProps {
|
||||
static constexpr uint16_t length = 10240;
|
||||
};
|
||||
|
||||
template <typename _StorageProps>
|
||||
class GD32Flash: public EEPROMClass<_StorageProps::length> {
|
||||
public:
|
||||
void setup() {
|
||||
EEPROMClass<_StorageProps::length>::begin();
|
||||
}
|
||||
void commit() {}
|
||||
};
|
||||
|
||||
} // namespace storage
|
||||
} // namespace driver
|
||||
} // namespace kaleidoscope
|
||||
|
||||
#endif
|
Loading…
Reference in new issue