Add C++ standard library

This commit is contained in:
BlackMark 2022-05-29 15:36:35 +02:00
parent 9b56239dce
commit 4684a8f80f
5 changed files with 10 additions and 5 deletions

3
.gitmodules vendored
View File

@ -16,3 +16,6 @@
[submodule "eink/spi"]
path = eink/spi
url = git@git.blackmark.me:avr/spi.git
[submodule "eink/avr-libstdcpp"]
path = eink/avr-libstdcpp
url = git@github.com:modm-io/avr-libstdcpp.git

View File

@ -10,7 +10,7 @@ FUSES = -U lfuse:w:0xff:m -U hfuse:w:0xd7:m -U efuse:w:0xfd:m
# Parameters
PROJECT = $(lastword $(subst /, ,$(CURDIR)))
INCS =
INCS = -isystem avr-libstdcpp/include
LIBS =
DEFS = -DNDEBUG

1
eink/avr-libstdcpp Submodule

@ -0,0 +1 @@
Subproject commit d289637d14cb9928a3690be4f2934aa2920f0f38

View File

@ -140,7 +140,7 @@
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -Wno-array-bounds -std=c++20</avrgcccpp.compiler.miscellaneous.OtherFlags>
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -Wno-array-bounds -std=c++20 -isystem"%24(ProjectDir)/avr-libstdcpp/include"</avrgcccpp.compiler.miscellaneous.OtherFlags>
<avrgcccpp.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
@ -199,7 +199,7 @@
<avrgcccpp.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcccpp.compiler.optimization.DebugLevel>
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++20</avrgcccpp.compiler.miscellaneous.OtherFlags>
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++20 -isystem"%24(ProjectDir)/avr-libstdcpp/include"</avrgcccpp.compiler.miscellaneous.OtherFlags>
<avrgcccpp.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>

View File

@ -1,18 +1,19 @@
#include "clock.hpp"
#include <array>
#include "eink/eink.hpp"
#include "flash/flash.hpp"
#include "io/io.hpp"
#include "spi/spi.hpp"
#include "uart/uart.hpp"
#include "util/array.hpp"
using uart_t = uart::Uart0<>;
REGISTER_UART0_INT_VECTORS(uart_t);
//////////////////////////////////////////////////////////////////////////
constexpr auto IMAGE [[gnu::progmem]] = util::to_array<uint8_t>({
constexpr auto IMAGE [[gnu::progmem]] = std::to_array<uint8_t>({
0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x85, 0x79, 0x79, 0x79, 0x79, 0x79,
0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79,
0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x85, 0x79, 0x79, 0x79,