Allow image and LUT to be located either in ram or flash

This commit is contained in:
BlackMark 2022-06-03 16:55:24 +02:00
parent 4d73d7a662
commit 3599979cc4
4 changed files with 196 additions and 193 deletions

@ -1 +1 @@
Subproject commit 8d8369440c2a3ea25c7c5ca31c16e790746eede0
Subproject commit 3d45d2a4b393724f3eb618d49936adc7ee168d1b

@ -1 +1 @@
Subproject commit f9014aea6cbbb1ea76f30148a64e6c3fc3152dcd
Subproject commit ceec87f9219c1a380ff29dd93545d2596d9c8165

View File

@ -6,7 +6,9 @@
#include <cstdint>
constexpr auto RLE_IMAGE [[gnu::progmem]] = std::tuple{
#include "flash/flash.hpp"
constexpr auto RLE_IMAGE = flash::Wrapper{std::tuple{
std::to_array<std::pair<std::uint8_t, std::uint8_t>>({
{255, 0xff}, {17, 0xff}, {1, 0x0f}, {3, 0xff}, {1, 0xc0}, {2, 0x00}, {1, 0x01}, {7, 0xff}, {1, 0xfe},
{1, 0x07}, {1, 0xf0}, {1, 0x3f}, {2, 0xff}, {1, 0xfe}, {1, 0x07}, {1, 0xf0}, {1, 0x3e}, {1, 0x07},
@ -283,4 +285,4 @@ constexpr auto RLE_IMAGE [[gnu::progmem]] = std::tuple{
{22, 0xff}, {1, 0xfe}, {1, 0x00}, {1, 0x3f}, {23, 0xff}, {1, 0x81}, {255, 0xff}, {255, 0xff}, {255, 0xff},
{255, 0xff}, {81, 0xff},
}),
};
}};

View File

@ -24,8 +24,9 @@ using eink::Voltage::VSH2;
using eink::Voltage::VSL1;
using eink::Voltage::VSS1;
constexpr auto ORIGINAL_WAVEFORM_LUT
[[gnu::progmem]] =
constexpr auto
ORIGINAL_WAVEFORM_LUT =
flash::Wrapper<eink::Waveform>{
eink::Waveform{
.lut = {{{
{.phaseD = VSH1, .phaseC = VSH1, .phaseB = VSS1, .phaseA = VSH1},
@ -210,11 +211,11 @@ constexpr auto ORIGINAL_WAVEFORM_LUT
},
.frameRates = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
.subPhaseGateStates = {},
};
}};
static inline constexpr auto createFastWaveformLut(const eink::Waveform &original)
static inline consteval auto createFastWaveformLut(const flash::Wrapper<eink::Waveform> &original)
{
auto fastWaveformLut = original;
auto fastWaveformLut = original.value;
for (auto &timing : fastWaveformLut.timings) {
timing.repeatSubPhaseAB = 0;
@ -222,10 +223,10 @@ static inline constexpr auto createFastWaveformLut(const eink::Waveform &origina
timing.repeat = 0;
}
return fastWaveformLut;
return flash::Wrapper{fastWaveformLut};
}
constexpr auto FAST_WAVEFORM_LUT [[gnu::progmem]] = createFastWaveformLut(ORIGINAL_WAVEFORM_LUT);
constexpr auto FAST_WAVEFORM_LUT = createFastWaveformLut(ORIGINAL_WAVEFORM_LUT);
void dumpOTP(eink_t &einkDisplay, uart_t &serial)
{