From 720d29e2712e43eb6f3a6082732a1cb01e3401ad Mon Sep 17 00:00:00 2001 From: Guy Turcotte Date: Sun, 27 Dec 2020 13:46:10 -0500 Subject: [PATCH] Compile OK, first simple test OK --- README.md | 37 +- .../api/v1/query/client-vscode/query.json | 1 + build/CMakeCache.txt | 360 ++++++++ build/CMakeFiles/3.16.3/CMakeCCompiler.cmake | 76 ++ .../CMakeFiles/3.16.3/CMakeCXXCompiler.cmake | 88 ++ .../3.16.3/CMakeDetermineCompilerABI_C.bin | Bin 0 -> 16544 bytes .../3.16.3/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 16560 bytes build/CMakeFiles/3.16.3/CMakeSystem.cmake | 15 + .../3.16.3/CompilerIdC/CMakeCCompilerId.c | 671 ++++++++++++++ build/CMakeFiles/3.16.3/CompilerIdC/a.out | Bin 0 -> 16704 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 660 ++++++++++++++ build/CMakeFiles/3.16.3/CompilerIdCXX/a.out | Bin 0 -> 16720 bytes build/CMakeFiles/CMakeOutput.log | 427 +++++++++ build/CMakeFiles/cmake.check_cache | 1 + doc/esp-idf-version.pu | 28 +- lib/drivers/src/battery.cpp | 7 +- lib/drivers/src/battery.hpp | 16 +- lib/drivers/src/eink.cpp | 216 +++++ lib/drivers/src/eink.hpp | 135 ++- lib/drivers/src/eink_10.cpp | 302 +----- lib/drivers/src/eink_10.hpp | 152 +-- lib/drivers/src/eink_6.cpp | 302 +----- lib/drivers/src/eink_6.hpp | 144 +-- lib/drivers/src/frame_buffer.hpp | 47 + lib/drivers/src/inkplate_platform.cpp | 4 +- lib/drivers/src/inkplate_platform.hpp | 68 +- lib/drivers/src/{mcp.cpp => mcp23017.cpp} | 86 +- lib/drivers/src/{mcp.hpp => mcp23017.hpp} | 62 +- lib/drivers/src/touch_keys.cpp | 22 +- lib/drivers/src/touch_keys.hpp | 20 +- lib/graphical/src/adafruit_gfx.cpp | 88 +- lib/graphical/src/adafruit_gfx.hpp | 8 +- lib/graphical/src/defines.hpp | 11 + lib/graphical/src/graphics.cpp | 123 ++- lib/graphical/src/graphics.hpp | 65 +- lib/graphical/src/image.cpp | 17 +- lib/graphical/src/image.hpp | 118 ++- lib/graphical/src/image_bmp.cpp | 111 ++- lib/graphical/src/image_dither.cpp | 32 +- lib/graphical/src/image_jpeg.cpp | 59 +- lib/graphical/src/image_png.cpp | 107 +-- lib/graphical/src/inkplate.cpp | 25 + lib/{inkplate => graphical}/src/inkplate.hpp | 28 +- lib/graphical/src/pngle.cpp | 182 ++-- lib/graphical/src/print.cpp | 25 +- lib/graphical/src/print.hpp | 14 +- lib/graphical/src/printable.hpp | 2 +- lib/graphical/src/shapes.cpp | 15 +- lib/graphical/src/shapes.hpp | 47 +- .../{stdio_noniso.cpp => stdlib_noniso.cpp} | 5 +- .../{stdio_noniso.hpp => stdlib_noniso.hpp} | 4 +- lib/graphical/src/tjpg_decoder.cpp | 4 +- lib/graphical/src/tjpgd.cpp | 30 +- lib/graphical/src/tjpgd.hpp | 2 +- lib/graphical/src/wstring.cpp | 863 ------------------ lib/graphical/src/wstring.hpp | 334 ------- lib/inkplate/library.json | 19 - lib/inkplate/src/inkplate.cpp | 213 ----- lib/services/src/network_client.cpp | 5 +- lib/services/src/network_client.hpp | 20 +- lib/services/src/wire.cpp | 5 + lib/services/src/wire.hpp | 10 +- lib/tools/src/miniz.cpp | 8 +- src/logo.hpp | 381 ++++++++ src/main.cpp | 72 +- 65 files changed, 4022 insertions(+), 2977 deletions(-) create mode 100644 build/.cmake/api/v1/query/client-vscode/query.json create mode 100644 build/CMakeCache.txt create mode 100644 build/CMakeFiles/3.16.3/CMakeCCompiler.cmake create mode 100644 build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake create mode 100755 build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin create mode 100755 build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin create mode 100644 build/CMakeFiles/3.16.3/CMakeSystem.cmake create mode 100644 build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c create mode 100755 build/CMakeFiles/3.16.3/CompilerIdC/a.out create mode 100644 build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100755 build/CMakeFiles/3.16.3/CompilerIdCXX/a.out create mode 100644 build/CMakeFiles/CMakeOutput.log create mode 100644 build/CMakeFiles/cmake.check_cache create mode 100644 lib/drivers/src/eink.cpp create mode 100644 lib/drivers/src/frame_buffer.hpp rename lib/drivers/src/{mcp.cpp => mcp23017.cpp} (79%) rename lib/drivers/src/{mcp.hpp => mcp23017.hpp} (67%) create mode 100644 lib/graphical/src/defines.hpp create mode 100644 lib/graphical/src/inkplate.cpp rename lib/{inkplate => graphical}/src/inkplate.hpp (67%) rename lib/graphical/src/{stdio_noniso.cpp => stdlib_noniso.cpp} (97%) rename lib/graphical/src/{stdio_noniso.hpp => stdlib_noniso.hpp} (95%) delete mode 100644 lib/graphical/src/wstring.cpp delete mode 100644 lib/graphical/src/wstring.hpp delete mode 100644 lib/inkplate/library.json delete mode 100644 lib/inkplate/src/inkplate.cpp create mode 100644 src/logo.hpp diff --git a/README.md b/README.md index c17fc8f..63b2f06 100644 --- a/README.md +++ b/README.md @@ -10,26 +10,45 @@ This project is a working example. You can build it using PlatformIO. It will dr ## Modifications done to the Arduino Inkplate Source code -As you can expect, the ESP-IDF framework is quit different than the Arduino framework. The porting effort of the Inkplate source code done here is not just a transformation to make it runs, but also getting it inline with the available packages available with the ESP-IDF. Many aspects must be transformed in this regard. Here is a list of the changes being done: +As you can expect, the ESP-IDF framework is quit different than the Arduino framework. The porting effort of the Inkplate source code done here is not just a transformation to make it runs, but also getting it inline with the available packages available with the ESP-IDF. Many aspects must be transformed in this regard. + +The code is also being transformed to be closer to C++ functionalities, targetting a stronger usage of the language elements that will sustain the author's software developement. A bit less C and more C++... + +The source code is divided in two major groups: the low-level device drivers group, under the `inkplate_platform` class, and the *mid-level* graphical group, under the `inkplate` class. The coupling between these groups is minimal: one can take the `inkplate-platform` and build on top of it without the graphical portion. The graphical group rely on the drivers. The coupling is light as it is done through aggregation instead of inheritence. + +Here is a list of the changes being done: ### Global changes -- Give the overall source code a transformation to use what is called *modern C++*, alligned with C++17 +Some of these changes have been done partially and will be completed in subsequent versions. + +- Give the overall drivers source code a transformation to use what is called *modern C++*, alligned with C++11 and beyond - All .h files are renamed .hpp -- macro definitions (`#define`) are reduced to a minimum -- `enum class` are used everywhere possible +- macro definitions (`#define`) are reduced to a bare minimum +- `enum class` are used everywhere possible in the drivers group - source code filenames are all in lowercase +- all driver and support files using the following naming conventions: + - class names are in ChamelCase + - constants are in UPPER_CASE + - variables and method names are in lower_case +- all graphical libraries and class remains with their Arduino naming convention +- classes inheritence are reduced to insure independance of usage of the drivers group. By design, the grapphical portion remains as defined for the Arduino framework with some internal transformation to be more inline with C++. +- A TAG is added in the protected/private portion of driver classes in support of the ESP-IDF Logging mechanism (ESP_LOGX defines) +- min() definition replaced with std::min() +- _swap...() definitions replaced with std::swap() +- String replaced with std::string (No PROGMEM support required with the ESP32) ### SdCard -- The module is used only to initialize the ESP-IDF drivers (SPI and FAT filesystem are used). The card can then be accessed through the standard C++/C capabilities. All filenames located on the card must be prefixed with `/sdcard`. +- The module is used only to initialize the ESP-IDF drivers (SPI and FAT filesystem are used). The card can then be accessed through the standard C++/C capabilities. All filenames located on the card must be prefixed with `/sdcard/`. -### Image (.hpp, .cpp) +### Image (image.hpp, image.cpp) -- the `drawXXXXFromWeb(WiFiClient *s, ...)` methods are no longer available. -- the `bool drawXXXXFromSd(SdFile *p, ...)` methods are renamed `bool drawXXXXFromFile(File *p, ...)`. +- the `drawXXXXFromWeb(WiFiClient *s, ...)` methods are no longer available. WiFiCLient doesn't exists in an ESP-IDF context. +- the `bool drawXXXXFromSd(SdFile *p, ...)` methods are renamed `bool drawXXXXFromFile(FILE *p, ...)`. This allow for accessing files located in a SPIFFS partition (using `/spiffs/` filename prefix) as well as SDCard files (using `/sdcard/` filename prefix) or any other file system integrated with ESP-IDF. +- functions-like related to image / pixel manipulation present in `defines.h` have been migrated here. Namely: RED, BLUE, GREEN, READ32, READ16, ROWSIZE, RGB8BIT, RGB3BIT. They are now inline functions with appropriate types named red, blue, green, read32, read16, rowSize, rgb8Bit, rgb3Bit. -## ESP-IDF configuration specifics +## ESP-IDF configuration specifics for InkPlate devices An InkPlate application requires some functionalities to be properly set up within the ESP-IDF. The following elements have been done for this project and can be used as a reference for other projects: diff --git a/build/.cmake/api/v1/query/client-vscode/query.json b/build/.cmake/api/v1/query/client-vscode/query.json new file mode 100644 index 0000000..7730820 --- /dev/null +++ b/build/.cmake/api/v1/query/client-vscode/query.json @@ -0,0 +1 @@ +{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2}]} \ No newline at end of file diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt new file mode 100644 index 0000000..cb40fac --- /dev/null +++ b/build/CMakeCache.txt @@ -0,0 +1,360 @@ +# This is the CMakeCache file. +# For build in directory: /home/turgu1/Dev/ESP-IDF-InkPlate/build +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=/bin/addr2line + +//Path to a program. +CMAKE_AR:FILEPATH=/bin/ar + +//No help, variable specified on the command line. +CMAKE_BUILD_TYPE:STRING=Debug + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/bin/c++ + +//A wrapper around 'ar' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_CXX_COMPILER_AR:FILEPATH=/bin/gcc-ar-9 + +//A wrapper around 'ranlib' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/bin/gcc-ranlib-9 + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//No help, variable specified on the command line. +CMAKE_C_COMPILER:FILEPATH=/bin/x86_64-linux-gnu-gcc-8 + +//A wrapper around 'ar' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_C_COMPILER_AR:FILEPATH=/bin/gcc-ar-8 + +//A wrapper around 'ranlib' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_C_COMPILER_RANLIB:FILEPATH=/bin/gcc-ranlib-8 + +//Flags used by the C compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the C compiler during DEBUG builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the C compiler during RELEASE builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//No help, variable specified on the command line. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/bin/ld + +//Program used to build from build.ninja files. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/ninja + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=ESP-IDF-InkPlate + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/bin/ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=/bin/readelf + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +ESP-IDF-InkPlate_BINARY_DIR:STATIC=/home/turgu1/Dev/ESP-IDF-InkPlate/build + +//Value Computed by CMake +ESP-IDF-InkPlate_SOURCE_DIR:STATIC=/home/turgu1/Dev/ESP-IDF-InkPlate + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/turgu1/Dev/ESP-IDF-InkPlate/build +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=16 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR +CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB +CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER_AR +CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB +CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Ninja +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/turgu1/Dev/ESP-IDF-InkPlate +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake b/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake new file mode 100644 index 0000000..44c11e6 --- /dev/null +++ b/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake @@ -0,0 +1,76 @@ +set(CMAKE_C_COMPILER "/bin/x86_64-linux-gnu-gcc-8") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "GNU") +set(CMAKE_C_COMPILER_VERSION "8.4.0") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Linux") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_C_SIMULATE_VERSION "") + + + +set(CMAKE_AR "/bin/ar") +set(CMAKE_C_COMPILER_AR "/bin/gcc-ar-8") +set(CMAKE_RANLIB "/bin/ranlib") +set(CMAKE_C_COMPILER_RANLIB "/bin/gcc-ranlib-8") +set(CMAKE_LINKER "/bin/ld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCC 1) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/8/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/8;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake b/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..466fa4c --- /dev/null +++ b/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake @@ -0,0 +1,88 @@ +set(CMAKE_CXX_COMPILER "/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "GNU") +set(CMAKE_CXX_COMPILER_VERSION "9.3.0") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") + +set(CMAKE_CXX_PLATFORM_ID "Linux") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + +set(CMAKE_AR "/bin/ar") +set(CMAKE_CXX_COMPILER_AR "/bin/gcc-ar-9") +set(CMAKE_RANLIB "/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "/bin/gcc-ranlib-9") +set(CMAKE_LINKER "/bin/ld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCXX 1) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000000000000000000000000000000000000..30ab86cc4dae8db7eb6c11642eb7eb8994a62c66 GIT binary patch literal 16544 zcmeHOZ)_Y#6`%9j@uf}9mo#bIB-C4yN-^Mzo953Y)a1_g*?Y)IN@Ax$sk>eK&i0A( zow?g52`16U@kxQE|g+zi<{#2Mh6$Yi$DFm4|@$ufw zd*|KtnWBQk2X>^r-^_2`do%lHW^ZP9<`eOrt{R_DaPW%{2~0&piiuLjqx&fW5ET)z z7JlC&wu)7du9ck1k1Bv%6<(=vVt{x*AnG+@qzZ0TG?btM*ANl)RtlHvR1Tw{`#?RJ zMQP?4Z%_e@%vZ|Os6-czkRGF54}CM=qV(q5oT!msb`Y{2CQ(m>l{_?u3WU>C9wYk` zeS%kn{OLwbSrLqGy%VJ8#!k{>#4<1(d(BF|oAMrHJx!Vs5f?t7Xu-(keFXHRUnu{b zfSdU!mA6tmgvkGl}@USSx68$APNwjwuyTZG|dxVkbJ!B+P`P6W_V5RcChdMI3Y^v8B z$e`x%Xf8{dh7zqRDC?uV$iDP}2hoSzFN&MftI@k3pt|$;`QyB|1ZkeAY1A(Z@ zXP(oq98^5E6_&?g*2Z(4FmKMrbKgOJ-p2D7Kz_l-)1wY)FL)mCJm7i2^ML08&jX$Z zJP&vt__sXp*M_^_(kHJ4^mBE;*eQhmnQ5!0d_|vpJ}@Ko%X^*y`pxpaUj=Ar5-1O; zAIemxkm>tgPn51cqL+TBPyS*4!QP&!y0b9#)u+}rNNBqRmdYFRpz^o#`c&JOA)-&! zeGy^*g0&HfK8$fFdUbiWq3H}3JVOZbX(_*F0HJwNzqIJrOY{1rxr4gz1^w!xwE+y= zO9lev*`bCes2A&Feb2OEwkW>8PoHe7!Khw(&03?MYg+}0x#n`YJeP!@7wT@os@vBO zx(@w6Jr0>@s1Ni?r>^Ox;_Qp@n^?_r@oV}8eQM*6g5aI+*M=INo%Y3VGW(*7z1cs5 zW?~QZOtlqYCK+fUph;FjFmV1MxUJV>HA+T{u$frWPj}8Sbyx1m@zXn6mDqxG}ceH54I$hE8Dr! zvNGHI@jT#p!1I9T0nY=T2RsjW9`HQidBF34=Yjtd5BMBk8-++5?mBXy0N?3yLq>AU z%AahF^rI^zZw{nS!hQiHd|Uh<#Ba3toonuma(N7J0q_D~V7^>F0eBtoTY!=4k2RQSe2zAbC&1Lq+R`K@qW1Y5XL7oGL;i`#aH?uKg&cu539UBSi= zH{AYs;EXu9`M~?`-!4BxqW;5honSeLV?di0T>GI;-AKfPp|dp|Yge6yf*}d748&7# zJqr0LK+zQpeW4~1Z2Y`G9@M64UguR;B@V8{DDhmQ1u=K;?Ho(DV+cpmUP;CaCFfad|v1OF=z@V-Xg$4JYu z%3j4aTrs)G60px(g*n;}c^9R5zvLE5^FB!2SBio6P2#!>1LxmZEax!&G;Ma|HPVS% zWOI{$jbW9QGMaduuQWbVc93sFH`IUj*TDPI?NzVhRJNa7iWK}zLmHy+DUsdTh zPQG4n|8nvH!R_SaR|{@mCx4sZe&pn#SJHTK@@s@vm0v4btMb9hxeKSA2EpUc$%7Hi z&ZxLwtgGy+x99p{$M<+u`8x!UXQ%vz$~boNFzTxGJHNQIGVYx6n}mqk85Q@#C=ONS z`6;ucgX61KTrV#%Du&Oi8W9v@E`P$#3&}t2;_o4zpMT1V5c?nky|z*x9?xBpU+xFo zbdTlo^OWsONcrXd#P?#=>ih(N%4V_4~azbEt7izMEND^#;TBW3Pb){Z{~ z-iJ?5S3AB+^6vgHFZt#D$`2LwRcZHUfv*wE$HiU1uZO#wrT-It{x<`!$ugWjrzO9< z|HOe`2ZJs|O8h@?9QcsfRB1=Hwhj38HOt3QKk_VO!zam(yWf_8ry_0ALRX*4L7j%yg!s4<8KHVSZ9BbhUX zGr0jXVdpZJ7DIIbo!-R(?VZ<;~HQkt~jm zPJoInWq_pR5bZc*ek|3|0mY;MzWAIM$Bvy56mQvfK)P_HHw84 z+}~2w&~K0)C=|$yJcwf$aNdT!g9mY{p0078=W$j|gbNd+mN@`uYd27N(4HVOG8{|<9#u0O9E7`c3PHg0L1 z!DdZ};F^K;d0oMHo&@n8(a(JUydFpchqui7Jdb4LbqR>bfHv&mxKOSH@`)qj&t&G>*yR({>(zXUmU{c%l+GR{{tRfOB0>7PRc z=cF|3E9(S4PwSTFG~@3>g-D;vVR^b8 zP6{=@7J|epJnL_(Fe<|OcI3We7mct%8rV3Fu}Qc-{QSfBBV2cfK6TtpF5_G-%i{F2 Qn*Nc9l33$Xa3#e*0f&4zdH?_b literal 0 HcmV?d00001 diff --git a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000000000000000000000000000000000000..89f78821c080a0bac7801e4d246023d487c5714b GIT binary patch literal 16560 zcmeHOZ)_Y#6`%9j$)!!smoyM58;2toOPR26|D@ulzq#0S7pN?L(HjgU$aRG31AsnXO54Kg&z@!rgP z=iT)g${&dj>_~UNncuuWvu|ehW^ZRc6N~pW_EZJhx1t3j`}-*9$+%GcKLhUO zBjj(Xeh5+g87aJCMezqgLOfcOn#xY~tj4v#0yk#sJR zNk5W;B379tD^aw}Y$BZ#z45-zE_0W@OWz~RzW#$|GF42Crb||;*nhAqlh3946GIu) z9L?r)q-iSAx`MJjDvBISA4Cvi$m62CA-w{l`$1|u&rhBg+GNo$>##+rG9nKGeBRh-tl#S=FI}-q4Wb; z>K3xR^NqgB#RrYbtH$IX=I-f_Pc@x_rLQrys#!wEIj~e+R|J)}&KOf2Uxkb@)$~P# zee>2jaD52#;Ce-Mrg`&8bbOu=9 z{+}L(N;EV8dX+~n8I|(P^ResL%+s+;##6@Bx*rE2I^S&!HUDth7rV~v^Dg%K@$+aV zdS861qXbVL(R=$UFGUCXD%Ya@(aQA!W2!X?^wIeC8`vka=FMu=ICsNuZQl87ibuS1 zHD0;gUHN0Qy7srmcD(m<7)UR95%415MZk-I7XdEMGXLKL-XH!STIBt!yiFsfSWT(}?pbKw2yb~Aq1{mlE%oqVJCbX_}5 zwQ=N>UsfAGPJX%IapvR$g8R$KuMphNPW~3b zXH?z~vpH0k=ex~<4$iYiaizMzs2tw68bnYOT=9e*7?OY5#cv^=?}N&U5PKm5qqf!_ zp4UB+UmOSAe2;$lzRGqcr2OJ|;{Rjy+W)MS4~dWl8AyCzy8w9~461D!vI0D*v{W2^ z0o6X}-y~k3E7kM+J1KM9qW--KyboL9>fg6X-aSr&GEj@h+ZNz`b;iR_fo~9t=gVH; z*T7ZI(C-cZKJ)^wN#D+|(~@62u7-gRiS@O9WUVOhYZ?~Mqfa2uLN=_B9rw8XGVq#B zjh;gcjEq4B(fsxJbM z^6q)`3dwIL`|`g}(0LVjY^PiPGVmJNv_k+6EyzDu?Ih-hi&n`h!;Yh2v2bj|w6f+f z9^5Fwp^aqT9L?m15*agT<%=aVQ63k=`D`JRvQkMs+}7S!UkHzkq|HRJn3ynAIjcA! zMv94S%1oBC*$Ggwl}wPd9HLzZ6Q4|V4GwmJqjV-!jCS_v!-aw{KNjEFp3aTrP1~Q` z$c7~e|8Rrlo+HtNF*A0k+k{glPTNUgcHe&}da$p{StF0L00rlG%$PwIjP4`C?2RAp zjK72SpZk&gFoJ|vY zX(DSSh5)Ui!ZFUJb8yP1AoN_`O6jAyvR)|W3#pQhtCkK&(9f*XHW?eUL(et_4)ZA4IExF>+^b&k)KmQ zL?*OhPY*!>pBY%6*PV>~{Kf5OImQ#9kIx`n=JhF~M$X*rCt6HF24l+lypCm@CPDV^ zzW%R3Jzf*n<4>AQg#0{6tn|fs#IM1}uCI|EBb#F#E;Byk(&zOvBg-wN|1Fn(gcKO@ z_uHP__P*`X=k+)vKQFTl_xSxD>2v&rMv{a$zwF8F|3^@XO=SJBrlc9~R>j)4+yBp? z#;!lEDN)9`nx@Kd|1nazu^z|qo4}z6>+}Bv)3lI^K%G6YKI1%8+Vw?*q}vp-A7X3% zxqK5cXp8;x`YS~G?1$y)a=0k`Kp;orHJ>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if !defined(__STDC__) +# if (defined(_MSC_VER) && !defined(__clang__)) \ + || (defined(__ibmxl__) || defined(__IBMC__)) +# define C_DIALECT "90" +# else +# define C_DIALECT +# endif +#elif __STDC_VERSION__ >= 201000L +# define C_DIALECT "11" +#elif __STDC_VERSION__ >= 199901L +# define C_DIALECT "99" +#else +# define C_DIALECT "90" +#endif +const char* info_language_dialect_default = + "INFO" ":" "dialect_default[" C_DIALECT "]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/a.out b/build/CMakeFiles/3.16.3/CompilerIdC/a.out new file mode 100755 index 0000000000000000000000000000000000000000..6578fd4e44eee7dbe095f555382c03fe41c441a8 GIT binary patch literal 16704 zcmeHOeQX>@6`%9jvC}$tm((F{($-6oN)D|r&X;pZYjS7%>^)>BC9!Fc>#o*!XZyr` zn7ch{M+5>6g(H{-5sC5#Qq&@lApBAOXjBm3D6~KYs1YcHFA)I+gVNS54N4*P@!srv z=iT+WNR&Si+L89&%K*c-Yu{d4wy)o8T+{cJP{IW;P*~( zhgb!0EgWHDJL#1glfkrsnCd$? zB*4rZVw6VN7fsYg{w2@(U+roi8(KzBWkp|qtgBnw8QdA%BedAyfR;$+ljEs^k<1Scbfq1#;GH%dy%lK6?&=5BH zjB`8Sz!k-mYj)sy!W9SpNy1wl_~!|~azMy}V*$^H%T)``=Zw603(jK`@dXRc*BIhA zEV#U1BIp)318xS~47eF^GvH>x&48PM|CZ!V4ZWluR#GFx6enFl2 ze#1q1j^#a10Q_3{?k9oxTLj8O>pQa5BV>EWOR>_Wht<;W)tNsoJTTZlTXz|zrt0h( zO_I(FV5z)54=S&pR%bh(fr>g?_e~`GZW!yq^+BwI>(%9}{+1Ky_##n|FG=}5A4jrn zQN6I}RZ9!%h4}-j=Q;J#qR|8f?j{2b<*Q@<7Kn@WG2RoMQDBSWJwxhDXAM@>(u+o; zda833H0HOJ%jNk5{5)58C$v2yplj3r%Ok)10yf0R|92tt0u15wVrJFo2|B zQ~GnH-1Iwj=AuX4_uJxMvHyohA`eAIA`eHji(_L!f6GZcU)kR{GSIIaH8{Eue9WBb~;JjmF=-b4H2xy)oLoy-rzSIQB) zjE%2-D48#$a@pZ_vxI_F+0B*q5g|1u)4DO1%V&oB@#`vqdOkieO!Y)cPbcFBdY#}~@wb3mJ3Eth|ce4tJ68Unw? zV(}b1EId;I&!)!uhSP-O8iNq%qNa@+n=u<}P2L%hw>kXZ{A% zC%}&Ty$%!U7B>TK2HXs|8E`Y;X28vWn*lciZU#65ysnYgF~TE|EKD0&kk&b_p>~KC zi{4IcUN5(cFbt@vD*>>&cEc3Z*K(MzmMOeU*I~b~}E-*QXr^BZ?I< z>t3<8vhLo>^}>qq`Kt1_RrW8~<(n$kxgCeAvdXyhig#45OS}9AcoAYn%(@q@^7g7Y z--VWR@cOG2ua=h(vxfJx8sQU@j(oy83yGg~;O``y?~kSxA@)KAMr|b?^oOMv4iCHq z;`^Nh;RhGxqhG$?GCmCzk6511#{sVv|4Qfeb!lgv_&EmbDAnvdBV}$|7U%PTd+;vm z=&zrVJm2Tp#h+wl`S^K5+F9PePr(V)h~?wo5BNIBPdoju@c%#y;0iml(742xkCXcV z4~Pwweqoi{0bf_M{JQ8uoP{h@Cp*q@m<3$1$Z_>J;A?9(2)=JJ{%OP^B37cm0r5qN zZxGIX0AB?h^DsyI4U%N&S)c(JZ=o<-Ht9IYhiTkyC-!-=A0T=DpL-T?wBx*vE|HyW z40lnWUB|W-`;DVrgk0Y1l-&2lNjlySwSdcq{?oXSoTCtE!h*Wkgr}1lic7kzXs!T3_HUREup+GL=jvuL<*0bY9eH;>Qf7cJ4al7@W-K zCX;z%+5(LhQ?MZ{l^`h66>Br}aUsPg^umM)CZ@CC!lXvt| z7Mx5Q0)K+zIj9)PDfq=93X(b5lfmQ!4a$iG=yS`|H%F(b!F4dMXHszp2M0nBIza@X zQ!+5x>9Tv<1n2*7YrxxpEIhAc%JY9>OIfZX-2w;Bjai@Pe@qqNSxe=H|qRfam>j~R|R^m#tXRAE7)PW=Y~|2xd_IevbwVaopTn-vyk{5oLxOvC#8+{5%V zDnY?>#5}V;Kd+U8ejz$nmor(~p2YJ`-`9 z=fzAFa^{SmU@;37%qi>h{F$jj0kePS`F{a)QH1&M*J2i;{CrC2vi|=PFs%9t=`m$< ztj}$xPdM~>-p-WeR?;`;aZB-sNrCBgM~6A>J>~Gv&jC#N`JMec$M1R4=llzWB#EA* zCKH0WDZU3a43YKEkpR>CE0Si#>HjAHTlM+*gXw}ppZlNTUqA)t^86Uc^HtvO>y+m< z(?5W&-=fd+_#15iLSZ?xwbW+(6=2}lWB-+TG_2dkGDrP~;~xv_aX)?qFce{Zes3{H z6T2|*tcCTN-T^8`{(&xJ1MdsmZ#IdO{ z71p;>9y?aiqhwH}3mdQFd*R@C`2M#VFpk}-e-{53pbR*SvtN^obJ6PhFNI8rMu&o< GDgFiGHjbtM literal 0 HcmV?d00001 diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp b/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 0000000..69cfdba --- /dev/null +++ b/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,660 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out b/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out new file mode 100755 index 0000000000000000000000000000000000000000..c8684265455284359fc556a1ef0b98aa7a612508 GIT binary patch literal 16720 zcmeHOZ)_Y#6`%9jiIXPhOX@TxY3glABq!9Dvy-?^T9Z55=j@?N(k6E6;=0S)ceYR5 zA9J@y?243t)1p%_L~11Z0i>u%2#KHqABu`pa1@#XBD6tO2?_`ci0Yz{x`iSGX^!`1 z-#hQFFBPJE0qsb)znS0rGqZ1I_jYz?J{yVkRCzptlUICHU@7D`nGgy5dnp4D676C& z95;zO#WE;YOU{&sOaQ5wE?3#HmUu59+BION0^VuTP=lGcg@|Z(tJH)Ig2X83JkYKN z1ypw8ZfYkZ%ggmCXbee_$1+|<1xSomJ8a5)vlNT@4m*aZK9!K|uqaOSN@1VodPYPVsc2VtOez-)YxRc24XjJ4UPn(~+x2{6DGh0kS)*NH@ZX_nWj}!b_6cw^gB*oX_C-CFQNDK5&@0*_-+pby#g_)Q-&6m~sTc0cun(*gbughl4+$(| z9_v6I^ZY*tIU37=mlD57OX3!XcHor?vJJqkt-$vJr&QpFZ^7RN{N@V!0^&D};c63_ zHawwgBgu@ON4_GH)buy$8Bd z*-WBWA4;L+XgZrAOU+cRs3_ZGMv-Ibfe2y@d0Z4WBv)W`@1eHy^~u+Tvc?oF&~?lF zEIFtRnR4d2?04{rV(K+G_#E+ygZ~2YO%DEP;xF$LGT~Uj^WijW;rX0VHfP~^Y$88z z;rSXve!;@a`z4ZYawFhIz>R<#0XG6}1l$O?5%|A}z+dX_`iDAotyVo*^XnZ#s87xq zRi#(esUO##m*-g8{VdS$l(v2ypsrD%K9pXRrEVe1Eq{&{FFmFff3HscasGkc*mTVW zcr;a~S09qlaSl9{*5$zDucy@Mju#-KPS<=7Vb6lG4yrzgd8m3tX|}HMI97a~5cG>u zfA{ARw%t^V^Xj?l`_yv_Ue$9!y>!#42M1fpL2YSvq^=R##rD|V;~fzYi^50x)Txdt z%&Nt!#wzt>$1*6)Z7Y>Zb8$FasM!Q%&mh>^?B6^JLUhyzcEw}Y)M8=w<;V?erh0PS z&tRs0GIC9QM)kZ}_q?e4;fyD81Na|Q;!VZrbualKn$K7J%i3S9tbJqf{79g#@dVZd z;Sb4phaZkjckG0jOZcH^@%3iI`On|Bp}LhQXUzy zN$$aofExif0&WD{2)Ge&Bj85Bjer{gHv(=1{zoFw0<7*H5f?;1%r%&nhHFWy?oxWQ6 zJ@YqU-Vc7juECnGBK`VMOx>$ zn#xVISoA|w=Jk>rsm$vjaa}1UUN?#JAWSTO_hu=J@P^)yVQ1S0R2v@|7kn zjuGN|Q%nseh;@VvWF}^49piEm)KW#<4uwt_7J`_JX=Jg)geI{d3e_ z_%bZZ96y+b$@1$Y|2vhr9pv`E2fRM~1A653tBPVe;`OP#9+lUh?(gc_t2Ffu6*5La z*%N??eRIpb1zBu)qBR%@?%HP3|3-Vfu!6OLJItc*g?AFXe%(UD+Gwxf_33uLT70IW zpPKSGv+FM_k1spFT<|!w^R&nir5=upWwFp+^edYZb zc0YB3uTwh@P82I+=DlJ~dHuar>V=iza~1V(FYjZp>(`gBcRLSPXNB?U6?c@cPrLql zAwpKh%zNQ#4_4&)ZnS8F*I~7IyR^udIlQk`37;5u#1qzGNdAn2zngfzPnuqYxEC@o zYRm1x`Y`pt&jW9R_`WAeIN;)Zte5Y*%;P&Dk60SdXMnHN{^z8=UxXCMKx#Dsd{ovy z2fPRR@wK~2(E^qHzar(gFKPcQ@E*L&I{NWV(&zsHS%kw4nOQon>Y$;X3jO{v@Ks{z zb+HxrwHP=0-{Jp>-M}kcnFS{$zjXXO2)tjcFZUOl>;Qgk)za&wA9+@?;8F799G@qE zS1fv*eH!>RRqF-cSD8P9JhX_7=x;(iC;9clxliCl;4u#0q5TL6a&!gI596>s#GXw& zM*1Nd&pSwbk^K8fpZ^E10FQox#FM&sgZylxdgVJz5MCoc&ix51VbcMguhY*Rz$@(3 zff;f!0Td3j|Ap52x`$6EIvR+8j8b4cWe7Y3MzfGH5)*L5u?m`5*?ED)7>&-c zIM{Q^v^R&TX~B7LuBVg3&>Zah0K{DcpdZpO?D+!xfQa(}xJAG{-Aw#^$H?;m5=&jq zBYqfu_^izK{2a)rfXtf8_Xi@|0Il}@^jyfe#cB+BzW*{Eb=dQBC8NTMgiia1f&Uvk z^K<)op2NuX<2Ni!&i3oT;T(tUc^<@g3XLG)IbxjIp64$~;P8~$o}XtKc^(BSGNBJ^ z`VvxXd?~^^pUnrzWc$SI`L~~L62y)m&wm(Y>jQ5u{&5X1Di$GiLc^<+z z@380oXZlx=!Do7&4)XIU@Bek`bD8lEU|VOg=jZu_W*{N4o>^KfGyfI{aO`pY<>zKt z-;HU8`VYrHCbr{#{04BS!uI?gV}>5&LLjpywr5-bq19f5NIPgE0g;RKGjS6#=!@&; z=eZymay_h1r^7|z1p+x|J#4?dtZ8Q0-ikbStg4?NhbmpzcpYPxaC`Xvw*okByVd@i d_{RY0A%}CW*OcP3XJz}F?WV>mhk>Ig{sl?qig^G4 literal 0 HcmV?d00001 diff --git a/build/CMakeFiles/CMakeOutput.log b/build/CMakeFiles/CMakeOutput.log new file mode 100644 index 0000000..07f2e8b --- /dev/null +++ b/build/CMakeFiles/CMakeOutput.log @@ -0,0 +1,427 @@ +The system is: Linux - 5.4.0-58-generic - x86_64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /bin/x86_64-linux-gnu-gcc-8 +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + +The C compiler identification is GNU, found in "/home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/3.16.3/CompilerIdC/a.out" + +Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. +Compiler: /bin/c++ +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + +The CXX compiler identification is GNU, found in "/home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out" + +Determining if the C compiler works passed with the following output: +Change Dir: /home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/ninja cmTC_010c2 && [1/2] Building C object CMakeFiles/cmTC_010c2.dir/testCCompiler.c.o +[2/2] Linking C executable cmTC_010c2 + + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/ninja cmTC_1d067 && [1/2] Building C object CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o +Using built-in specs. +COLLECT_GCC=/bin/x86_64-linux-gnu-gcc-8 +OFFLOAD_TARGET_NAMES=nvptx-none +OFFLOAD_TARGET_DEFAULT=1 +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.4.0-3ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 8.4.0 (Ubuntu 8.4.0-3ubuntu2) +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/8/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cc0iJeRy.s +GNU C17 (Ubuntu 8.4.0-3ubuntu2) version 8.4.0 (x86_64-linux-gnu) + compiled by GNU C version 8.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP + +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/include" +#include "..." search starts here: +#include <...> search starts here: + /usr/lib/gcc/x86_64-linux-gnu/8/include + /usr/local/include + /usr/include/x86_64-linux-gnu + /usr/include +End of search list. +GNU C17 (Ubuntu 8.4.0-3ubuntu2) version 8.4.0 (x86_64-linux-gnu) + compiled by GNU C version 8.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP + +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +Compiler executable checksum: 72ca2f61babeb977fcf7485cc9c3fa79 +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' + as -v --64 -o CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o /tmp/cc0iJeRy.s +GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34 +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' +[2/2] Linking C executable cmTC_1d067 +Using built-in specs. +COLLECT_GCC=/bin/x86_64-linux-gnu-gcc-8 +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper +OFFLOAD_TARGET_NAMES=nvptx-none +OFFLOAD_TARGET_DEFAULT=1 +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.4.0-3ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 8.4.0 (Ubuntu 8.4.0-3ubuntu2) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1d067' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/8/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper -plugin-opt=-fresolution=/tmp/cchx5gDQ.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_1d067 /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/8/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/8 -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/8/../../.. CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1d067' '-mtune=generic' '-march=x86-64' + + + +Parsed C implicit include dir info from above output: rv=done + found start of include info + found start of implicit include info + add: [/usr/lib/gcc/x86_64-linux-gnu/8/include] + add: [/usr/local/include] + add: [/usr/include/x86_64-linux-gnu] + add: [/usr/include] + end of search list found + collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/8/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/8/include] + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu] + collapse include dir [/usr/include] ==> [/usr/include] + implicit include dirs: [/usr/lib/gcc/x86_64-linux-gnu/8/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include] + + +Parsed C implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command(s):/usr/bin/ninja cmTC_1d067 && [1/2] Building C object CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/bin/x86_64-linux-gnu-gcc-8] + ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none] + ignore line: [OFFLOAD_TARGET_DEFAULT=1] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.4.0-3ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 8.4.0 (Ubuntu 8.4.0-3ubuntu2) ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/8/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cc0iJeRy.s] + ignore line: [GNU C17 (Ubuntu 8.4.0-3ubuntu2) version 8.4.0 (x86_64-linux-gnu)] + ignore line: [ compiled by GNU C version 8.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed"] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/include"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/8/include] + ignore line: [ /usr/local/include] + ignore line: [ /usr/include/x86_64-linux-gnu] + ignore line: [ /usr/include] + ignore line: [End of search list.] + ignore line: [GNU C17 (Ubuntu 8.4.0-3ubuntu2) version 8.4.0 (x86_64-linux-gnu)] + ignore line: [ compiled by GNU C version 8.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [Compiler executable checksum: 72ca2f61babeb977fcf7485cc9c3fa79] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] + ignore line: [ as -v --64 -o CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o /tmp/cc0iJeRy.s] + ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] + ignore line: [[2/2] Linking C executable cmTC_1d067] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/bin/x86_64-linux-gnu-gcc-8] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper] + ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none] + ignore line: [OFFLOAD_TARGET_DEFAULT=1] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.4.0-3ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 8.4.0 (Ubuntu 8.4.0-3ubuntu2) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1d067' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/8/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper -plugin-opt=-fresolution=/tmp/cchx5gDQ.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_1d067 /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/8/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/8 -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/8/../../.. CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/8/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/cchx5gDQ.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-pie] ==> ignore + arg [-znow] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_1d067] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/8/crtbeginS.o] ==> ignore + arg [-L/usr/lib/gcc/x86_64-linux-gnu/8] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/8/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../..] + arg [CMakeFiles/cmTC_1d067.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lgcc] ==> lib [gcc] + arg [--push-state] ==> ignore + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--pop-state] ==> ignore + arg [-lc] ==> lib [c] + arg [-lgcc] ==> lib [gcc] + arg [--push-state] ==> ignore + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--pop-state] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/8/crtendS.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o] ==> ignore + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8] ==> [/usr/lib/gcc/x86_64-linux-gnu/8] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../..] ==> [/usr/lib] + implicit libs: [gcc;gcc_s;c;gcc;gcc_s] + implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/8;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + +Determining if the CXX compiler works passed with the following output: +Change Dir: /home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/ninja cmTC_a83b7 && [1/2] Building CXX object CMakeFiles/cmTC_a83b7.dir/testCXXCompiler.cxx.o +[2/2] Linking CXX executable cmTC_a83b7 + + + +Detecting CXX compiler ABI info compiled with the following output: +Change Dir: /home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/ninja cmTC_8b45c && [1/2] Building CXX object CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o +Using built-in specs. +COLLECT_GCC=/bin/c++ +OFFLOAD_TARGET_NAMES=nvptx-none:hsa +OFFLOAD_TARGET_DEFAULT=1 +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cc1pyry9.s +GNU C++14 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu) + compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP + +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9" +ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include" +#include "..." search starts here: +#include <...> search starts here: + /usr/include/c++/9 + /usr/include/x86_64-linux-gnu/c++/9 + /usr/include/c++/9/backward + /usr/lib/gcc/x86_64-linux-gnu/9/include + /usr/local/include + /usr/include/x86_64-linux-gnu + /usr/include +End of search list. +GNU C++14 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu) + compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP + +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +Compiler executable checksum: 466f818abe2f30ba03783f22bd12d815 +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + as -v --64 -o CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o /tmp/cc1pyry9.s +GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34 +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' +[2/2] Linking CXX executable cmTC_8b45c +Using built-in specs. +COLLECT_GCC=/bin/c++ +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper +OFFLOAD_TARGET_NAMES=nvptx-none:hsa +OFFLOAD_TARGET_DEFAULT=1 +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8b45c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc7fhO8q.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_8b45c /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8b45c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + + + +Parsed CXX implicit include dir info from above output: rv=done + found start of include info + found start of implicit include info + add: [/usr/include/c++/9] + add: [/usr/include/x86_64-linux-gnu/c++/9] + add: [/usr/include/c++/9/backward] + add: [/usr/lib/gcc/x86_64-linux-gnu/9/include] + add: [/usr/local/include] + add: [/usr/include/x86_64-linux-gnu] + add: [/usr/include] + end of search list found + collapse include dir [/usr/include/c++/9] ==> [/usr/include/c++/9] + collapse include dir [/usr/include/x86_64-linux-gnu/c++/9] ==> [/usr/include/x86_64-linux-gnu/c++/9] + collapse include dir [/usr/include/c++/9/backward] ==> [/usr/include/c++/9/backward] + collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include] + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu] + collapse include dir [/usr/include] ==> [/usr/include] + implicit include dirs: [/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include] + + +Parsed CXX implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /home/turgu1/Dev/ESP-IDF-InkPlate/build/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command(s):/usr/bin/ninja cmTC_8b45c && [1/2] Building CXX object CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/bin/c++] + ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa] + ignore line: [OFFLOAD_TARGET_DEFAULT=1] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cc1pyry9.s] + ignore line: [GNU C++14 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu)] + ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"] + ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/include/c++/9] + ignore line: [ /usr/include/x86_64-linux-gnu/c++/9] + ignore line: [ /usr/include/c++/9/backward] + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include] + ignore line: [ /usr/local/include] + ignore line: [ /usr/include/x86_64-linux-gnu] + ignore line: [ /usr/include] + ignore line: [End of search list.] + ignore line: [GNU C++14 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu)] + ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [Compiler executable checksum: 466f818abe2f30ba03783f22bd12d815] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [ as -v --64 -o CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o /tmp/cc1pyry9.s] + ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [[2/2] Linking CXX executable cmTC_8b45c] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/bin/c++] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] + ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa] + ignore line: [OFFLOAD_TARGET_DEFAULT=1] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8b45c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc7fhO8q.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_8b45c /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/cc7fhO8q.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-pie] ==> ignore + arg [-znow] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_8b45c] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] + arg [CMakeFiles/cmTC_8b45c.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lstdc++] ==> lib [stdc++] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lc] ==> lib [c] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib] + implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc] + implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + diff --git a/build/CMakeFiles/cmake.check_cache b/build/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/build/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/doc/esp-idf-version.pu b/doc/esp-idf-version.pu index 501701e..65552e7 100644 --- a/doc/esp-idf-version.pu +++ b/doc/esp-idf-version.pu @@ -91,22 +91,22 @@ package "Inkplate-ESP-IDF" <> { Inkplate --o MainApp - package "Bitmaps" <> { - abstract class Bitmap - abstract class Bitmap1Bit - abstract class Bitmap3Bit - class Bitmap1BitX - class Bitmap3BitX - Bitmap <|-- Bitmap1Bit - Bitmap <|-- Bitmap3Bit - Bitmap1Bit <|-- Bitmap1BitX - Bitmap3Bit <|-- Bitmap3BitX + package "FrameBuffers" <> { + abstract class FrameBuffer + abstract class FrameBuffer1Bit + abstract class FrameBuffer3Bit + class FrameBuffer1BitX + class FrameBuffer3BitX + FrameBuffer <|-- FrameBuffer1Bit + FrameBuffer <|-- FrameBuffer3Bit + FrameBuffer1Bit <|-- FrameBuffer1BitX + FrameBuffer3Bit <|-- FrameBuffer3BitX } - ' Bitmaps <|-- EInkKind - ' Bitmaps -right[hidden]- EInkKind - Bitmap1Bit --o Graphics - Graphical -left[hidden]- Bitmaps + ' FrameBuffers <|-- EInkKind + ' FrameBuffers -right[hidden]- EInkKind + FrameBuffer1Bit --o Graphics + Graphical -left[hidden]- FrameBuffers ' Inkplate -left[hidden]- Graphical ' Inkplate ..> EInk diff --git a/lib/drivers/src/battery.cpp b/lib/drivers/src/battery.cpp index 030d18d..d79b64d 100644 --- a/lib/drivers/src/battery.cpp +++ b/lib/drivers/src/battery.cpp @@ -3,12 +3,11 @@ #include "wire.hpp" -Battery Battery::singleton; bool Battery::setup() { - mcp.set_direction(BATTERY_SWITCH, MCP::PinMode::OUTPUT); + mcp.set_direction(BATTERY_SWITCH, MCP23017::PinMode::OUTPUT); return true; } @@ -17,7 +16,7 @@ double Battery::read_level() { Wire::enter(); - mcp.digital_write(BATTERY_SWITCH, MCP::SignalLevel::HIGH); + mcp.digital_write(BATTERY_SWITCH, MCP23017::SignalLevel::HIGH); Wire::leave(); ESP::delay(1); @@ -28,7 +27,7 @@ Battery::read_level() int16_t adc = ESP::analog_read(ADC1_CHANNEL_7); // ADC 1 Channel 7 is GPIO port 35 Wire::enter(); - mcp.digital_write(BATTERY_SWITCH, MCP::SignalLevel::LOW); + mcp.digital_write(BATTERY_SWITCH, MCP23017::SignalLevel::LOW); Wire::leave(); return (double(adc) * 3.3 * 2) / 4095.0; diff --git a/lib/drivers/src/battery.hpp b/lib/drivers/src/battery.hpp index 8c57fc1..e140c37 100644 --- a/lib/drivers/src/battery.hpp +++ b/lib/drivers/src/battery.hpp @@ -2,29 +2,21 @@ #define __BATTERY_HPP__ #include "non_copyable.hpp" -#include "mcp.hpp" +#include "mcp23017.hpp" class Battery : NonCopyable { public: - static inline Battery & get_singleton() noexcept { return singleton; } - + Battery(MCP23017 & _mcp) : mcp(_mcp) {} bool setup(); double read_level(); private: static constexpr char const * TAG = "Battery"; - static Battery singleton; - Battery() {} + MCP23017 & mcp; - const MCP::Pin BATTERY_SWITCH = MCP::Pin::IOPIN_9; + const MCP23017::Pin BATTERY_SWITCH = MCP23017::Pin::IOPIN_9; }; -#ifdef __BATTERY__ - Battery & battery = Battery::get_singleton(); -#else - extern Battery & battery; -#endif - #endif \ No newline at end of file diff --git a/lib/drivers/src/eink.cpp b/lib/drivers/src/eink.cpp new file mode 100644 index 0000000..9f78415 --- /dev/null +++ b/lib/drivers/src/eink.cpp @@ -0,0 +1,216 @@ +#define __EINK__ +#include "eink.hpp" + +// PIN_LUT built from the following: +// +// for (uint32_t i = 0; i < 256; i++) { +// PIN_LUT[i] = ((i & 0b00000011) << 4) | +// (((i & 0b00001100) >> 2) << 18) | +// (((i & 0b00010000) >> 4) << 23) | +// (((i & 0b11100000) >> 5) << 25); +// } + +const uint32_t EInk::PIN_LUT[256] = { + 0x00000000, 0x00000010, 0x00000020, 0x00000030, 0x00040000, 0x00040010, 0x00040020, 0x00040030, + 0x00080000, 0x00080010, 0x00080020, 0x00080030, 0x000c0000, 0x000c0010, 0x000c0020, 0x000c0030, + 0x00800000, 0x00800010, 0x00800020, 0x00800030, 0x00840000, 0x00840010, 0x00840020, 0x00840030, + 0x00880000, 0x00880010, 0x00880020, 0x00880030, 0x008c0000, 0x008c0010, 0x008c0020, 0x008c0030, + 0x02000000, 0x02000010, 0x02000020, 0x02000030, 0x02040000, 0x02040010, 0x02040020, 0x02040030, + 0x02080000, 0x02080010, 0x02080020, 0x02080030, 0x020c0000, 0x020c0010, 0x020c0020, 0x020c0030, + 0x02800000, 0x02800010, 0x02800020, 0x02800030, 0x02840000, 0x02840010, 0x02840020, 0x02840030, + 0x02880000, 0x02880010, 0x02880020, 0x02880030, 0x028c0000, 0x028c0010, 0x028c0020, 0x028c0030, + 0x04000000, 0x04000010, 0x04000020, 0x04000030, 0x04040000, 0x04040010, 0x04040020, 0x04040030, + 0x04080000, 0x04080010, 0x04080020, 0x04080030, 0x040c0000, 0x040c0010, 0x040c0020, 0x040c0030, + 0x04800000, 0x04800010, 0x04800020, 0x04800030, 0x04840000, 0x04840010, 0x04840020, 0x04840030, + 0x04880000, 0x04880010, 0x04880020, 0x04880030, 0x048c0000, 0x048c0010, 0x048c0020, 0x048c0030, + 0x06000000, 0x06000010, 0x06000020, 0x06000030, 0x06040000, 0x06040010, 0x06040020, 0x06040030, + 0x06080000, 0x06080010, 0x06080020, 0x06080030, 0x060c0000, 0x060c0010, 0x060c0020, 0x060c0030, + 0x06800000, 0x06800010, 0x06800020, 0x06800030, 0x06840000, 0x06840010, 0x06840020, 0x06840030, + 0x06880000, 0x06880010, 0x06880020, 0x06880030, 0x068c0000, 0x068c0010, 0x068c0020, 0x068c0030, + 0x08000000, 0x08000010, 0x08000020, 0x08000030, 0x08040000, 0x08040010, 0x08040020, 0x08040030, + 0x08080000, 0x08080010, 0x08080020, 0x08080030, 0x080c0000, 0x080c0010, 0x080c0020, 0x080c0030, + 0x08800000, 0x08800010, 0x08800020, 0x08800030, 0x08840000, 0x08840010, 0x08840020, 0x08840030, + 0x08880000, 0x08880010, 0x08880020, 0x08880030, 0x088c0000, 0x088c0010, 0x088c0020, 0x088c0030, + 0x0a000000, 0x0a000010, 0x0a000020, 0x0a000030, 0x0a040000, 0x0a040010, 0x0a040020, 0x0a040030, + 0x0a080000, 0x0a080010, 0x0a080020, 0x0a080030, 0x0a0c0000, 0x0a0c0010, 0x0a0c0020, 0x0a0c0030, + 0x0a800000, 0x0a800010, 0x0a800020, 0x0a800030, 0x0a840000, 0x0a840010, 0x0a840020, 0x0a840030, + 0x0a880000, 0x0a880010, 0x0a880020, 0x0a880030, 0x0a8c0000, 0x0a8c0010, 0x0a8c0020, 0x0a8c0030, + 0x0c000000, 0x0c000010, 0x0c000020, 0x0c000030, 0x0c040000, 0x0c040010, 0x0c040020, 0x0c040030, + 0x0c080000, 0x0c080010, 0x0c080020, 0x0c080030, 0x0c0c0000, 0x0c0c0010, 0x0c0c0020, 0x0c0c0030, + 0x0c800000, 0x0c800010, 0x0c800020, 0x0c800030, 0x0c840000, 0x0c840010, 0x0c840020, 0x0c840030, + 0x0c880000, 0x0c880010, 0x0c880020, 0x0c880030, 0x0c8c0000, 0x0c8c0010, 0x0c8c0020, 0x0c8c0030, + 0x0e000000, 0x0e000010, 0x0e000020, 0x0e000030, 0x0e040000, 0x0e040010, 0x0e040020, 0x0e040030, + 0x0e080000, 0x0e080010, 0x0e080020, 0x0e080030, 0x0e0c0000, 0x0e0c0010, 0x0e0c0020, 0x0e0c0030, + 0x0e800000, 0x0e800010, 0x0e800020, 0x0e800030, 0x0e840000, 0x0e840010, 0x0e840020, 0x0e840030, + 0x0e880000, 0x0e880010, 0x0e880020, 0x0e880030, 0x0e8c0000, 0x0e8c0010, 0x0e8c0020, 0x0e8c0030 +}; + +// Turn off epaper power supply and put all digital IO pins in high Z state +void +EInk::turn_off() +{ + if (get_panel_state() == PanelState::OFF) return; + + oe_clear(); + gmod_clear(); + + GPIO.out &= ~(DATA | LE | CL); + + ckv_clear(); + sph_clear(); + spv_clear(); + vcom_clear(); + + ESP::delay(6); + + pwrup_clear(); + wakeup_clear(); + + unsigned long timer = ESP::millis(); + + do { + ESP::delay(1); + } while ((read_power_good() != 0) && (ESP::millis() - timer) < 250); + + pins_z_state(); + set_panel_state(PanelState::OFF); +} + +// Turn on supply for epaper display (TPS65186) +// [+15 VDC, -15VDC, +22VDC, -20VDC, +3.3VDC, VCOM] +void +EInk::turn_on() +{ + if (get_panel_state() == PanelState::ON) return; + + wakeup_set(); + ESP::delay_microseconds(1800); + pwrup_set(); + + // Enable all rails + wire.begin_transmission(PWRMGR_ADDRESS); + wire.write(0x01); + wire.write(0b00111111); + wire.end_transmission(); + + pins_as_outputs(); + + le_clear(); + oe_clear(); + cl_clear(); + sph_set(); + gmod_set(); + spv_set(); + ckv_clear(); + oe_clear(); + vcom_set(); + + unsigned long timer = ESP::millis(); + + do { + ESP::delay(1); + } while ((read_power_good() != PWR_GOOD_OK) && (ESP::millis() - timer) < 250); + + if ((ESP::millis() - timer) >= 250) { + wakeup_clear(); + vcom_clear(); + pwrup_clear(); + return; + } + + oe_set(); + set_panel_state(PanelState::ON); +} + +uint8_t +EInk::read_power_good() +{ + wire.begin_transmission(PWRMGR_ADDRESS); + wire.write(0x0F); + wire.end_transmission(); + + wire.request_from(PWRMGR_ADDRESS, 1); + return wire.read(); +} + +// LOW LEVEL FUNCTIONS + +void +EInk::vscan_start() +{ + ckv_set(); ESP::delay_microseconds( 7); + spv_clear(); ESP::delay_microseconds(10); + ckv_clear(); ESP::delay_microseconds( 0); + ckv_set(); ESP::delay_microseconds( 8); + spv_set(); ESP::delay_microseconds(10); + ckv_clear(); ESP::delay_microseconds( 0); + ckv_set(); ESP::delay_microseconds(18); + ckv_clear(); ESP::delay_microseconds( 0); + ckv_set(); ESP::delay_microseconds(18); + ckv_clear(); ESP::delay_microseconds( 0); + ckv_set(); +} + +void +EInk::hscan_start(uint32_t d) +{ + sph_clear(); + GPIO.out_w1ts = CL | d ; + GPIO.out_w1tc = CL | DATA; + sph_set(); + ckv_set(); +} + +void +EInk::vscan_end() +{ + ckv_clear(); + le_set(); + le_clear(); + + ESP::delay_microseconds(0); +} + +void +EInk::pins_z_state() +{ + gpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_2, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_32, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_33, GPIO_MODE_INPUT); + + mcp_int.set_direction(OE, MCP23017::PinMode::INPUT); + mcp_int.set_direction(GMOD, MCP23017::PinMode::INPUT); + mcp_int.set_direction(SPV, MCP23017::PinMode::INPUT); + + gpio_set_direction(GPIO_NUM_4, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_5, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_18, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_19, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_23, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_25, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_26, GPIO_MODE_INPUT); + gpio_set_direction(GPIO_NUM_27, GPIO_MODE_INPUT); +} + +void +EInk::pins_as_outputs() +{ + gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_2, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_32, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_33, GPIO_MODE_OUTPUT); + + mcp_int.set_direction(OE, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(GMOD, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(SPV, MCP23017::PinMode::OUTPUT); + + gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_19, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_23, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_25, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_26, GPIO_MODE_OUTPUT); + gpio_set_direction(GPIO_NUM_27, GPIO_MODE_OUTPUT); +} diff --git a/lib/drivers/src/eink.hpp b/lib/drivers/src/eink.hpp index 5e4ab7c..c548a57 100644 --- a/lib/drivers/src/eink.hpp +++ b/lib/drivers/src/eink.hpp @@ -2,60 +2,28 @@ #define __EINK_HPP__ #include "logging.hpp" - -class Bitmap -{ - protected: - static constexpr char const * TAG = "Bitmap"; - const int32_t data_size; - const int16_t width, height, line_size; - const uint8_t init_value; - - public: - Bitmap(int16_t w, int16_t h, int32_t s, uint8_t i) : - data_size(s), width(w), height(h), line_size(s / h), init_value(i) {} - - inline int16_t get_width() { return width; } - inline int16_t get_height() { return height; } - inline int32_t get_data_size() { return data_size; } - inline int16_t get_line_size() { return line_size; } - inline uint8_t get_init_value() { return init_value; } - - void clear() { - // ESP_LOGD(TAG, "Clear: %08x, with: %02x, size: %d", (int)get_data(), (int)get_init_value(), (int)get_data_size()); - memset(get_data(), get_init_value(), get_data_size()); - } - - virtual uint8_t * get_data() = 0; -}; - -class Bitmap1Bit : public Bitmap -{ - public: - Bitmap1Bit(int16_t w, int16_t h, int32_t s) : Bitmap(w, h, s, 0) {} -}; - -class Bitmap3Bit : public Bitmap -{ - public: - Bitmap3Bit(int16_t w, int16_t h, int32_t s) : Bitmap(w, h, s, (uint8_t) 0x77) {} -}; +#include "frame_buffer.hpp" +#include "mcp23017.hpp" +#include "wire.hpp" class EInk { public: - enum class PanelState { OFF, ON }; inline PanelState get_panel_state() { return panel_state; } inline bool is_initialized() { return initialized; } - virtual inline Bitmap1Bit * new_bitmap1bit() = 0; - virtual inline Bitmap3Bit * new_bitmap3bit() = 0; + virtual inline FrameBuffer1Bit * new_frame_buffer_1bit() = 0; + virtual inline FrameBuffer3Bit * new_frame_buffer_3bit() = 0; virtual inline int16_t get_width() = 0; virtual inline int16_t get_height() = 0; + inline void preload_screen(FrameBuffer1Bit & frame_buffer) { + memcpy(d_memory_new->get_data(), frame_buffer.get_data(), frame_buffer.get_data_size()); + } + // All the following methods are protecting the I2C device interface trough // the Wire::enter() and Wire::leave() methods. These are implementing a // Mutex semaphore access control. @@ -66,28 +34,97 @@ class EInk virtual bool setup() = 0; - inline void update(Bitmap1Bit & bitmap) { update_1bit(bitmap); } - inline void update(Bitmap3Bit & bitmap) { update_3bit(bitmap); } - - virtual void partial_update(Bitmap1Bit & bitmap) = 0; + virtual inline void update(FrameBuffer1Bit & frame_buffer) = 0; + virtual inline void update(FrameBuffer3Bit & frame_buffer) = 0; - virtual void clean() = 0; + virtual void partial_update(FrameBuffer1Bit & frame_buffer, bool force = false) = 0; int8_t read_temperature(); + void turn_off(); + void turn_on(); + uint8_t read_power_good(); + protected: - EInk() : + EInk(MCP23017 & mcp) : + mcp_int(mcp), panel_state(PanelState::OFF), initialized(false), partial_allowed(false) {} + static const uint8_t PWRMGR_ADDRESS = 0x48; + static const uint8_t PWR_GOOD_OK = 0b11111010; + + MCP23017 & mcp_int; + PanelState panel_state; bool initialized; bool partial_allowed; - virtual void update_1bit(Bitmap1Bit & bitmap) = 0; - virtual void update_3bit(Bitmap3Bit & bitmap) = 0; + static const uint32_t PIN_LUT[256]; + + void vscan_start(); + void hscan_start(uint32_t d); + void vscan_end(); + void pins_z_state(); + void pins_as_outputs(); + + inline void allow_partial() { partial_allowed = true; } + inline void block_partial() { partial_allowed = false; } + inline bool is_partial_allowed() { return partial_allowed; } + + inline void set_panel_state(PanelState s) { panel_state = s; } + + static const uint32_t CL = 0x01; + static const uint32_t CKV = 0x01; + static const uint32_t SPH = 0x02; + static const uint32_t LE = 0x04; + + static const uint32_t DATA = 0x0E8C0030; + + uint8_t * p_buffer; + FrameBuffer1Bit * d_memory_new; + + const MCP23017::Pin OE = MCP23017::Pin::IOPIN_0; + const MCP23017::Pin GMOD = MCP23017::Pin::IOPIN_1; + const MCP23017::Pin SPV = MCP23017::Pin::IOPIN_2; + + const MCP23017::Pin WAKEUP = MCP23017::Pin::IOPIN_3; + const MCP23017::Pin PWRUP = MCP23017::Pin::IOPIN_4; + const MCP23017::Pin VCOM = MCP23017::Pin::IOPIN_5; + + const MCP23017::Pin GPIO0_ENABLE = MCP23017::Pin::IOPIN_8; + + inline void cl_set() { GPIO.out_w1ts = CL; } + inline void cl_clear() { GPIO.out_w1tc = CL; } + + inline void ckv_set() { GPIO.out1_w1ts.val = CKV; } + inline void ckv_clear() { GPIO.out1_w1tc.val = CKV; } + + inline void sph_set() { GPIO.out1_w1ts.val = SPH; } + inline void sph_clear() { GPIO.out1_w1tc.val = SPH; } + + inline void le_set() { GPIO.out_w1ts = LE; } + inline void le_clear() { GPIO.out_w1tc = LE; } + + inline void oe_set() { mcp_int.digital_write(OE, MCP23017::SignalLevel::HIGH); } + inline void oe_clear() { mcp_int.digital_write(OE, MCP23017::SignalLevel::LOW ); } + + inline void gmod_set() { mcp_int.digital_write(GMOD, MCP23017::SignalLevel::HIGH); } + inline void gmod_clear() { mcp_int.digital_write(GMOD, MCP23017::SignalLevel::LOW ); } + + inline void spv_set() { mcp_int.digital_write(SPV, MCP23017::SignalLevel::HIGH); } + inline void spv_clear() { mcp_int.digital_write(SPV, MCP23017::SignalLevel::LOW ); } + + inline void wakeup_set() { mcp_int.digital_write(WAKEUP, MCP23017::SignalLevel::HIGH); } + inline void wakeup_clear() { mcp_int.digital_write(WAKEUP, MCP23017::SignalLevel::LOW ); } + + inline void pwrup_set() { mcp_int.digital_write(PWRUP, MCP23017::SignalLevel::HIGH); } + inline void pwrup_clear() { mcp_int.digital_write(PWRUP, MCP23017::SignalLevel::LOW ); } + + inline void vcom_set() { mcp_int.digital_write(VCOM, MCP23017::SignalLevel::HIGH); } + inline void vcom_clear() { mcp_int.digital_write(VCOM, MCP23017::SignalLevel::LOW ); } }; #endif \ No newline at end of file diff --git a/lib/drivers/src/eink_10.cpp b/lib/drivers/src/eink_10.cpp index 27aff01..0198039 100644 --- a/lib/drivers/src/eink_10.cpp +++ b/lib/drivers/src/eink_10.cpp @@ -23,30 +23,27 @@ Distributed as-is; no warranty is given. #ifdef INKPLATE_10 #define __EINK10__ 1 -#include "eink10.hpp" +#include "eink_10.hpp" #include "logging.hpp" #include "wire.hpp" -#include "mcp.hpp" +#include "mcp23017.hpp" #include "esp.hpp" #include -EInk10 EInk10::singleton; - const uint8_t EInk10::WAVEFORM_3BIT[8][8] = { - {0, 0, 0, 0, 1, 1, 1, 0}, {1, 2, 2, 2, 1, 1, 1, 0}, {0, 1, 2, 1, 1, 2, 1, 0}, - {0, 2, 1, 2, 1, 2, 1, 0}, {0, 0, 0, 1, 1, 1, 2, 0}, {2, 1, 1, 1, 2, 1, 2, 0}, - {1, 1, 1, 2, 1, 2, 2, 0}, {0, 0, 0, 0, 0, 0, 2, 0} }; - -const uint32_t EInk10::WAVEFORM[50] = { - 0x00000008, 0x00000008, 0x00200408, 0x80281888, 0x60A81898, 0x60A8A8A8, 0x60A8A8A8, 0x6068A868, 0x6868A868, - 0x6868A868, 0x68686868, 0x6A686868, 0x5A686868, 0x5A686868, 0x5A586A68, 0x5A5A6A68, 0x5A5A6A68, 0x55566A68, - 0x55565A64, 0x55555654, 0x55555556, 0x55555556, 0x55555556, 0x55555516, 0x55555596, 0x15555595, 0x95955595, - 0x95959595, 0x95949495, 0x94949495, 0x94949495, 0xA4949494, 0x9494A4A4, 0x84A49494, 0x84948484, 0x84848484, - 0x84848484, 0x84848484, 0xA5A48484, 0xA9A4A4A8, 0xA9A8A8A8, 0xA5A9A9A4, 0xA5A5A5A4, 0xA1A5A5A1, 0xA9A9A9A9, - 0xA9A9A9A9, 0xA9A9A9A9, 0xA9A9A9A9, 0x15151515, 0x11111111 }; + {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 2, 2, 2, 1, 1, 0}, + {0, 2, 1, 1, 2, 2, 1, 0}, {1, 2, 2, 1, 2, 2, 1, 0}, + {0, 2, 1, 2, 2, 2, 1, 0}, {2, 2, 2, 2, 2, 2, 1, 0}, + {0, 0, 0, 0, 2, 1, 2, 0}, {0, 0, 2, 2, 2, 2, 2, 0}}; + +// { +// {0, 0, 0, 0, 1, 1, 1, 0}, {1, 2, 2, 2, 1, 1, 1, 0}, +// {0, 1, 2, 1, 1, 2, 1, 0}, {0, 2, 1, 2, 1, 2, 1, 0}, +// {0, 0, 0, 1, 1, 1, 2, 0}, {2, 1, 1, 1, 2, 1, 2, 0}, +// {1, 1, 1, 2, 1, 2, 2, 0}, {0, 0, 0, 0, 0, 0, 2, 0} }; const uint8_t EInk10::LUT2[16] = { 0xAA, 0xA9, 0xA6, 0xA5, 0x9A, 0x99, 0x96, 0x95, @@ -60,50 +57,6 @@ const uint8_t EInk10::LUTB[16] = { 0xFF, 0xFD, 0xF7, 0xF5, 0xDF, 0xDD, 0xD7, 0xD5, 0x7F, 0x7D, 0x77, 0x75, 0x5F, 0x5D, 0x57, 0x55 }; -// PIN_LUT built from the following: -// -// for (uint32_t i = 0; i < 256; i++) { -// PIN_LUT[i] = ((i & 0b00000011) << 4) | -// (((i & 0b00001100) >> 2) << 18) | -// (((i & 0b00010000) >> 4) << 23) | -// (((i & 0b11100000) >> 5) << 25); -// } - -const uint32_t EInk10::PIN_LUT[256] = { - 0x00000000, 0x00000010, 0x00000020, 0x00000030, 0x00040000, 0x00040010, 0x00040020, 0x00040030, - 0x00080000, 0x00080010, 0x00080020, 0x00080030, 0x000c0000, 0x000c0010, 0x000c0020, 0x000c0030, - 0x00800000, 0x00800010, 0x00800020, 0x00800030, 0x00840000, 0x00840010, 0x00840020, 0x00840030, - 0x00880000, 0x00880010, 0x00880020, 0x00880030, 0x008c0000, 0x008c0010, 0x008c0020, 0x008c0030, - 0x02000000, 0x02000010, 0x02000020, 0x02000030, 0x02040000, 0x02040010, 0x02040020, 0x02040030, - 0x02080000, 0x02080010, 0x02080020, 0x02080030, 0x020c0000, 0x020c0010, 0x020c0020, 0x020c0030, - 0x02800000, 0x02800010, 0x02800020, 0x02800030, 0x02840000, 0x02840010, 0x02840020, 0x02840030, - 0x02880000, 0x02880010, 0x02880020, 0x02880030, 0x028c0000, 0x028c0010, 0x028c0020, 0x028c0030, - 0x04000000, 0x04000010, 0x04000020, 0x04000030, 0x04040000, 0x04040010, 0x04040020, 0x04040030, - 0x04080000, 0x04080010, 0x04080020, 0x04080030, 0x040c0000, 0x040c0010, 0x040c0020, 0x040c0030, - 0x04800000, 0x04800010, 0x04800020, 0x04800030, 0x04840000, 0x04840010, 0x04840020, 0x04840030, - 0x04880000, 0x04880010, 0x04880020, 0x04880030, 0x048c0000, 0x048c0010, 0x048c0020, 0x048c0030, - 0x06000000, 0x06000010, 0x06000020, 0x06000030, 0x06040000, 0x06040010, 0x06040020, 0x06040030, - 0x06080000, 0x06080010, 0x06080020, 0x06080030, 0x060c0000, 0x060c0010, 0x060c0020, 0x060c0030, - 0x06800000, 0x06800010, 0x06800020, 0x06800030, 0x06840000, 0x06840010, 0x06840020, 0x06840030, - 0x06880000, 0x06880010, 0x06880020, 0x06880030, 0x068c0000, 0x068c0010, 0x068c0020, 0x068c0030, - 0x08000000, 0x08000010, 0x08000020, 0x08000030, 0x08040000, 0x08040010, 0x08040020, 0x08040030, - 0x08080000, 0x08080010, 0x08080020, 0x08080030, 0x080c0000, 0x080c0010, 0x080c0020, 0x080c0030, - 0x08800000, 0x08800010, 0x08800020, 0x08800030, 0x08840000, 0x08840010, 0x08840020, 0x08840030, - 0x08880000, 0x08880010, 0x08880020, 0x08880030, 0x088c0000, 0x088c0010, 0x088c0020, 0x088c0030, - 0x0a000000, 0x0a000010, 0x0a000020, 0x0a000030, 0x0a040000, 0x0a040010, 0x0a040020, 0x0a040030, - 0x0a080000, 0x0a080010, 0x0a080020, 0x0a080030, 0x0a0c0000, 0x0a0c0010, 0x0a0c0020, 0x0a0c0030, - 0x0a800000, 0x0a800010, 0x0a800020, 0x0a800030, 0x0a840000, 0x0a840010, 0x0a840020, 0x0a840030, - 0x0a880000, 0x0a880010, 0x0a880020, 0x0a880030, 0x0a8c0000, 0x0a8c0010, 0x0a8c0020, 0x0a8c0030, - 0x0c000000, 0x0c000010, 0x0c000020, 0x0c000030, 0x0c040000, 0x0c040010, 0x0c040020, 0x0c040030, - 0x0c080000, 0x0c080010, 0x0c080020, 0x0c080030, 0x0c0c0000, 0x0c0c0010, 0x0c0c0020, 0x0c0c0030, - 0x0c800000, 0x0c800010, 0x0c800020, 0x0c800030, 0x0c840000, 0x0c840010, 0x0c840020, 0x0c840030, - 0x0c880000, 0x0c880010, 0x0c880020, 0x0c880030, 0x0c8c0000, 0x0c8c0010, 0x0c8c0020, 0x0c8c0030, - 0x0e000000, 0x0e000010, 0x0e000020, 0x0e000030, 0x0e040000, 0x0e040010, 0x0e040020, 0x0e040030, - 0x0e080000, 0x0e080010, 0x0e080020, 0x0e080030, 0x0e0c0000, 0x0e0c0010, 0x0e0c0020, 0x0e0c0030, - 0x0e800000, 0x0e800010, 0x0e800020, 0x0e800030, 0x0e840000, 0x0e840010, 0x0e840020, 0x0e840030, - 0x0e880000, 0x0e880010, 0x0e880020, 0x0e880030, 0x0e8c0000, 0x0e8c0010, 0x0e8c0020, 0x0e8c0030 -}; - bool EInk10::setup() { @@ -113,7 +66,7 @@ EInk10::setup() wire.setup(); - if (!mcp.setup()) { + if (!mcp_int.setup()) { ESP_LOGE(TAG, "Initialization not completed (MCP Issue)."); return false; } @@ -123,11 +76,11 @@ EInk10::setup() Wire::enter(); - mcp.set_direction(VCOM, MCP::PinMode::OUTPUT); - mcp.set_direction(PWRUP, MCP::PinMode::OUTPUT); - mcp.set_direction(WAKEUP, MCP::PinMode::OUTPUT); - mcp.set_direction(GPIO0_ENABLE, MCP::PinMode::OUTPUT); - mcp.digital_write(GPIO0_ENABLE, MCP::SignalLevel::HIGH); + mcp_int.set_direction(VCOM, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(PWRUP, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(WAKEUP, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(GPIO0_ENABLE, MCP23017::PinMode::OUTPUT); + mcp_int.digital_write(GPIO0_ENABLE, MCP23017::SignalLevel::HIGH); wakeup_set(); @@ -153,9 +106,9 @@ EInk10::setup() gpio_set_direction(GPIO_NUM_32, GPIO_MODE_OUTPUT); gpio_set_direction(GPIO_NUM_33, GPIO_MODE_OUTPUT); - mcp.set_direction(OE, MCP::PinMode::OUTPUT); - mcp.set_direction(GMOD, MCP::PinMode::OUTPUT); - mcp.set_direction(SPV, MCP::PinMode::OUTPUT); + mcp_int.set_direction(OE, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(GMOD, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(SPV, MCP23017::PinMode::OUTPUT); // DATA PINS gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); // D0 @@ -167,7 +120,7 @@ EInk10::setup() gpio_set_direction(GPIO_NUM_26, GPIO_MODE_OUTPUT); gpio_set_direction(GPIO_NUM_27, GPIO_MODE_OUTPUT); // D7 - d_memory_new = new_bitmap1bit(); + d_memory_new = new_frame_buffer_1bit(); p_buffer = (uint8_t *) ESP::ps_malloc(120000); ESP_LOGD(TAG, "Memory allocation for bitmap buffers."); @@ -193,7 +146,7 @@ EInk10::setup() } void -EInk10::update_1bit(Bitmap1Bit & bitmap) +EInk10::update(FrameBuffer1Bit & frame_buffer) { ESP_LOGD(TAG, "update_1bit..."); @@ -214,7 +167,7 @@ EInk10::update_1bit(Bitmap1Bit & bitmap) clean_fast(2, 1); clean_fast(0, 12); - uint8_t * data = bitmap.get_data(); + uint8_t * data = frame_buffer.get_data(); for (int8_t k = 0; k < 4; k++) { ptr = &data[BITMAP_SIZE_1BIT - 1]; @@ -299,12 +252,12 @@ EInk10::update_1bit(Bitmap1Bit & bitmap) Wire::leave(); - memcpy(d_memory_new->get_data(), bitmap.get_data(), BITMAP_SIZE_1BIT); + memcpy(d_memory_new->get_data(), frame_buffer.get_data(), BITMAP_SIZE_1BIT); partial_allowed = true; } void -EInk10::update_3bit(Bitmap3Bit & bitmap) +EInk10::update(FrameBuffer3Bit & frame_buffer) { ESP_LOGD(TAG, "Update_3bit..."); @@ -320,7 +273,7 @@ EInk10::update_3bit(Bitmap3Bit & bitmap) clean_fast(2, 1); clean_fast(0, 12); - uint8_t * data = bitmap.get_data(); + uint8_t * data = frame_buffer.get_data(); for (int k = 0; k < 8; k++) { @@ -402,10 +355,10 @@ EInk10::update_3bit(Bitmap3Bit & bitmap) } void -EInk10::partial_update(Bitmap1Bit & bitmap) +EInk10::partial_update(FrameBuffer1Bit & frame_buffer, bool force) { - if (!partial_allowed) { - update_1bit(bitmap); + if (!partial_allowed && !force) { + update(frame_buffer); return; } @@ -415,10 +368,10 @@ EInk10::partial_update(Bitmap1Bit & bitmap) uint32_t send; uint32_t n = 119999; - uint16_t pos = BITMAP_SIZE_1BIT - 1; + uint32_t pos = BITMAP_SIZE_1BIT - 1; uint8_t diffw, diffb; - uint8_t * idata = bitmap.get_data(); + uint8_t * idata = frame_buffer.get_data(); uint8_t * odata = d_memory_new->get_data(); for (int i = 0; i < HEIGHT; i++) { @@ -461,26 +414,7 @@ EInk10::partial_update(Bitmap1Bit & bitmap) turn_off(); Wire::leave(); - memcpy(d_memory_new->get_data(), bitmap.get_data(), BITMAP_SIZE_1BIT); -} - -void -EInk10::clean() -{ - ESP_LOGD(TAG, "Clean..."); - - Wire::enter(); - turn_on(); - - int m = 0; - clean_fast(0, 1); - m++; clean_fast((WAVEFORM[m] >> 30) & 3, 8); - m++; clean_fast((WAVEFORM[m] >> 24) & 3, 1); - m++; clean_fast( WAVEFORM[m] & 3, 8); - m++; clean_fast((WAVEFORM[m] >> 6) & 3, 1); - m++; clean_fast((WAVEFORM[m] >> 30) & 3, 10); - - Wire::leave(); + memcpy(d_memory_new->get_data(), frame_buffer.get_data(), BITMAP_SIZE_1BIT); } void @@ -519,176 +453,6 @@ EInk10::clean_fast(uint8_t c, uint8_t rep) } } -// Turn off epaper power supply and put all digital IO pins in high Z state -void -EInk10::turn_off() -{ - if (get_panel_state() == PanelState::OFF) return; - - oe_clear(); - gmod_clear(); - - GPIO.out &= ~(DATA | LE | CL); - - ckv_clear(); - sph_clear(); - spv_clear(); - vcom_clear(); - - ESP::delay(6); - - pwrup_clear(); - wakeup_clear(); - - unsigned long timer = ESP::millis(); - - do { - ESP::delay(1); - } while ((read_power_good() != 0) && (ESP::millis() - timer) < 250); - - pins_z_state(); - set_panel_state(PanelState::OFF); -} - -// Turn on supply for epaper display (TPS65186) -// [+15 VDC, -15VDC, +22VDC, -20VDC, +3.3VDC, VCOM] -void -EInk10::turn_on() -{ - if (get_panel_state() == PanelState::ON) return; - - wakeup_set(); - ESP::delay_microseconds(1800); - pwrup_set(); - - // Enable all rails - wire.begin_transmission(PWRMGR_ADDRESS); - wire.write(0x01); - wire.write(0b00111111); - wire.end_transmission(); - - pins_as_outputs(); - - le_clear(); - oe_clear(); - cl_clear(); - sph_set(); - gmod_set(); - spv_set(); - ckv_clear(); - oe_clear(); - vcom_set(); - - unsigned long timer = ESP::millis(); - - do { - ESP::delay(1); - } while ((read_power_good() != PWR_GOOD_OK) && (ESP::millis() - timer) < 250); - - if ((ESP::millis() - timer) >= 250) { - wakeup_clear(); - vcom_clear(); - pwrup_clear(); - return; - } - - oe_set(); - set_panel_state(PanelState::ON); -} - -uint8_t -EInk10::read_power_good() -{ - wire.begin_transmission(PWRMGR_ADDRESS); - wire.write(0x0F); - wire.end_transmission(); - - wire.request_from(PWRMGR_ADDRESS, 1); - return wire.read(); -} - -// LOW LEVEL FUNCTIONS - -void -EInk10::vscan_start() -{ - ckv_set(); ESP::delay_microseconds( 7); - spv_clear(); ESP::delay_microseconds(10); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); ESP::delay_microseconds( 8); - spv_set(); ESP::delay_microseconds(10); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); ESP::delay_microseconds(18); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); ESP::delay_microseconds(18); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); -} - -void -EInk10::hscan_start(uint32_t d) -{ - sph_clear(); - GPIO.out_w1ts = CL | d ; - GPIO.out_w1tc = CL | DATA; - sph_set(); - ckv_set(); -} - -void -EInk10::vscan_end() -{ - ckv_clear(); - le_set(); - le_clear(); - - ESP::delay_microseconds(0); -} - -void -EInk10::pins_z_state() -{ - gpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_2, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_32, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_33, GPIO_MODE_INPUT); - - mcp.set_direction(OE, MCP::PinMode::INPUT); - mcp.set_direction(GMOD, MCP::PinMode::INPUT); - mcp.set_direction(SPV, MCP::PinMode::INPUT); - - gpio_set_direction(GPIO_NUM_4, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_5, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_18, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_19, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_23, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_25, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_26, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_27, GPIO_MODE_INPUT); -} - -void -EInk10::pins_as_outputs() -{ - gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_2, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_32, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_33, GPIO_MODE_OUTPUT); - - mcp.set_direction(OE, MCP::PinMode::OUTPUT); - mcp.set_direction(GMOD, MCP::PinMode::OUTPUT); - mcp.set_direction(SPV, MCP::PinMode::OUTPUT); - - gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_19, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_23, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_25, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_26, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_27, GPIO_MODE_OUTPUT); -} - int8_t EInk10::read_temperature() { diff --git a/lib/drivers/src/eink_10.hpp b/lib/drivers/src/eink_10.hpp index ca1f7e9..a1082b2 100644 --- a/lib/drivers/src/eink_10.hpp +++ b/lib/drivers/src/eink_10.hpp @@ -1,5 +1,5 @@ /* -eink.h +eink_10.hpp Inkplate 10 ESP-IDF Modified by Guy Turcotte @@ -29,7 +29,7 @@ Distributed as-is; no warranty is given. #include "non_copyable.hpp" #include "driver/gpio.h" -#include "mcp.hpp" +#include "mcp23017.hpp" #include "eink.hpp" /** @@ -46,152 +46,72 @@ Distributed as-is; no warranty is given. class EInk10 : public EInk, NonCopyable { public: - static const uint16_t WIDTH = 800; // In pixels - static const uint16_t HEIGHT = 600; // In pixels - static const uint16_t BITMAP_SIZE_1BIT = (WIDTH * HEIGHT) >> 3; // In bytes + EInk10(MCP23017 & mcp) : EInk(mcp) + { } // Private constructor + + static const uint16_t WIDTH = 1200; // In pixels + static const uint16_t HEIGHT = 825; // In pixels + static const uint32_t BITMAP_SIZE_1BIT = (WIDTH * HEIGHT) >> 3; // In bytes static const uint32_t BITMAP_SIZE_3BIT = ((uint32_t) WIDTH * HEIGHT) >> 1; // In bytes static const uint16_t LINE_SIZE_1BIT = WIDTH >> 3; // In bytes static const uint16_t LINE_SIZE_3BIT = WIDTH >> 1; // In bytes - static inline EInk6 & get_singleton() noexcept { return singleton; } - inline int16_t get_width() { return WIDTH; } inline int16_t get_height() { return HEIGHT; } - private: - static constexpr char const * TAG = "EInk10"; - static EInk6 singleton; + inline PanelState get_panel_state() { return panel_state; } + inline bool is_initialized() { return initialized; } + + virtual inline FrameBuffer1Bit * new_frame_buffer_1bit() { return new FrameBuffer1BitX; } + virtual inline FrameBuffer3Bit * new_frame_buffer_3bit() { return new FrameBuffer3BitX; } + + // All the following methods are protecting the I2C device trough + // the Wire::enter() and Wire::leave() methods. These are implementing a + // Mutex semaphore access control. + // + // If you ever add public methods, you *MUST* consider adding calls to Wire::enter() + // and Wire::leave() and insure no deadlock will happen... or modifu the mutex to use + // a recursive mutex. + + bool setup(); + + void update(FrameBuffer1Bit & frame_buffer); + void update(FrameBuffer3Bit & frame_buffer); - static const uint8_t PWRMGR_ADDRESS = 0x48; - static const uint8_t PWR_GOOD_OK = 0b11111010; + void partial_update(FrameBuffer1Bit & frame_buffer, bool force = false); - class Bitmap1Bit6 : public Bitmap1Bit { + int8_t read_temperature(); + + private: + static constexpr char const * TAG = "EInk10"; + + class FrameBuffer1BitX : public FrameBuffer1Bit { private: uint8_t data[BITMAP_SIZE_1BIT]; public: - Bitmap1Bit6() : Bitmap1Bit(WIDTH, HEIGHT, BITMAP_SIZE_1BIT) {} + FrameBuffer1BitX() : FrameBuffer1Bit(WIDTH, HEIGHT, BITMAP_SIZE_1BIT) {} uint8_t * get_data() { return data; } }; - class Bitmap3Bit6 : public Bitmap3Bit { + class FrameBuffer3BitX : public FrameBuffer3Bit { private: uint8_t data[BITMAP_SIZE_3BIT]; public: - Bitmap3Bit6() : Bitmap3Bit(WIDTH, HEIGHT, BITMAP_SIZE_3BIT) {} + FrameBuffer3BitX() : FrameBuffer3Bit(WIDTH, HEIGHT, BITMAP_SIZE_3BIT) {} uint8_t * get_data() { return data; } }; - EInk10() : EInk() - { } // Private constructor - - void update_1bit(Bitmap1Bit & bitmap); - void update_3bit(Bitmap3Bit & bitmap); - - void vscan_start(); - void vscan_end(); - void hscan_start(uint32_t d = 0); - - void pins_z_state(); - void pins_as_outputs(); - - void turn_on(); - void turn_off(); - void clean_fast(uint8_t c, uint8_t rep); uint8_t read_power_good(); - inline void set_panel_state(PanelState s) { panel_state = s; } - - inline void allow_partial() { partial_allowed = true; } - inline void block_partial() { partial_allowed = false; } - inline bool is_partial_allowed() { return partial_allowed; } - - static const uint32_t PIN_LUT[256]; - static const uint8_t WAVEFORM_3BIT[8][8]; - static const uint32_t WAVEFORM[50]; static const uint8_t LUT2[16]; static const uint8_t LUTW[16]; static const uint8_t LUTB[16]; - - static const uint32_t CL = 0x01; - static const uint32_t CKV = 0x01; - static const uint32_t SPH = 0x02; - static const uint32_t LE = 0x04; - - static const uint32_t DATA = 0x0E8C0030; - - uint8_t * p_buffer; - Bitmap1Bit * d_memory_new; - - const MCP::Pin OE = MCP::Pin::IOPIN_0; - const MCP::Pin GMOD = MCP::Pin::IOPIN_1; - const MCP::Pin SPV = MCP::Pin::IOPIN_2; - const MCP::Pin WAKEUP = MCP::Pin::IOPIN_3; - const MCP::Pin PWRUP = MCP::Pin::IOPIN_4; - const MCP::Pin VCOM = MCP::Pin::IOPIN_5; - const MCP::Pin GPIO0_ENABLE = MCP::Pin::IOPIN_8; - - inline void cl_set() { GPIO.out_w1ts = CL; } - inline void cl_clear() { GPIO.out_w1tc = CL; } - - inline void ckv_set() { GPIO.out1_w1ts.val = CKV; } - inline void ckv_clear() { GPIO.out1_w1tc.val = CKV; } - - inline void sph_set() { GPIO.out1_w1ts.val = SPH; } - inline void sph_clear() { GPIO.out1_w1tc.val = SPH; } - - inline void le_set() { GPIO.out_w1ts = LE; } - inline void le_clear() { GPIO.out_w1tc = LE; } - - inline void oe_set() { mcp.digital_write(OE, MCP::SignalLevel::HIGH); } - inline void oe_clear() { mcp.digital_write(OE, MCP::SignalLevel::LOW ); } - - inline void gmod_set() { mcp.digital_write(GMOD, MCP::SignalLevel::HIGH); } - inline void gmod_clear() { mcp.digital_write(GMOD, MCP::SignalLevel::LOW ); } - - inline void spv_set() { mcp.digital_write(SPV, MCP::SignalLevel::HIGH); } - inline void spv_clear() { mcp.digital_write(SPV, MCP::SignalLevel::LOW ); } - - inline void wakeup_set() { mcp.digital_write(WAKEUP, MCP::SignalLevel::HIGH); } - inline void wakeup_clear() { mcp.digital_write(WAKEUP, MCP::SignalLevel::LOW ); } - - inline void pwrup_set() { mcp.digital_write(PWRUP, MCP::SignalLevel::HIGH); } - inline void pwrup_clear() { mcp.digital_write(PWRUP, MCP::SignalLevel::LOW ); } - - inline void vcom_set() { mcp.digital_write(VCOM, MCP::SignalLevel::HIGH); } - inline void vcom_clear() { mcp.digital_write(VCOM, MCP::SignalLevel::LOW ); } - - public: - - inline PanelState get_panel_state() { return panel_state; } - inline bool is_initialized() { return initialized; } - - virtual inline Bitmap1Bit * new_bitmap1bit() { return new Bitmap1Bit6; } - virtual inline Bitmap3Bit * new_bitmap3bit() { return new Bitmap3Bit6; } - - // All the following methods are protecting the I2C device trough - // the Wire::enter() and Wire::leave() methods. These are implementing a - // Mutex semaphore access control. - // - // If you ever add public methods, you *MUST* consider adding calls to Wire::enter() - // and Wire::leave() and insure no deadlock will happen... or modifu the mutex to use - // a recursive mutex. - - bool setup(); - - inline void update(Bitmap1Bit & bitmap) { update_1bit(bitmap); } - inline void update(Bitmap3Bit & bitmap) { update_3bit(bitmap); } - - void partial_update(Bitmap1Bit & bitmap); - - void clean(); - - int8_t read_temperature(); }; #endif diff --git a/lib/drivers/src/eink_6.cpp b/lib/drivers/src/eink_6.cpp index d6a8f1d..01f9fac 100644 --- a/lib/drivers/src/eink_6.cpp +++ b/lib/drivers/src/eink_6.cpp @@ -23,30 +23,27 @@ Distributed as-is; no warranty is given. #ifdef INKPLATE_6 #define __EINK6__ 1 -#include "eink6.hpp" +#include "eink_6.hpp" #include "logging.hpp" #include "wire.hpp" -#include "mcp.hpp" +#include "mcp23017.hpp" #include "esp.hpp" #include -EInk6 EInk6::singleton; - const uint8_t EInk6::WAVEFORM_3BIT[8][8] = { - {0, 0, 0, 0, 1, 1, 1, 0}, {1, 2, 2, 2, 1, 1, 1, 0}, {0, 1, 2, 1, 1, 2, 1, 0}, - {0, 2, 1, 2, 1, 2, 1, 0}, {0, 0, 0, 1, 1, 1, 2, 0}, {2, 1, 1, 1, 2, 1, 2, 0}, - {1, 1, 1, 2, 1, 2, 2, 0}, {0, 0, 0, 0, 0, 0, 2, 0} }; - -const uint32_t EInk6::WAVEFORM[50] = { - 0x00000008, 0x00000008, 0x00200408, 0x80281888, 0x60A81898, 0x60A8A8A8, 0x60A8A8A8, 0x6068A868, 0x6868A868, - 0x6868A868, 0x68686868, 0x6A686868, 0x5A686868, 0x5A686868, 0x5A586A68, 0x5A5A6A68, 0x5A5A6A68, 0x55566A68, - 0x55565A64, 0x55555654, 0x55555556, 0x55555556, 0x55555556, 0x55555516, 0x55555596, 0x15555595, 0x95955595, - 0x95959595, 0x95949495, 0x94949495, 0x94949495, 0xA4949494, 0x9494A4A4, 0x84A49494, 0x84948484, 0x84848484, - 0x84848484, 0x84848484, 0xA5A48484, 0xA9A4A4A8, 0xA9A8A8A8, 0xA5A9A9A4, 0xA5A5A5A4, 0xA1A5A5A1, 0xA9A9A9A9, - 0xA9A9A9A9, 0xA9A9A9A9, 0xA9A9A9A9, 0x15151515, 0x11111111 }; + {0, 1, 1, 0, 0, 1, 1, 0}, {0, 1, 2, 1, 1, 2, 1, 0}, + {1, 1, 1, 2, 2, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 2, 0}, + {2, 1, 1, 1, 2, 1, 2, 0}, {2, 2, 1, 1, 2, 1, 2, 0}, + {1, 1, 1, 2, 1, 2, 2, 0}, {0, 0, 0, 0, 0, 0, 2, 0}}; + + // { + // {0, 0, 0, 0, 1, 1, 1, 0}, {1, 2, 2, 2, 1, 1, 1, 0}, + // {0, 1, 2, 1, 1, 2, 1, 0}, {0, 2, 1, 2, 1, 2, 1, 0}, + // {0, 0, 0, 1, 1, 1, 2, 0}, {2, 1, 1, 1, 2, 1, 2, 0}, + // {1, 1, 1, 2, 1, 2, 2, 0}, {0, 0, 0, 0, 0, 0, 2, 0}}; const uint8_t EInk6::LUT2[16] = { 0xAA, 0xA9, 0xA6, 0xA5, 0x9A, 0x99, 0x96, 0x95, @@ -60,50 +57,6 @@ const uint8_t EInk6::LUTB[16] = { 0xFF, 0xFD, 0xF7, 0xF5, 0xDF, 0xDD, 0xD7, 0xD5, 0x7F, 0x7D, 0x77, 0x75, 0x5F, 0x5D, 0x57, 0x55 }; -// PIN_LUT built from the following: -// -// for (uint32_t i = 0; i < 256; i++) { -// PIN_LUT[i] = ((i & 0b00000011) << 4) | -// (((i & 0b00001100) >> 2) << 18) | -// (((i & 0b00010000) >> 4) << 23) | -// (((i & 0b11100000) >> 5) << 25); -// } - -const uint32_t EInk6::PIN_LUT[256] = { - 0x00000000, 0x00000010, 0x00000020, 0x00000030, 0x00040000, 0x00040010, 0x00040020, 0x00040030, - 0x00080000, 0x00080010, 0x00080020, 0x00080030, 0x000c0000, 0x000c0010, 0x000c0020, 0x000c0030, - 0x00800000, 0x00800010, 0x00800020, 0x00800030, 0x00840000, 0x00840010, 0x00840020, 0x00840030, - 0x00880000, 0x00880010, 0x00880020, 0x00880030, 0x008c0000, 0x008c0010, 0x008c0020, 0x008c0030, - 0x02000000, 0x02000010, 0x02000020, 0x02000030, 0x02040000, 0x02040010, 0x02040020, 0x02040030, - 0x02080000, 0x02080010, 0x02080020, 0x02080030, 0x020c0000, 0x020c0010, 0x020c0020, 0x020c0030, - 0x02800000, 0x02800010, 0x02800020, 0x02800030, 0x02840000, 0x02840010, 0x02840020, 0x02840030, - 0x02880000, 0x02880010, 0x02880020, 0x02880030, 0x028c0000, 0x028c0010, 0x028c0020, 0x028c0030, - 0x04000000, 0x04000010, 0x04000020, 0x04000030, 0x04040000, 0x04040010, 0x04040020, 0x04040030, - 0x04080000, 0x04080010, 0x04080020, 0x04080030, 0x040c0000, 0x040c0010, 0x040c0020, 0x040c0030, - 0x04800000, 0x04800010, 0x04800020, 0x04800030, 0x04840000, 0x04840010, 0x04840020, 0x04840030, - 0x04880000, 0x04880010, 0x04880020, 0x04880030, 0x048c0000, 0x048c0010, 0x048c0020, 0x048c0030, - 0x06000000, 0x06000010, 0x06000020, 0x06000030, 0x06040000, 0x06040010, 0x06040020, 0x06040030, - 0x06080000, 0x06080010, 0x06080020, 0x06080030, 0x060c0000, 0x060c0010, 0x060c0020, 0x060c0030, - 0x06800000, 0x06800010, 0x06800020, 0x06800030, 0x06840000, 0x06840010, 0x06840020, 0x06840030, - 0x06880000, 0x06880010, 0x06880020, 0x06880030, 0x068c0000, 0x068c0010, 0x068c0020, 0x068c0030, - 0x08000000, 0x08000010, 0x08000020, 0x08000030, 0x08040000, 0x08040010, 0x08040020, 0x08040030, - 0x08080000, 0x08080010, 0x08080020, 0x08080030, 0x080c0000, 0x080c0010, 0x080c0020, 0x080c0030, - 0x08800000, 0x08800010, 0x08800020, 0x08800030, 0x08840000, 0x08840010, 0x08840020, 0x08840030, - 0x08880000, 0x08880010, 0x08880020, 0x08880030, 0x088c0000, 0x088c0010, 0x088c0020, 0x088c0030, - 0x0a000000, 0x0a000010, 0x0a000020, 0x0a000030, 0x0a040000, 0x0a040010, 0x0a040020, 0x0a040030, - 0x0a080000, 0x0a080010, 0x0a080020, 0x0a080030, 0x0a0c0000, 0x0a0c0010, 0x0a0c0020, 0x0a0c0030, - 0x0a800000, 0x0a800010, 0x0a800020, 0x0a800030, 0x0a840000, 0x0a840010, 0x0a840020, 0x0a840030, - 0x0a880000, 0x0a880010, 0x0a880020, 0x0a880030, 0x0a8c0000, 0x0a8c0010, 0x0a8c0020, 0x0a8c0030, - 0x0c000000, 0x0c000010, 0x0c000020, 0x0c000030, 0x0c040000, 0x0c040010, 0x0c040020, 0x0c040030, - 0x0c080000, 0x0c080010, 0x0c080020, 0x0c080030, 0x0c0c0000, 0x0c0c0010, 0x0c0c0020, 0x0c0c0030, - 0x0c800000, 0x0c800010, 0x0c800020, 0x0c800030, 0x0c840000, 0x0c840010, 0x0c840020, 0x0c840030, - 0x0c880000, 0x0c880010, 0x0c880020, 0x0c880030, 0x0c8c0000, 0x0c8c0010, 0x0c8c0020, 0x0c8c0030, - 0x0e000000, 0x0e000010, 0x0e000020, 0x0e000030, 0x0e040000, 0x0e040010, 0x0e040020, 0x0e040030, - 0x0e080000, 0x0e080010, 0x0e080020, 0x0e080030, 0x0e0c0000, 0x0e0c0010, 0x0e0c0020, 0x0e0c0030, - 0x0e800000, 0x0e800010, 0x0e800020, 0x0e800030, 0x0e840000, 0x0e840010, 0x0e840020, 0x0e840030, - 0x0e880000, 0x0e880010, 0x0e880020, 0x0e880030, 0x0e8c0000, 0x0e8c0010, 0x0e8c0020, 0x0e8c0030 -}; - bool EInk6::setup() { @@ -113,7 +66,7 @@ EInk6::setup() wire.setup(); - if (!mcp.setup()) { + if (!mcp_int.setup()) { ESP_LOGE(TAG, "Initialization not completed (MCP Issue)."); return false; } @@ -123,11 +76,11 @@ EInk6::setup() Wire::enter(); - mcp.set_direction(VCOM, MCP::PinMode::OUTPUT); - mcp.set_direction(PWRUP, MCP::PinMode::OUTPUT); - mcp.set_direction(WAKEUP, MCP::PinMode::OUTPUT); - mcp.set_direction(GPIO0_ENABLE, MCP::PinMode::OUTPUT); - mcp.digital_write(GPIO0_ENABLE, MCP::SignalLevel::HIGH); + mcp_int.set_direction(VCOM, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(PWRUP, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(WAKEUP, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(GPIO0_ENABLE, MCP23017::PinMode::OUTPUT); + mcp_int.digital_write(GPIO0_ENABLE, MCP23017::SignalLevel::HIGH); wakeup_set(); @@ -153,9 +106,9 @@ EInk6::setup() gpio_set_direction(GPIO_NUM_32, GPIO_MODE_OUTPUT); gpio_set_direction(GPIO_NUM_33, GPIO_MODE_OUTPUT); - mcp.set_direction(OE, MCP::PinMode::OUTPUT); - mcp.set_direction(GMOD, MCP::PinMode::OUTPUT); - mcp.set_direction(SPV, MCP::PinMode::OUTPUT); + mcp_int.set_direction(OE, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(GMOD, MCP23017::PinMode::OUTPUT); + mcp_int.set_direction(SPV, MCP23017::PinMode::OUTPUT); // DATA PINS gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); // D0 @@ -167,8 +120,8 @@ EInk6::setup() gpio_set_direction(GPIO_NUM_26, GPIO_MODE_OUTPUT); gpio_set_direction(GPIO_NUM_27, GPIO_MODE_OUTPUT); // D7 - d_memory_new = new_bitmap1bit(); - p_buffer = (uint8_t *) ESP::ps_malloc(120000); + d_memory_new = new_frame_buffer_1bit(); + p_buffer = (uint8_t *) ESP::ps_malloc(120000); ESP_LOGD(TAG, "Memory allocation for bitmap buffers."); ESP_LOGD(TAG, "d_memory_new: %08x p_buffer: %08x.", (unsigned int)d_memory_new, (unsigned int)p_buffer); @@ -193,7 +146,7 @@ EInk6::setup() } void -EInk6::update_1bit(Bitmap1Bit & bitmap) +EInk6::update(FrameBuffer1Bit & frame_buffer) { ESP_LOGD(TAG, "update_1bit..."); @@ -214,7 +167,7 @@ EInk6::update_1bit(Bitmap1Bit & bitmap) clean_fast(2, 1); clean_fast(0, 12); - uint8_t * data = bitmap.get_data(); + uint8_t * data = frame_buffer.get_data(); for (int8_t k = 0; k < 4; k++) { ptr = &data[BITMAP_SIZE_1BIT - 1]; @@ -299,12 +252,12 @@ EInk6::update_1bit(Bitmap1Bit & bitmap) Wire::leave(); - memcpy(d_memory_new->get_data(), bitmap.get_data(), BITMAP_SIZE_1BIT); + memcpy(d_memory_new->get_data(), frame_buffer.get_data(), BITMAP_SIZE_1BIT); partial_allowed = true; } void -EInk6::update_3bit(Bitmap3Bit & bitmap) +EInk6::update(FrameBuffer3Bit & frame_buffer) { ESP_LOGD(TAG, "Update_3bit..."); @@ -320,7 +273,7 @@ EInk6::update_3bit(Bitmap3Bit & bitmap) clean_fast(2, 1); clean_fast(0, 12); - uint8_t * data = bitmap.get_data(); + uint8_t * data = frame_buffer.get_data(); for (int k = 0; k < 8; k++) { @@ -402,10 +355,10 @@ EInk6::update_3bit(Bitmap3Bit & bitmap) } void -EInk6::partial_update(Bitmap1Bit & bitmap) +EInk6::partial_update(FrameBuffer1Bit & frame_buffer, bool force) { - if (!partial_allowed) { - update_1bit(bitmap); + if (!partial_allowed && !force) { + update(frame_buffer); return; } @@ -418,7 +371,7 @@ EInk6::partial_update(Bitmap1Bit & bitmap) uint16_t pos = BITMAP_SIZE_1BIT - 1; uint8_t diffw, diffb; - uint8_t * idata = bitmap.get_data(); + uint8_t * idata = frame_buffer.get_data(); uint8_t * odata = d_memory_new->get_data(); for (int i = 0; i < HEIGHT; i++) { @@ -461,26 +414,7 @@ EInk6::partial_update(Bitmap1Bit & bitmap) turn_off(); Wire::leave(); - memcpy(d_memory_new->get_data(), bitmap.get_data(), BITMAP_SIZE_1BIT); -} - -void -EInk6::clean() -{ - ESP_LOGD(TAG, "Clean..."); - - Wire::enter(); - turn_on(); - - int m = 0; - clean_fast(0, 1); - m++; clean_fast((WAVEFORM[m] >> 30) & 3, 8); - m++; clean_fast((WAVEFORM[m] >> 24) & 3, 1); - m++; clean_fast( WAVEFORM[m] & 3, 8); - m++; clean_fast((WAVEFORM[m] >> 6) & 3, 1); - m++; clean_fast((WAVEFORM[m] >> 30) & 3, 10); - - Wire::leave(); + memcpy(d_memory_new->get_data(), frame_buffer.get_data(), BITMAP_SIZE_1BIT); } void @@ -519,176 +453,6 @@ EInk6::clean_fast(uint8_t c, uint8_t rep) } } -// Turn off epaper power supply and put all digital IO pins in high Z state -void -EInk6::turn_off() -{ - if (get_panel_state() == PanelState::OFF) return; - - oe_clear(); - gmod_clear(); - - GPIO.out &= ~(DATA | LE | CL); - - ckv_clear(); - sph_clear(); - spv_clear(); - vcom_clear(); - - ESP::delay(6); - - pwrup_clear(); - wakeup_clear(); - - unsigned long timer = ESP::millis(); - - do { - ESP::delay(1); - } while ((read_power_good() != 0) && (ESP::millis() - timer) < 250); - - pins_z_state(); - set_panel_state(PanelState::OFF); -} - -// Turn on supply for epaper display (TPS65186) -// [+15 VDC, -15VDC, +22VDC, -20VDC, +3.3VDC, VCOM] -void -EInk6::turn_on() -{ - if (get_panel_state() == PanelState::ON) return; - - wakeup_set(); - ESP::delay_microseconds(1800); - pwrup_set(); - - // Enable all rails - wire.begin_transmission(PWRMGR_ADDRESS); - wire.write(0x01); - wire.write(0b00111111); - wire.end_transmission(); - - pins_as_outputs(); - - le_clear(); - oe_clear(); - cl_clear(); - sph_set(); - gmod_set(); - spv_set(); - ckv_clear(); - oe_clear(); - vcom_set(); - - unsigned long timer = ESP::millis(); - - do { - ESP::delay(1); - } while ((read_power_good() != PWR_GOOD_OK) && (ESP::millis() - timer) < 250); - - if ((ESP::millis() - timer) >= 250) { - wakeup_clear(); - vcom_clear(); - pwrup_clear(); - return; - } - - oe_set(); - set_panel_state(PanelState::ON); -} - -uint8_t -EInk6::read_power_good() -{ - wire.begin_transmission(PWRMGR_ADDRESS); - wire.write(0x0F); - wire.end_transmission(); - - wire.request_from(PWRMGR_ADDRESS, 1); - return wire.read(); -} - -// LOW LEVEL FUNCTIONS - -void -EInk6::vscan_start() -{ - ckv_set(); ESP::delay_microseconds( 7); - spv_clear(); ESP::delay_microseconds(10); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); ESP::delay_microseconds( 8); - spv_set(); ESP::delay_microseconds(10); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); ESP::delay_microseconds(18); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); ESP::delay_microseconds(18); - ckv_clear(); ESP::delay_microseconds( 0); - ckv_set(); -} - -void -EInk6::hscan_start(uint32_t d) -{ - sph_clear(); - GPIO.out_w1ts = CL | d ; - GPIO.out_w1tc = CL | DATA; - sph_set(); - ckv_set(); -} - -void -EInk6::vscan_end() -{ - ckv_clear(); - le_set(); - le_clear(); - - ESP::delay_microseconds(0); -} - -void -EInk6::pins_z_state() -{ - gpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_2, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_32, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_33, GPIO_MODE_INPUT); - - mcp.set_direction(OE, MCP::PinMode::INPUT); - mcp.set_direction(GMOD, MCP::PinMode::INPUT); - mcp.set_direction(SPV, MCP::PinMode::INPUT); - - gpio_set_direction(GPIO_NUM_4, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_5, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_18, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_19, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_23, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_25, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_26, GPIO_MODE_INPUT); - gpio_set_direction(GPIO_NUM_27, GPIO_MODE_INPUT); -} - -void -EInk6::pins_as_outputs() -{ - gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_2, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_32, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_33, GPIO_MODE_OUTPUT); - - mcp.set_direction(OE, MCP::PinMode::OUTPUT); - mcp.set_direction(GMOD, MCP::PinMode::OUTPUT); - mcp.set_direction(SPV, MCP::PinMode::OUTPUT); - - gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_19, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_23, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_25, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_26, GPIO_MODE_OUTPUT); - gpio_set_direction(GPIO_NUM_27, GPIO_MODE_OUTPUT); -} - int8_t EInk6::read_temperature() { diff --git a/lib/drivers/src/eink_6.hpp b/lib/drivers/src/eink_6.hpp index bdbe866..284fff3 100644 --- a/lib/drivers/src/eink_6.hpp +++ b/lib/drivers/src/eink_6.hpp @@ -1,5 +1,5 @@ /* -eink.h +eink.hpp Inkplate 6 ESP-IDF Modified by Guy Turcotte @@ -29,7 +29,7 @@ Distributed as-is; no warranty is given. #include "non_copyable.hpp" #include "driver/gpio.h" -#include "mcp.hpp" +#include "mcp23017.hpp" #include "eink.hpp" /** @@ -46,6 +46,9 @@ Distributed as-is; no warranty is given. class EInk6 : public EInk, NonCopyable { public: + EInk6(MCP23017 & mcp) : EInk(mcp) + { } + static const uint16_t WIDTH = 800; // In pixels static const uint16_t HEIGHT = 600; // In pixels static const uint16_t BITMAP_SIZE_1BIT = (WIDTH * HEIGHT) >> 3; // In bytes @@ -53,145 +56,62 @@ class EInk6 : public EInk, NonCopyable static const uint16_t LINE_SIZE_1BIT = WIDTH >> 3; // In bytes static const uint16_t LINE_SIZE_3BIT = WIDTH >> 1; // In bytes - static inline EInk6 & get_singleton() noexcept { return singleton; } - inline int16_t get_width() { return WIDTH; } inline int16_t get_height() { return HEIGHT; } - private: - static constexpr char const * TAG = "EInk6"; + inline PanelState get_panel_state() { return panel_state; } + inline bool is_initialized() { return initialized; } + + virtual inline FrameBuffer1Bit * new_frame_buffer_1bit() { return new FrameBuffer1BitX; } + virtual inline FrameBuffer3Bit * new_frame_buffer_3bit() { return new FrameBuffer3BitX; } + + // All the following methods are protecting the I2C device trough + // the Wire::enter() and Wire::leave() methods. These are implementing a + // Mutex semaphore access control. + // + // If you ever add public methods, you *MUST* consider adding calls to Wire::enter() + // and Wire::leave() and insure no deadlock will happen... or modifu the mutex to use + // a recursive mutex. - static EInk6 singleton; + bool setup(); - static const uint8_t PWRMGR_ADDRESS = 0x48; - static const uint8_t PWR_GOOD_OK = 0b11111010; + void update(FrameBuffer1Bit & frame_buffer); + void update(FrameBuffer3Bit & frame_buffer); - class Bitmap1Bit6 : public Bitmap1Bit { + void partial_update(FrameBuffer1Bit & frame_buffer, bool force = false); + + int8_t read_temperature(); + + private: + static constexpr char const * TAG = "EInk6"; + + class FrameBuffer1BitX : public FrameBuffer1Bit { private: uint8_t data[BITMAP_SIZE_1BIT]; public: - Bitmap1Bit6() : Bitmap1Bit(WIDTH, HEIGHT, BITMAP_SIZE_1BIT) {} + FrameBuffer1BitX() : FrameBuffer1Bit(WIDTH, HEIGHT, BITMAP_SIZE_1BIT) {} uint8_t * get_data() { return data; } }; - class Bitmap3Bit6 : public Bitmap3Bit { + class FrameBuffer3BitX : public FrameBuffer3Bit { private: uint8_t data[BITMAP_SIZE_3BIT]; public: - Bitmap3Bit6() : Bitmap3Bit(WIDTH, HEIGHT, BITMAP_SIZE_3BIT) {} + FrameBuffer3BitX() : FrameBuffer3Bit(WIDTH, HEIGHT, BITMAP_SIZE_3BIT) {} uint8_t * get_data() { return data; } }; - EInk6() : EInk() - { } // Private constructor - - void update_1bit(Bitmap1Bit & bitmap); - void update_3bit(Bitmap3Bit & bitmap); - - void vscan_start(); - void vscan_end(); - void hscan_start(uint32_t d = 0); - - void pins_z_state(); - void pins_as_outputs(); - - void turn_on(); - void turn_off(); - void clean_fast(uint8_t c, uint8_t rep); uint8_t read_power_good(); - inline void set_panel_state(PanelState s) { panel_state = s; } - - inline void allow_partial() { partial_allowed = true; } - inline void block_partial() { partial_allowed = false; } - inline bool is_partial_allowed() { return partial_allowed; } - - static const uint32_t PIN_LUT[256]; - static const uint8_t WAVEFORM_3BIT[8][8]; static const uint32_t WAVEFORM[50]; static const uint8_t LUT2[16]; static const uint8_t LUTW[16]; static const uint8_t LUTB[16]; - - static const uint32_t CL = 0x01; - static const uint32_t CKV = 0x01; - static const uint32_t SPH = 0x02; - static const uint32_t LE = 0x04; - - static const uint32_t DATA = 0x0E8C0030; - - uint8_t * p_buffer; - Bitmap1Bit * d_memory_new; - - const MCP::Pin OE = MCP::Pin::IOPIN_0; - const MCP::Pin GMOD = MCP::Pin::IOPIN_1; - const MCP::Pin SPV = MCP::Pin::IOPIN_2; - const MCP::Pin WAKEUP = MCP::Pin::IOPIN_3; - const MCP::Pin PWRUP = MCP::Pin::IOPIN_4; - const MCP::Pin VCOM = MCP::Pin::IOPIN_5; - const MCP::Pin GPIO0_ENABLE = MCP::Pin::IOPIN_8; - - inline void cl_set() { GPIO.out_w1ts = CL; } - inline void cl_clear() { GPIO.out_w1tc = CL; } - - inline void ckv_set() { GPIO.out1_w1ts.val = CKV; } - inline void ckv_clear() { GPIO.out1_w1tc.val = CKV; } - - inline void sph_set() { GPIO.out1_w1ts.val = SPH; } - inline void sph_clear() { GPIO.out1_w1tc.val = SPH; } - - inline void le_set() { GPIO.out_w1ts = LE; } - inline void le_clear() { GPIO.out_w1tc = LE; } - - inline void oe_set() { mcp.digital_write(OE, MCP::SignalLevel::HIGH); } - inline void oe_clear() { mcp.digital_write(OE, MCP::SignalLevel::LOW ); } - - inline void gmod_set() { mcp.digital_write(GMOD, MCP::SignalLevel::HIGH); } - inline void gmod_clear() { mcp.digital_write(GMOD, MCP::SignalLevel::LOW ); } - - inline void spv_set() { mcp.digital_write(SPV, MCP::SignalLevel::HIGH); } - inline void spv_clear() { mcp.digital_write(SPV, MCP::SignalLevel::LOW ); } - - inline void wakeup_set() { mcp.digital_write(WAKEUP, MCP::SignalLevel::HIGH); } - inline void wakeup_clear() { mcp.digital_write(WAKEUP, MCP::SignalLevel::LOW ); } - - inline void pwrup_set() { mcp.digital_write(PWRUP, MCP::SignalLevel::HIGH); } - inline void pwrup_clear() { mcp.digital_write(PWRUP, MCP::SignalLevel::LOW ); } - - inline void vcom_set() { mcp.digital_write(VCOM, MCP::SignalLevel::HIGH); } - inline void vcom_clear() { mcp.digital_write(VCOM, MCP::SignalLevel::LOW ); } - - public: - - inline PanelState get_panel_state() { return panel_state; } - inline bool is_initialized() { return initialized; } - - virtual inline Bitmap1Bit * new_bitmap1bit() { return new Bitmap1Bit6; } - virtual inline Bitmap3Bit * new_bitmap3bit() { return new Bitmap3Bit6; } - - // All the following methods are protecting the I2C device trough - // the Wire::enter() and Wire::leave() methods. These are implementing a - // Mutex semaphore access control. - // - // If you ever add public methods, you *MUST* consider adding calls to Wire::enter() - // and Wire::leave() and insure no deadlock will happen... or modifu the mutex to use - // a recursive mutex. - - bool setup(); - - inline void update(Bitmap1Bit & bitmap) { update_1bit(bitmap); } - inline void update(Bitmap3Bit & bitmap) { update_3bit(bitmap); } - - void partial_update(Bitmap1Bit & bitmap); - - void clean(); - - int8_t read_temperature(); }; #endif diff --git a/lib/drivers/src/frame_buffer.hpp b/lib/drivers/src/frame_buffer.hpp new file mode 100644 index 0000000..a0b2662 --- /dev/null +++ b/lib/drivers/src/frame_buffer.hpp @@ -0,0 +1,47 @@ +#ifndef __FRAME_BUFFER_HPP__ +#define __FRAME_BUFFER_HPP__ + +#include "logging.hpp" + +#include +#include + +class FrameBuffer +{ + protected: + static constexpr char const * TAG = "FrameBuffer"; + const int32_t data_size; + const int16_t width, height, line_size; + const uint8_t init_value; + + public: + FrameBuffer(int16_t w, int16_t h, int32_t s, uint8_t i) : + data_size(s), width(w), height(h), line_size(s / h), init_value(i) {} + + inline int16_t get_width() { return width; } + inline int16_t get_height() { return height; } + inline int32_t get_data_size() { return data_size; } + inline int16_t get_line_size() { return line_size; } + inline uint8_t get_init_value() { return init_value; } + + void clear() { + // ESP_LOGD(TAG, "Clear: %08x, with: %02x, size: %d", (int)get_data(), (int)get_init_value(), (int)get_data_size()); + memset(get_data(), get_init_value(), get_data_size()); + } + + virtual uint8_t * get_data() = 0; +}; + +class FrameBuffer1Bit : public FrameBuffer +{ + public: + FrameBuffer1Bit(int16_t w, int16_t h, int32_t s) : FrameBuffer(w, h, s, 0) {} +}; + +class FrameBuffer3Bit : public FrameBuffer +{ + public: + FrameBuffer3Bit(int16_t w, int16_t h, int32_t s) : FrameBuffer(w, h, s, (uint8_t) 0x77) {} +}; + +#endif \ No newline at end of file diff --git a/lib/drivers/src/inkplate_platform.cpp b/lib/drivers/src/inkplate_platform.cpp index ffeab36..2d79fc3 100644 --- a/lib/drivers/src/inkplate_platform.cpp +++ b/lib/drivers/src/inkplate_platform.cpp @@ -4,10 +4,10 @@ #include "logging.hpp" #include "wire.hpp" -#include "mcp.hpp" +#include "mcp23017.hpp" #include "esp.hpp" #include "eink.hpp" -#include "eink6.hpp" +#include "eink_6.hpp" #include "touch_keys.hpp" #include "battery.hpp" #include "sd_card.hpp" diff --git a/lib/drivers/src/inkplate_platform.hpp b/lib/drivers/src/inkplate_platform.hpp index 8deec58..444a369 100644 --- a/lib/drivers/src/inkplate_platform.hpp +++ b/lib/drivers/src/inkplate_platform.hpp @@ -1,5 +1,6 @@ /* -InkPlatePlatform.h +inkplate_platform.hpp + Inkplate 6 Arduino library David Zovko, Borna Biro, Denis Vajak, Zvonimir Haramustek @ e-radionica.com September 24, 2020 @@ -21,28 +22,60 @@ Distributed as-is; no warranty is given. #include "non_copyable.hpp" +#include "mcp23017.hpp" +#include "battery.hpp" +#include "touch_keys.hpp" #include "eink.hpp" #include "eink_6.hpp" #include "eink_10.hpp" +#if __INKPLATE_PLATFORM__ + MCP23017 mcp_int(0x20); + Battery battery(mcp_int); + TouchKeys touch_keys(mcp_int); + + #if defined(INKPLATE_6) + EInk6 e_ink(mcp_int); + #elif defined(INKPLATE_10) + MCP23017 mcp_ext(0x22); + EInk10 e_ink(mcp_int); + #else + #error "One of INKPLATE_6, INKPLATE_10 must be defined." + #endif +#else + extern MCP23017 mcp_int; + extern Battery battery; + extern TouchKeys touch_keys; + + #if defined(INKPLATE_6) + extern EInk6 e_ink; + #elif defined(INKPLATE_10) + extern MCP23017 mcp_ext; + extern EInk10 e_ink; + #else + #error "One of INKPLATE_6, INKPLATE_10 must be defined." + #endif +#endif + class InkPlatePlatform : NonCopyable { -private: - static constexpr char const * TAG = "InkPlatePlatform"; + private: + static constexpr char const * TAG = "InkPlatePlatform"; - static InkPlatePlatform singleton; - InkPlatePlatform() {}; + static InkPlatePlatform singleton; + InkPlatePlatform() {}; public: static inline InkPlatePlatform & get_singleton() noexcept { return singleton; } /** - * @brief Setup the InkPlate-6 Controller + * @brief Setup the InkPlate Devices * - * This method initialize the SD-Card access, the e-Ink display and the touchkeys + * This method initialize the SD-Card, the e-Ink display, battery status, and the touchkeys * capabilities. * - * @return true + * @return true - All devices ready + * @return false - Some device not initialized properly */ bool setup(); @@ -51,28 +84,9 @@ private: }; #if __INKPLATE_PLATFORM__ - InkPlatePlatform & inkplate_platform = InkPlatePlatform::get_singleton(); - - #if defined(INKPLATE_6) - EInk6 & e_ink = EInk6::get_singleton(); - #elif defined(INKPLATE_10) - EInk10 & e_ink = EInk10::get_singleton(); - #else - #error "One of INKPLATE_6, INKPLATE_10 must be defined." - #endif - #else - extern InkPlatePlatform & inkplate_platform; - - #if defined(INKPLATE_6) - extern EInk6 & e_ink; - #elif defined(INKPLATE_10) - extern EInk10 & e_ink; - #else - #error "One of INKPLATE_6, INKPLATE_10 must be defined." - #endif #endif #endif \ No newline at end of file diff --git a/lib/drivers/src/mcp.cpp b/lib/drivers/src/mcp23017.cpp similarity index 79% rename from lib/drivers/src/mcp.cpp rename to lib/drivers/src/mcp23017.cpp index e2ce21b..f9fa6a5 100644 --- a/lib/drivers/src/mcp.cpp +++ b/lib/drivers/src/mcp23017.cpp @@ -1,9 +1,9 @@ /* -Mcp.cpp -Inkplate 6 ESP-IDF +mcp23017.cpp +Inkplate ESP-IDF Modified by Guy Turcotte -November 12, 2020 +December 26, 2020 from the Arduino Library: @@ -21,18 +21,17 @@ Distributed as-is; no warranty is given. */ #define __MCP__ 1 -#include "mcp.hpp" +#include "mcp23017.hpp" #include "logging.hpp" #include "wire.hpp" #include "driver/gpio.h" -MCP MCP::singleton; - // LOW LEVEL: -void MCP::test() +void +MCP23017::test() { printf("Registers before read:\n"); for (auto reg : registers) { @@ -41,7 +40,7 @@ void MCP::test() printf("\n"); fflush(stdout); - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.end_transmission(); read_all_registers(); @@ -54,9 +53,10 @@ void MCP::test() fflush(stdout); } -bool MCP::setup() +bool +MCP23017::setup() { - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.end_transmission(); read_all_registers(); @@ -67,43 +67,47 @@ bool MCP::setup() return true; } -void MCP::read_all_registers() +void +MCP23017::read_all_registers() { - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.write(0x00); wire.end_transmission(); - wire.request_from(MCP_ADDRESS, (uint8_t) 22); + wire.request_from(mcp_address, (uint8_t) 22); for (auto reg : registers) { reg = wire.read(); } } -void MCP::read_registers(Reg first_reg, uint8_t count) +void +MCP23017::read_registers(Reg first_reg, uint8_t count) { - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.write((int8_t)first_reg); wire.end_transmission(); - wire.request_from(MCP_ADDRESS, count); + wire.request_from(mcp_address, count); for (int i = 0; i < count; ++i) { registers[R(first_reg, i)] = wire.read(); } } -uint8_t MCP::read_register(Reg reg) +uint8_t +MCP23017::read_register(Reg reg) { - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.write((int8_t)reg); wire.end_transmission(); - wire.request_from(MCP_ADDRESS, (uint8_t) 1); + wire.request_from(mcp_address, (uint8_t) 1); registers[reg] = wire.read(); return registers[reg]; } -void MCP::update_all_registers() +void +MCP23017::update_all_registers() { - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.write(0x00); for (auto reg : registers) { wire.write(reg); @@ -111,17 +115,19 @@ void MCP::update_all_registers() wire.end_transmission(); } -void MCP::update_register(Reg reg, uint8_t value) +void +MCP23017::update_register(Reg reg, uint8_t value) { - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.write((int8_t)reg); wire.write(value); wire.end_transmission(); } -void MCP::update_registers(Reg first_reg, uint8_t count) +void +MCP23017::update_registers(Reg first_reg, uint8_t count) { - wire.begin_transmission(MCP_ADDRESS); + wire.begin_transmission(mcp_address); wire.write((int8_t)first_reg); for (int i = 0; i < count; ++i) { wire.write(registers[R(first_reg, i)]); @@ -131,7 +137,8 @@ void MCP::update_registers(Reg first_reg, uint8_t count) // HIGH LEVEL: -void MCP::set_direction(Pin pin, PinMode mode) +void + MCP23017::set_direction(Pin pin, PinMode mode) { uint8_t port = ((uint8_t)pin >> 3) & 1; uint8_t p = (uint8_t)pin & 7; @@ -160,7 +167,8 @@ void MCP::set_direction(Pin pin, PinMode mode) } } -void MCP::digital_write(Pin pin, SignalLevel state) +void +MCP23017::digital_write(Pin pin, SignalLevel state) { uint8_t port = ((uint8_t)pin >> 3) & 1; uint8_t p = (uint8_t)pin & 7; @@ -171,7 +179,8 @@ void MCP::digital_write(Pin pin, SignalLevel state) update_register(R(Reg::GPIOA, port), registers[R(Reg::GPIOA, port)]); } -MCP::SignalLevel MCP::digital_read(Pin pin) +MCP23017::SignalLevel +MCP23017::digital_read(Pin pin) { uint8_t port = ((uint8_t)pin >> 3) & 1; uint8_t p = (uint8_t)pin & 7; @@ -180,7 +189,8 @@ MCP::SignalLevel MCP::digital_read(Pin pin) return (r & (1 << p)) ? SignalLevel::HIGH : SignalLevel::LOW; } -void MCP::set_int_output(IntPort intPort, bool mirroring, bool openDrain, SignalLevel polarity) +void +MCP23017::set_int_output(IntPort intPort, bool mirroring, bool openDrain, SignalLevel polarity) { Reg reg = intPort == IntPort::INTPORTA ? Reg::IOCONA : Reg::IOCONB; @@ -191,7 +201,8 @@ void MCP::set_int_output(IntPort intPort, bool mirroring, bool openDrain, Signal update_register(reg, registers[reg]); } -void MCP::set_int_pin(Pin pin, IntMode mode) +void +MCP23017::set_int_pin(Pin pin, IntMode mode) { uint8_t port = ((uint8_t)pin >> 3) & 1; uint8_t p = (uint8_t)pin & 7; @@ -215,7 +226,8 @@ void MCP::set_int_pin(Pin pin, IntMode mode) update_registers(Reg::GPINTENA, 6); } -void MCP::remove_int_pin(Pin pin) +void +MCP23017::remove_int_pin(Pin pin) { uint8_t port = ((uint8_t)pin >> 3) & 1; uint8_t p = (uint8_t)pin & 7; @@ -223,26 +235,30 @@ void MCP::remove_int_pin(Pin pin) update_registers(Reg::GPINTENA, 2); } -uint16_t MCP::get_int() +uint16_t +MCP23017::get_int() { read_registers(Reg::INTFA, 2); return ((registers[Reg::INTFB] << 8) | registers[Reg::INTFA]); } -uint16_t MCP::get_int_state() +uint16_t +MCP23017::get_int_state() { read_registers(Reg::INTCAPA, 2); return ((registers[Reg::INTCAPB] << 8) | registers[Reg::INTCAPA]); } -void MCP::set_ports(uint16_t values) +void +MCP23017::set_ports(uint16_t values) { registers[Reg::GPIOA] = values & 0xff; registers[Reg::GPIOB] = (values >> 8) & 0xff; update_registers(Reg::GPIOA, 2); } -uint16_t MCP::get_ports() +uint16_t +MCP23017::get_ports() { read_registers(Reg::GPIOA, 2); return ((registers[Reg::GPIOB] << 8) | (registers[Reg::GPIOA])); diff --git a/lib/drivers/src/mcp.hpp b/lib/drivers/src/mcp23017.hpp similarity index 67% rename from lib/drivers/src/mcp.hpp rename to lib/drivers/src/mcp23017.hpp index e9ec1ab..20d52cd 100644 --- a/lib/drivers/src/mcp.hpp +++ b/lib/drivers/src/mcp23017.hpp @@ -1,9 +1,9 @@ /* -MCP.h -Inkplate 6 ESP-IDF +mcp23017.hpp +Inkplate ESP-IDF Modified by Guy Turcotte -November 12, 2020 +December 26, 2020 from the Arduino Library: @@ -44,10 +44,10 @@ public: } }; -class MCP : NonCopyable +class MCP23017 : NonCopyable { private: - static constexpr char const * TAG = "MCP"; + static constexpr char const * TAG = "MCP23017"; enum class Reg : uint8_t { IODIRA = 0x00, IODIRB = 0x01, @@ -73,32 +73,30 @@ class MCP : NonCopyable OLATB = 0x15 }; - static const uint8_t MCP_ADDRESS = 0x20; + const uint8_t mcp_address; enum_array registers; // Adjust Register, adding offset p inline Reg R(Reg r, uint8_t p) { return (Reg)((uint8_t)r + p); } - static MCP singleton; - MCP() { std::fill(registers.begin(), registers.end(), 0); }; // Not instanciable - - void read_all_registers(); - - void read_registers(Reg first_reg, uint8_t count); - uint8_t read_register(Reg reg); + void read_all_registers(); + void read_registers(Reg first_reg, uint8_t count); + uint8_t read_register(Reg reg); void update_all_registers(); - - void update_register(Reg reg, uint8_t value); - void update_registers(Reg first_reg, uint8_t count); + void update_register(Reg reg, uint8_t value); + void update_registers(Reg first_reg, uint8_t count); public: - static inline MCP & get_singleton() noexcept { return singleton; } - enum class PinMode : uint8_t { INPUT, INPUT_PULLUP, OUTPUT }; - enum class IntMode : uint8_t { CHANGE, FALLING, RISING }; - enum class IntPort : uint8_t { INTPORTA, INTPORTB }; - enum class SignalLevel { LOW, HIGH }; + MCP23017(uint8_t address) : mcp_address(address) { + std::fill(registers.begin(), registers.end(), 0); + } + + enum class PinMode : uint8_t { INPUT, INPUT_PULLUP, OUTPUT }; + enum class IntMode : uint8_t { CHANGE, FALLING, RISING }; + enum class IntPort : uint8_t { INTPORTA, INTPORTB }; + enum class SignalLevel : uint8_t { LOW, HIGH }; enum class Pin : uint8_t { IOPIN_0, @@ -130,23 +128,15 @@ class MCP : NonCopyable void digital_write(Pin pin, SignalLevel state); SignalLevel digital_read(Pin pin); - void set_int_output(IntPort intPort, bool mirroring, bool openDrain, SignalLevel polarity); - void set_int_pin(Pin pin, IntMode mode); - void remove_int_pin(Pin pin); + void set_int_output(IntPort intPort, bool mirroring, bool openDrain, SignalLevel polarity); + void set_int_pin(Pin pin, IntMode mode); + void remove_int_pin(Pin pin); - uint16_t get_int(); - uint16_t get_int_state(); + uint16_t get_int(); + uint16_t get_int_state(); - void set_ports(uint16_t values); - uint16_t get_ports(); + void set_ports(uint16_t values); + uint16_t get_ports(); }; -// Singleton - -#if __MCP__ - MCP & mcp = MCP::get_singleton(); -#else - extern MCP & mcp; -#endif - #endif \ No newline at end of file diff --git a/lib/drivers/src/touch_keys.cpp b/lib/drivers/src/touch_keys.cpp index 822aa18..1325d3a 100644 --- a/lib/drivers/src/touch_keys.cpp +++ b/lib/drivers/src/touch_keys.cpp @@ -2,17 +2,13 @@ #include "touch_keys.hpp" #include "wire.hpp" -TouchKeys TouchKeys::singleton; - -TouchKeys::TouchKeys() {} - bool TouchKeys::setup() { Wire::enter(); - mcp.set_direction(TOUCH_0, MCP::PinMode::INPUT); - mcp.set_direction(TOUCH_1, MCP::PinMode::INPUT); - mcp.set_direction(TOUCH_2, MCP::PinMode::INPUT); + mcp.set_direction(TOUCH_0, MCP23017::PinMode::INPUT); + mcp.set_direction(TOUCH_1, MCP23017::PinMode::INPUT); + mcp.set_direction(TOUCH_2, MCP23017::PinMode::INPUT); // Prepare the MCP device to allow for interrupts // coming from any of the touchkeys. Interrupts will be raised @@ -20,11 +16,11 @@ TouchKeys::setup() // must be programmed as per the ESP-IDF documentation to get // some interrupts. - mcp.set_int_pin(TOUCH_0, MCP::IntMode::RISING); - mcp.set_int_pin(TOUCH_1, MCP::IntMode::RISING); - mcp.set_int_pin(TOUCH_2, MCP::IntMode::RISING); + mcp.set_int_pin(TOUCH_0, MCP23017::IntMode::RISING); + mcp.set_int_pin(TOUCH_1, MCP23017::IntMode::RISING); + mcp.set_int_pin(TOUCH_2, MCP23017::IntMode::RISING); - mcp.set_int_output(MCP::IntPort::INTPORTB, false, false, MCP::SignalLevel::HIGH); + mcp.set_int_output(MCP23017::IntPort::INTPORTB, false, false, MCP23017::SignalLevel::HIGH); Wire::leave(); return true; @@ -43,8 +39,8 @@ uint8_t TouchKeys::read_key(Key key) { Wire::enter(); - MCP::SignalLevel value = mcp.digital_read((MCP::Pin)(((uint8_t)key & 3) + 10)); // Not clean + MCP23017::SignalLevel value = mcp.digital_read((MCP23017::Pin)(((uint8_t)key & 3) + 10)); // Not clean Wire::leave(); - return value == MCP::SignalLevel::HIGH ? 1 : 0; + return value == MCP23017::SignalLevel::HIGH ? 1 : 0; } diff --git a/lib/drivers/src/touch_keys.hpp b/lib/drivers/src/touch_keys.hpp index 8134776..ff28506 100644 --- a/lib/drivers/src/touch_keys.hpp +++ b/lib/drivers/src/touch_keys.hpp @@ -2,15 +2,14 @@ #define __TOUCH_KEYS_HPP__ #include "non_copyable.hpp" -#include "mcp.hpp" +#include "mcp23017.hpp" class TouchKeys : NonCopyable { public: enum class Key : uint8_t { KEY_0, KEY_1, KEY_2 }; - static inline TouchKeys & get_singleton() noexcept { return singleton; } - + TouchKeys(MCP23017 & _mcp) : mcp(_mcp) {} bool setup(); /** @@ -32,19 +31,12 @@ class TouchKeys : NonCopyable private: static constexpr char const * TAG = "TouchKeys"; - static TouchKeys singleton; - TouchKeys(); + MCP23017 & mcp; - const MCP::Pin TOUCH_0 = MCP::Pin::IOPIN_10; - const MCP::Pin TOUCH_1 = MCP::Pin::IOPIN_11; - const MCP::Pin TOUCH_2 = MCP::Pin::IOPIN_12; + const MCP23017::Pin TOUCH_0 = MCP23017::Pin::IOPIN_10; + const MCP23017::Pin TOUCH_1 = MCP23017::Pin::IOPIN_11; + const MCP23017::Pin TOUCH_2 = MCP23017::Pin::IOPIN_12; }; -#ifdef __TOUCH_KEYS__ - TouchKeys & touch_keys = TouchKeys::get_singleton(); -#else - extern TouchKeys & touch_keys; -#endif - #endif \ No newline at end of file diff --git a/lib/graphical/src/adafruit_gfx.cpp b/lib/graphical/src/adafruit_gfx.cpp index 54c908d..1012d30 100644 --- a/lib/graphical/src/adafruit_gfx.cpp +++ b/lib/graphical/src/adafruit_gfx.cpp @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "adafruit_gfx.hpp" -#include "glcd_font.cpp" +#include "glcd_font.hpp" #ifdef __AVR__ #include @@ -40,6 +40,8 @@ POSSIBILITY OF SUCH DAMAGE. #include #endif +#include + // Many (but maybe not all) non-AVR board installs define macros // for compatibility with existing PROGMEM-reading AVR code. // Do our own checks and defines here for good measure... @@ -87,19 +89,6 @@ inline uint8_t *pgm_read_bitmap_ptr(const GFXfont *gfxFont) { #endif //__AVR__ } -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef _swap_int16_t -#define _swap_int16_t(a, b) \ - { \ - int16_t t = a; \ - a = b; \ - b = t; \ - } -#endif - /**************************************************************************/ /*! @brief Instatiate a GFX context for graphics! Can only be done by a @@ -137,13 +126,13 @@ void Adafruit_GFX::writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, #endif int16_t steep = abs(y1 - y0) > abs(x1 - x0); if (steep) { - _swap_int16_t(x0, y0); - _swap_int16_t(x1, y1); + std::swap(x0, y0); + std::swap(x1, y1); } if (x0 > x1) { - _swap_int16_t(x0, x1); - _swap_int16_t(y0, y1); + std::swap(x0, x1); + std::swap(y0, y1); } int16_t dx, dy; @@ -333,11 +322,11 @@ void Adafruit_GFX::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, // Update in subclasses if desired! if (x0 == x1) { if (y0 > y1) - _swap_int16_t(y0, y1); + std::swap(y0, y1); drawFastVLine(x0, y0, y1 - y0 + 1, color); } else if (y0 == y1) { if (x0 > x1) - _swap_int16_t(x0, x1); + std::swap(x0, x1); drawFastHLine(x0, y0, x1 - x0 + 1, color); } else { startWrite(); @@ -624,16 +613,16 @@ void Adafruit_GFX::fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, // Sort coordinates by Y order (y2 >= y1 >= y0) if (y0 > y1) { - _swap_int16_t(y0, y1); - _swap_int16_t(x0, x1); + std::swap(y0, y1); + std::swap(x0, x1); } if (y1 > y2) { - _swap_int16_t(y2, y1); - _swap_int16_t(x2, x1); + std::swap(y2, y1); + std::swap(x2, x1); } if (y0 > y1) { - _swap_int16_t(y0, y1); - _swap_int16_t(x0, x1); + std::swap(y0, y1); + std::swap(x0, x1); } startWrite(); @@ -677,7 +666,7 @@ void Adafruit_GFX::fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, b = x0 + (x2 - x0) * (y - y0) / (y2 - y0); */ if (a > b) - _swap_int16_t(a, b); + std::swap(a, b); writeFastHLine(a, y, b - a + 1, color); } @@ -695,7 +684,7 @@ void Adafruit_GFX::fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, b = x0 + (x2 - x0) * (y - y0) / (y2 - y0); */ if (a > b) - _swap_int16_t(a, b); + std::swap(a, b); writeFastHLine(a, y, b - a + 1, color); } endWrite(); @@ -1470,7 +1459,7 @@ void Adafruit_GFX::getTextBounds(const char *str, int16_t x, int16_t y, /*! @brief Helper to determine size of a string with current font/size. Pass string and a cursor position, returns UL corner and W,H. - @param str The ascii string to measure (as an arduino String() class) + @param str The ascii string to measure @param x The current cursor X @param y The current cursor Y @param x1 The boundary X coordinate, set by function @@ -1479,7 +1468,7 @@ void Adafruit_GFX::getTextBounds(const char *str, int16_t x, int16_t y, @param h The boundary height, set by function */ /**************************************************************************/ -void Adafruit_GFX::getTextBounds(const String &str, int16_t x, int16_t y, +void Adafruit_GFX::getTextBounds(const std::string &str, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) { if (str.length() != 0) { @@ -1487,43 +1476,6 @@ void Adafruit_GFX::getTextBounds(const String &str, int16_t x, int16_t y, } } -/**************************************************************************/ -/*! - @brief Helper to determine size of a PROGMEM string with current - font/size. Pass string and a cursor position, returns UL corner and W,H. - @param str The flash-memory ascii string to measure - @param x The current cursor X - @param y The current cursor Y - @param x1 The boundary X coordinate, set by function - @param y1 The boundary Y coordinate, set by function - @param w The boundary width, set by function - @param h The boundary height, set by function -*/ -/**************************************************************************/ -void Adafruit_GFX::getTextBounds(const __FlashStringHelper *str, int16_t x, - int16_t y, int16_t *x1, int16_t *y1, - uint16_t *w, uint16_t *h) { - uint8_t *s = (uint8_t *)str, c; - - *x1 = x; - *y1 = y; - *w = *h = 0; - - int16_t minx = _width, miny = _height, maxx = -1, maxy = -1; - - while ((c = pgm_read_byte(s++))) - charBounds(c, &x, &y, &minx, &miny, &maxx, &maxy); - - if (maxx >= minx) { - *x1 = minx; - *w = maxx - minx + 1; - } - if (maxy >= miny) { - *y1 = miny; - *h = maxy - miny + 1; - } -} - /**************************************************************************/ /*! @brief Invert the display (ideally using built-in hardware command) @@ -1675,7 +1627,7 @@ void Adafruit_GFX_Button::drawButton(bool inverted) { text = _fillcolor; } - uint8_t r = min(_w, _h) / 4; // Corner radius + uint8_t r = std::min(_w, _h) / 4; // Corner radius _gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill); _gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline); diff --git a/lib/graphical/src/adafruit_gfx.hpp b/lib/graphical/src/adafruit_gfx.hpp index ca25549..eb224bd 100644 --- a/lib/graphical/src/adafruit_gfx.hpp +++ b/lib/graphical/src/adafruit_gfx.hpp @@ -1,6 +1,8 @@ #ifndef __ADAFRUIT_GFX_HPP__ #define __ADAFRUIT_GFX_HPP__ +#include + #include "print.hpp" #include "gfx_font.hpp" @@ -78,10 +80,8 @@ class Adafruit_GFX : public Print void drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h); void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size); void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size_x, uint8_t size_y); - void getTextBounds(const char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h); - void getTextBounds(const __FlashStringHelper *s, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, - uint16_t *h); - void getTextBounds(const String &str, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h); + void getTextBounds(const char * str, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h); + void getTextBounds(const std::string &str, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h); void setTextSize(uint8_t s); void setTextSize(uint8_t sx, uint8_t sy); void setFont(const GFXfont *f = NULL); diff --git a/lib/graphical/src/defines.hpp b/lib/graphical/src/defines.hpp new file mode 100644 index 0000000..3f9c6ee --- /dev/null +++ b/lib/graphical/src/defines.hpp @@ -0,0 +1,11 @@ +#ifndef __DEFINES_HPP__ +#define __DEFINES_HPP__ + +#include + +enum class DisplayMode : uint8_t { INKPLATE_1BIT, INKPLATE_3BIT }; + +constexpr uint8_t WHITE = 0; +constexpr uint8_t BLACK = 1; + +#endif diff --git a/lib/graphical/src/graphics.cpp b/lib/graphical/src/graphics.cpp index 0f89625..bd151bc 100644 --- a/lib/graphical/src/graphics.cpp +++ b/lib/graphical/src/graphics.cpp @@ -14,22 +14,21 @@ If you have any questions about licensing, please contact techsupport@e-radionic Distributed as-is; no warranty is given. */ -#include "graphics.h" - +#include "graphics.hpp" #include "inkplate_platform.hpp" -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif +#include -#ifndef _swap_int16_t -#define _swap_int16_t(a, b) \ - { \ - int16_t t = a; \ - a = b; \ - b = t; \ - } -#endif +Graphics::Graphics(int16_t w, int16_t h) : + Adafruit_GFX(w, h), Shapes(w, h), Image(w, h) +{ + _partial = e_ink.new_frame_buffer_1bit(); + DMemory4Bit = e_ink.new_frame_buffer_3bit(); + + if ((_partial == nullptr) || (DMemory4Bit == nullptr)) { + ESP_LOGE(TAG, "Unable to allocate PSRAM memory for buffers."); + } +}; void Graphics::setRotation(uint8_t x) { @@ -87,14 +86,14 @@ void Graphics::writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_ int16_t steep = abs(y1 - y0) > abs(x1 - x0); if (steep) { - _swap_int16_t(x0, y0); - _swap_int16_t(x1, y1); + std::swap(x0, y0); + std::swap(x1, y1); } if (x0 > x1) { - _swap_int16_t(x0, x1); - _swap_int16_t(y0, y1); + std::swap(x0, x1); + std::swap(y0, y1); } int16_t dx, dy; @@ -128,27 +127,49 @@ void Graphics::endWrite() { } -void Graphics::setDisplayMode(uint8_t _mode) +void Graphics::selectDisplayMode(DisplayMode mode) { - _displayMode = _mode; -} - -void Graphics::selectDisplayMode(uint8_t _mode) -{ - if (_mode != _displayMode) + if (mode != _displayMode) { - _displayMode = _mode & 1; - memset(DMemoryNew, 0, 60000); - memset(_partial, 0, 60000); - memset(_pBuffer, 0, 120000); - memset(DMemory4Bit, 255, 240000); + _displayMode = mode; + + if (_displayMode == DisplayMode::INKPLATE_1BIT) + _partial->clear(); + else + DMemory4Bit->clear(); + _blockPartial = 1; } } -uint8_t Graphics::getDisplayMode() +void Graphics::clearDisplay() +{ + if (_displayMode == DisplayMode::INKPLATE_1BIT) + _partial->clear(); + else + DMemory4Bit->clear(); +} + +void Graphics::display() +{ + if (_displayMode == DisplayMode::INKPLATE_1BIT) + e_ink.update(*_partial); + else + e_ink.update(*DMemory4Bit); +} + +void Graphics::preloadScreen() +{ + if (_displayMode == DisplayMode::INKPLATE_1BIT) { + e_ink.preload_screen(*_partial); + } +} + +void Graphics::partialUpdate(bool _forced) { - return _displayMode; + if (_displayMode == DisplayMode::INKPLATE_1BIT) { + e_ink.partial_update(*_partial, _forced); + } } int16_t Graphics::width() @@ -159,4 +180,42 @@ int16_t Graphics::width() int16_t Graphics::height() { return _height; -}; \ No newline at end of file +}; + +void Graphics::writePixel(int16_t x0, int16_t y0, uint16_t color) +{ + if (x0 > width() - 1 || y0 > height() - 1 || x0 < 0 || y0 < 0) + return; + + switch (rotation) + { + case 1: + std::swap(x0, y0); + x0 = height() - x0 - 1; + break; + case 2: + x0 = width() - x0 - 1; + y0 = height() - y0 - 1; + break; + case 3: + std::swap(x0, y0); + y0 = width() - y0 - 1; + break; + } + + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) + { + int x = x0 >> 3; + int x_sub = x0 & 7; + uint8_t temp = _partial->get_data()[100 * y0 + x]; + _partial->get_data()[100 * y0 + x] = (~pixelMaskLUT[x_sub] & temp) | (color ? pixelMaskLUT[x_sub] : 0); + } + else + { + color &= 7; + int x = x0 >> 1; + int x_sub = x0 & 1; + uint8_t temp = DMemory4Bit->get_data()[400 * y0 + x]; + DMemory4Bit->get_data()[400 * y0 + x] = (pixelMaskGLUT[x_sub] & temp) | (x_sub ? color : color << 4); + } +} diff --git a/lib/graphical/src/graphics.hpp b/lib/graphical/src/graphics.hpp index f121da0..29b5f0e 100644 --- a/lib/graphical/src/graphics.hpp +++ b/lib/graphical/src/graphics.hpp @@ -19,6 +19,7 @@ Distributed as-is; no warranty is given. #include "image.hpp" #include "shapes.hpp" +#include "frame_buffer.hpp" #ifndef pgm_read_byte #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) @@ -38,34 +39,34 @@ Distributed as-is; no warranty is given. class Graphics : public Shapes, public Image { - public: - Graphics(int16_t w, int16_t h) : Adafruit_GFX(w, h), Shapes(w, h), Image(w, h){}; - - void setRotation(uint8_t r); - uint8_t getRotation(); + private: + static constexpr char const * TAG = "Graphics"; - void drawPixel(int16_t x, int16_t y, uint16_t color) override; + DisplayMode display_mode; - void selectDisplayMode(uint8_t _mode); + public: - void setDisplayMode(uint8_t _mode); - uint8_t getDisplayMode(); - int16_t width() override; + Graphics(int16_t w, int16_t h); + + void setRotation(uint8_t r); + uint8_t getRotation(); + void drawPixel(int16_t x, int16_t y, uint16_t color) override; + void selectDisplayMode(DisplayMode _mode); + void setDisplayMode(DisplayMode _mode) { display_mode = _mode; } + DisplayMode getDisplayMode() { return display_mode; } + + void clearDisplay(); + void display(); + void preloadScreen(); + void partialUpdate(bool _forced = false); + + int16_t width() override; int16_t height() override; - uint8_t *DMemoryNew; - uint8_t *_partial; - uint8_t *DMemory4Bit; - uint8_t *_pBuffer; + FrameBuffer1Bit *_partial; + FrameBuffer3Bit * DMemory4Bit; - const uint8_t LUT2[16] = {0xAA, 0xA9, 0xA6, 0xA5, 0x9A, 0x99, 0x96, 0x95, - 0x6A, 0x69, 0x66, 0x65, 0x5A, 0x59, 0x56, 0x55}; - const uint8_t LUTW[16] = {0xFF, 0xFE, 0xFB, 0xFA, 0xEF, 0xEE, 0xEB, 0xEA, - 0xBF, 0xBE, 0xBB, 0xBA, 0xAF, 0xAE, 0xAB, 0xAA}; - const uint8_t LUTB[16] = {0xFF, 0xFD, 0xF7, 0xF5, 0xDF, 0xDD, 0xD7, 0xD5, - 0x7F, 0x7D, 0x77, 0x75, 0x5F, 0x5D, 0x57, 0x55}; - - const uint8_t pixelMaskLUT[8] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; + const uint8_t pixelMaskLUT[8] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; const uint8_t pixelMaskGLUT[2] = {0xF, 0xF0}; const uint8_t discharge[16] = {0xFF, 0xFC, 0xF3, 0xF0, 0xCF, 0xCC, 0xC3, 0xC0, @@ -74,17 +75,15 @@ class Graphics : public Shapes, public Image uint8_t _blockPartial = 1; private: - void startWrite(void) override; - void writePixel(int16_t x, int16_t y, uint16_t color) override; - void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) override; - void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) override; - void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) override; - void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) override; - void endWrite(void) override; - - uint8_t _displayMode = 0; - - protected: + void startWrite(void) override; + void writePixel(int16_t x, int16_t y, uint16_t color) override; + void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) override; + void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) override; + void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) override; + void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) override; + void endWrite(void) override; + + DisplayMode _displayMode = DisplayMode::INKPLATE_1BIT; }; #endif \ No newline at end of file diff --git a/lib/graphical/src/image.cpp b/lib/graphical/src/image.cpp index 7bdd237..1f61925 100644 --- a/lib/graphical/src/image.cpp +++ b/lib/graphical/src/image.cpp @@ -21,13 +21,16 @@ Distributed as-is; no warranty is given. Image *_imagePtrJpeg = nullptr; Image *_imagePtrPng = nullptr; -Image::Image(int16_t w, int16_t h) : Adafruit_GFX(w, h) +Image::Image(int16_t w, int16_t h) : Adafruit_GFX(w, h), e_ink_width(w), e_ink_height(h) { _imagePtrJpeg = this; _imagePtrPng = this; + + pixelBuffer = new uint8_t[pixelBufferSize = (e_ink_width * 4 + 5)]; + ditherBuffer = new uint8_t[ditherBufferSize = (2 * e_ink_width + 20)]; } -bool Image::drawImage(const String path, int x, int y, bool dither, bool invert) +bool Image::drawImage(const std::string path, int x, int y, bool dither, bool invert) { return drawImage(path.c_str(), x, y, dither, invert); }; @@ -57,16 +60,16 @@ bool Image::drawImage(const char * path, int x, int y, bool dither, bool invert) bool Image::drawImage(const uint8_t *buf, int x, int y, int16_t w, int16_t h, uint8_t c, uint8_t bg) { - if (getDisplayMode() == INKPLATE_1BIT && bg == 0xFF) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT && bg == 0xFF) drawBitmap(x, y, buf, w, h, c); - else if (getDisplayMode() == INKPLATE_1BIT && bg != 0xFF) + else if (getDisplayMode() == DisplayMode::INKPLATE_1BIT && bg != 0xFF) drawBitmap(x, y, buf, w, h, c, bg); - else if (getDisplayMode() == INKPLATE_3BIT) + else if (getDisplayMode() == DisplayMode::INKPLATE_3BIT) drawBitmap3Bit(x, y, buf, w, h); return 1; } -bool Image::drawImage(const String path, const Format& format, const int x, const int y, const bool dither, const bool invert) +bool Image::drawImage(const std::string path, const Format& format, const int x, const int y, const bool dither, const bool invert) { return drawImage(path.c_str(), format, x, y, dither, invert); }; @@ -114,7 +117,7 @@ bool Image::drawImage(const char* path, const Format& format, const Position& po void Image::drawBitmap3Bit(int16_t _x, int16_t _y, const unsigned char *_p, int16_t _w, int16_t _h) { - if (getDisplayMode() != INKPLATE_3BIT) + if (getDisplayMode() != DisplayMode::INKPLATE_3BIT) return; uint8_t _rem = _w & 1; int i, j; diff --git a/lib/graphical/src/image.hpp b/lib/graphical/src/image.hpp index e87ae87..a73221a 100644 --- a/lib/graphical/src/image.hpp +++ b/lib/graphical/src/image.hpp @@ -18,13 +18,29 @@ Distributed as-is; no warranty is given. #define __IMAGE_HPP__ #include +#include +#include "defines.hpp" #include "adafruit_gfx.hpp" -#include "network_client.hpp" class Image : virtual public Adafruit_GFX { + private: + int16_t e_ink_width, e_ink_height; + + struct bitmapHeader { + uint16_t signature; + uint32_t fileSize; + uint32_t startRAW; + uint32_t dibHeaderSize; + uint32_t width; + uint32_t height; + uint16_t color; + uint32_t compression; + }; + public: + typedef enum { BMP, @@ -45,16 +61,16 @@ class Image : virtual public Adafruit_GFX virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0; - virtual void selectDisplayMode(uint8_t _mode) = 0; - virtual uint8_t getDisplayMode() = 0; - virtual int16_t width() = 0; - virtual int16_t height() = 0; + virtual void selectDisplayMode(DisplayMode _mode) = 0; + virtual DisplayMode getDisplayMode() = 0; + virtual int16_t width() = 0; + virtual int16_t height() = 0; bool drawImage(const char *path, int x, int y, bool dither = 1, bool invert = 0); - bool drawImage(const String path, int x, int y, bool dither = 1, bool invert = 0); + bool drawImage(const std::string path, int x, int y, bool dither = 1, bool invert = 0); bool drawImage(const uint8_t *buf, int x, int y, int16_t w, int16_t h, uint8_t c = BLACK, uint8_t bg = 0xFF); bool drawImage(const char *path, const Format& format, const int x, const int y, const bool dither = 1, const bool invert = 0); - bool drawImage(const String path, const Format& format, const int x, const int y, const bool dither = 1, const bool invert = 0); + bool drawImage(const std::string path, const Format& format, const int x, const int y, const bool dither = 1, const bool invert = 0); bool drawImage(const char* path, const Format& format, const Position& position, const bool dither = 1, const bool invert = 0); // Defined in Adafruit-GFX-Library, but should fit here @@ -66,49 +82,56 @@ class Image : virtual public Adafruit_GFX bool drawBitmapFromBuffer(uint8_t *buf, int x, int y, bool dither, bool invert); - [[deprecated("Use drawImage, as this will soon become a private method.")]] bool drawBitmapFromSd( - const char *fileName, int x, int y, bool dither = 0, bool invert = 0); - bool drawBitmapFromFile(FILE *p, int x, int y, bool dither = 0, bool invert = 0); + bool drawJpegFromBuffer(uint8_t *buf, int32_t len, int x, int y, bool dither, bool invert); - bool drawBitmapFromWeb(const char *url, int x, int y, bool dither = 0, bool invert = 0); + // Should be private, but needed in a png callback :( + void ditherSwap(int w); + uint8_t ditherGetPixelBmp(uint8_t px, int i, int w, bool paletted); - bool drawJpegFromBuffer(uint8_t *buf, int32_t len, int x, int y, bool dither, bool invert); + static inline int16_t rowSize(int16_t w, int8_t c) { return ((c * w + 31) >> 5) << 2; } + + static inline uint32_t read32(uint8_t * c) { return (uint32_t)(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24)); } + static inline uint16_t read16(uint8_t * c) { return (uint16_t)(c[0] | (c[1] << 8)); } + + static inline uint8_t rgb3Bit(uint8_t r, uint8_t g, uint8_t b) { return (54UL * (r) + 183UL * (g) + 19UL * (b)) >> 13; } + static inline uint8_t rgb8Bit(uint8_t r, uint8_t g, uint8_t b) { return (54UL * (r) + 183UL * (g) + 19UL * (b)) >> 8; } - [[deprecated("Use drawImage, as this will soon become a private method.")]] bool drawJpegFromSd( - const char *fileName, int x, int y, bool dither = 0, bool invert = 0); + static inline uint8_t red(uint16_t a) { return ((a & 0xf800) >> 11) << 3; } + static inline uint8_t green(uint16_t a) { return ((a & 0x07e0) >> 5) << 2; } + static inline uint8_t blue(uint16_t a) { return (a & 0x001f) << 3; } + + private: + virtual void startWrite(void) = 0; + virtual void writePixel(int16_t x, int16_t y, uint16_t color) = 0; + virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) = 0; + virtual void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) = 0; + virtual void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) = 0; + virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) = 0; + virtual void endWrite(void) = 0; + + static bool drawJpegChunk(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t *bitmap, bool dither, bool invert); + + bool drawBitmapFromFile(const char *fileName, int x, int y, bool dither = 0, bool invert = 0); + bool drawBitmapFromFile(FILE *p, int x, int y, bool dither = 0, bool invert = 0); + bool drawBitmapFromWeb(const char *url, int x, int y, bool dither = 0, bool invert = 0); + + bool drawJpegFromFile(const char *fileName, int x, int y, bool dither = 0, bool invert = 0); bool drawJpegFromFile(FILE *p, int x, int y, bool dither = 0, bool invert = 0); + bool drawJpegFromWeb(const char *url, int x, int y, bool dither = 0, bool invert = 0); - [[deprecated("Use drawImage, as this will soon become a private method.")]] bool drawJpegFromWeb(const char *url, - int x, int y, - bool dither = 0, - bool invert = 0); - [[deprecated("Use drawImage, as this will soon become a private method.")]] bool drawPngFromSd(const char *fileName, - int x, int y, - bool dither = 0, - bool invert = 0); + bool drawPngFromFile(const char *fileName, int x, int y, bool dither = 0, bool invert = 0); bool drawPngFromFile(FILE *p, int x, int y, bool dither = 0, bool invert = 0); + bool drawPngFromWeb(const char *url, int x, int y, bool dither = 0, bool invert = 0); - [[deprecated("Use drawImage, as this will soon become a private method.")]] bool drawPngFromWeb(const char *url, - int x, int y, - bool dither = 0, - bool invert = 0); - // Should be private, but needed in a png callback :( - void ditherSwap(int w); - uint8_t ditherGetPixelBmp(uint8_t px, int i, int w, bool paletted); + // uint8_t pixelBuffer[e_ink_width * 4 + 5]; + // uint8_t ditherBuffer[2][e_ink_width + 20]; + + uint8_t * pixelBuffer; //[e_ink_width * 4 + 5]; + uint8_t * ditherBuffer; //[2 * e_ink_width + 20]; + + int16_t ditherBufferSize; + int16_t pixelBufferSize; - private: - virtual void startWrite(void) = 0; - virtual void writePixel(int16_t x, int16_t y, uint16_t color) = 0; - virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) = 0; - virtual void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) = 0; - virtual void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) = 0; - virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) = 0; - virtual void endWrite(void) = 0; - - static bool drawJpegChunk(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t *bitmap, bool dither, bool invert); - - uint8_t pixelBuffer[E_INK_WIDTH * 4 + 5]; - uint8_t ditherBuffer[2][E_INK_WIDTH + 20]; uint8_t jpegDitherBuffer[18][18]; int16_t blockW = 0, blockH = 0; int16_t lastY = -1; @@ -122,7 +145,7 @@ class Image : virtual public Adafruit_GFX void ditherSwapBlockJpeg(int x); void readBmpHeader(uint8_t *buf, bitmapHeader *_h); - void readBmpHeaderFile(FILE *_f, bitmapHeader *_h); + void readBmpHeaderFromFile(FILE *_f, bitmapHeader *_h); inline void displayBmpLine(int16_t x, int16_t y, bitmapHeader *bmpHeader, bool dither, bool invert); @@ -135,11 +158,12 @@ class Image : virtual public Adafruit_GFX void drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color); - void drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h); - void drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t *bitmap, uint8_t *mask, int16_t w, int16_t h); + void drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t * bitmap, int16_t w, int16_t h); + void drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t * bitmap, uint8_t * mask, int16_t w, int16_t h); - void drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h); - void drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h); + void drawRGBBitmap(int16_t x, int16_t y, uint16_t * bitmap, int16_t w, int16_t h); + void drawRGBBitmap(int16_t x, int16_t y, uint16_t * bitmap, uint8_t * mask, int16_t w, int16_t h); + // ------------------------------------------- }; diff --git a/lib/graphical/src/image_bmp.cpp b/lib/graphical/src/image_bmp.cpp index 083b490..ac8d7b3 100644 --- a/lib/graphical/src/image_bmp.cpp +++ b/lib/graphical/src/image_bmp.cpp @@ -15,6 +15,9 @@ Distributed as-is; no warranty is given. */ #include "image.hpp" +#include "network_client.hpp" + +#include bool Image::legalBmp(bitmapHeader *bmpHeader) { @@ -23,47 +26,47 @@ bool Image::legalBmp(bitmapHeader *bmpHeader) bmpHeader->color == 24 || bmpHeader->color == 32); } -void Image::readBmpHeaderSd(SdFile *_f, bitmapHeader *_h) +void Image::readBmpHeaderFromFile(FILE * f, bitmapHeader * h) { uint8_t header[55]; - _f->rewind(); - _f->read(header, 55); + rewind(f); + fread(header, 55, 1, f); - uint16_t color = READ16(header + 28); - uint32_t totalColors = READ32(header + 46); + uint16_t color = read16(header + 28); + uint32_t totalColors = read32(header + 46); if (color <= 8) { if (!totalColors) totalColors = (1ULL << color); - uint8_t *buff = (uint8_t *)ps_malloc(totalColors * 4 + 100); + uint8_t * buff = new uint8_t[totalColors * 4 + 100]; - _f->rewind(); - _f->read(buff, totalColors * 4 + 100); + rewind(f); + fread(buff, totalColors * 4 + 100, 1, f); - readBmpHeader(buff, _h); + readBmpHeader(buff, h); free(buff); } else { - readBmpHeader(header, _h); + readBmpHeader(header, h); } } void Image::readBmpHeader(uint8_t *buf, bitmapHeader *_h) { - _h->signature = READ16(buf + 0); - _h->fileSize = READ32(buf + 2); - _h->startRAW = READ32(buf + 10); - _h->dibHeaderSize = READ32(buf + 14); - _h->width = READ32(buf + 18); - _h->height = READ32(buf + 22); - _h->color = READ16(buf + 28); - _h->compression = READ32(buf + 30); + _h->signature = read16(buf + 0); + _h->fileSize = read32(buf + 2); + _h->startRAW = read32(buf + 10); + _h->dibHeaderSize = read32(buf + 14); + _h->width = read32(buf + 18); + _h->height = read32(buf + 22); + _h->color = read16(buf + 28); + _h->compression = read32(buf + 30); - uint32_t totalColors = READ32(buf + 46); + uint32_t totalColors = read32(buf + 46); uint8_t paletteRGB[1024]; @@ -77,32 +80,32 @@ void Image::readBmpHeader(uint8_t *buf, bitmapHeader *_h) for (int i = 0; i < totalColors; ++i) { - uint32_t c = READ32(paletteRGB + (i << 2)); + uint32_t c = read32(paletteRGB + (i << 2)); uint8_t r = (c & 0xFF000000) >> 24; uint8_t g = (c & 0x00FF0000) >> 16; uint8_t b = (c & 0x0000FF00) >> 8; - palette[i >> 1] |= RGB3BIT(r, g, b) << (i & 1 ? 0 : 4); - ditherPalette[i] = RGB8BIT(r, g, b); + palette[i >> 1] |= rgb3Bit(r, g, b) << (i & 1 ? 0 : 4); + ditherPalette[i] = rgb8Bit(r, g, b); } } }; -bool Image::drawBitmapFromSd(const char *fileName, int x, int y, bool dither, bool invert) +bool Image::drawBitmapFromFile(const char *fileName, int x, int y, bool dither, bool invert) { - SdFile dat; - if (dat.open(fileName, O_RDONLY)) - return drawBitmapFromSd(&dat, x, y, dither, invert); + FILE * dat = fopen(fileName, "r"); + if (dat) + return drawBitmapFromFile(dat, x, y, dither, invert); else return 0; } -bool Image::drawBitmapFromSd(SdFile *p, int x, int y, bool dither, bool invert) +bool Image::drawBitmapFromFile(FILE * p, int x, int y, bool dither, bool invert) { bitmapHeader bmpHeader; - readBmpHeaderSd(p, &bmpHeader); + readBmpHeaderFromFile(p, &bmpHeader); if (!legalBmp(&bmpHeader)) return 0; @@ -110,13 +113,14 @@ bool Image::drawBitmapFromSd(SdFile *p, int x, int y, bool dither, bool invert) int16_t w = bmpHeader.width, h = bmpHeader.height; int8_t c = bmpHeader.color; - p->seekSet(bmpHeader.startRAW); + fseek(p, bmpHeader.startRAW, SEEK_SET); if (dither) - memset(ditherBuffer, 0, sizeof ditherBuffer); + memset(ditherBuffer, 0, ditherBufferSize); + for (int i = 0; i < h; ++i) { - int16_t n = ROWSIZE(w, c); - p->read(pixelBuffer, n); + int16_t n = rowSize(w, c); + fread(pixelBuffer, n, 1, p); displayBmpLine(x, y + bmpHeader.height - i - 1, &bmpHeader, dither, invert); } return 1; @@ -125,19 +129,8 @@ bool Image::drawBitmapFromSd(SdFile *p, int x, int y, bool dither, bool invert) bool Image::drawBitmapFromWeb(const char *url, int x, int y, bool dither, bool invert) { bool ret = 0; - int32_t defaultLen = E_INK_WIDTH * E_INK_HEIGHT * 4 + 150; - uint8_t *buf = downloadFile(url, &defaultLen); - - ret = drawBitmapFromBuffer(buf, x, y, dither, invert); - free(buf); - - return ret; -} - -bool Image::drawBitmapFromWeb(WiFiClient *s, int x, int y, int32_t len, bool dither, bool invert) -{ - bool ret = 0; - uint8_t *buf = downloadFile(s, len); + int32_t defaultLen = e_ink_width * e_ink_height * 4 + 150; + uint8_t *buf = network_client.downloadFile(url, &defaultLen); ret = drawBitmapFromBuffer(buf, x, y, dither, invert); free(buf); @@ -155,14 +148,14 @@ bool Image::drawBitmapFromBuffer(uint8_t *buf, int x, int y, bool dither, bool i return 0; if (dither) - memset(ditherBuffer, 0, sizeof ditherBuffer); + memset(ditherBuffer, 0, ditherBufferSize); uint8_t *bufferPtr = buf + bmpHeader.startRAW; for (int i = 0; i < bmpHeader.height; ++i) { - memcpy(pixelBuffer, bufferPtr, ROWSIZE(bmpHeader.width, bmpHeader.color)); + memcpy(pixelBuffer, bufferPtr, rowSize(bmpHeader.width, bmpHeader.color)); displayBmpLine(x, y + bmpHeader.height - i - 1, &bmpHeader, dither, invert); - bufferPtr += ROWSIZE(bmpHeader.width, bmpHeader.color); + bufferPtr += rowSize(bmpHeader.width, bmpHeader.color); } return 1; @@ -192,7 +185,7 @@ void Image::displayBmpLine(int16_t x, int16_t y, bitmapHeader *bmpHeader, bool d val = palette[px >> 1] & (px & 1 ? 0x0F : 0xF0) >> (px & 1 ? 0 : 4); if (invert) val = 7 - val; - if (getDisplayMode() == INKPLATE_1BIT) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) val = (~val >> 2) & 1; writePixel(x + j, y, val); @@ -208,7 +201,7 @@ void Image::displayBmpLine(int16_t x, int16_t y, bitmapHeader *bmpHeader, bool d val = palette[px >> 1] & (px & 1 ? 0x0F : 0xF0) >> (px & 1 ? 0 : 4); if (invert) val = 7 - val; - if (getDisplayMode() == INKPLATE_1BIT) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) val = (~val >> 2) & 1; writePixel(x + j, y, val); @@ -224,12 +217,12 @@ void Image::displayBmpLine(int16_t x, int16_t y, bitmapHeader *bmpHeader, bool d uint8_t val; if (dither) - val = ditherGetPixelBmp(RGB8BIT(r, g, b), j, w, 0); + val = ditherGetPixelBmp(rgb8Bit(r, g, b), j, w, 0); else - val = RGB3BIT(r, g, b); + val = rgb3Bit(r, g, b); if (invert) val = 7 - val; - if (getDisplayMode() == INKPLATE_1BIT) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) val = (~val >> 2) & 1; writePixel(x + j, y, val); @@ -243,12 +236,12 @@ void Image::displayBmpLine(int16_t x, int16_t y, bitmapHeader *bmpHeader, bool d uint8_t val; if (dither) - val = ditherGetPixelBmp(RGB8BIT(r, g, b), j, w, 0); + val = ditherGetPixelBmp(rgb8Bit(r, g, b), j, w, 0); else - val = RGB3BIT(r, g, b); + val = rgb3Bit(r, g, b); if (invert) val = 7 - val; - if (getDisplayMode() == INKPLATE_1BIT) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) val = (~val >> 2) & 1; writePixel(x + j, y, val); @@ -262,12 +255,12 @@ void Image::displayBmpLine(int16_t x, int16_t y, bitmapHeader *bmpHeader, bool d uint8_t val; if (dither) - val = ditherGetPixelBmp(RGB8BIT(r, g, b), j, w, 0); + val = ditherGetPixelBmp(rgb8Bit(r, g, b), j, w, 0); else - val = RGB3BIT(r, g, b); + val = rgb3Bit(r, g, b); if (invert) val = 7 - val; - if (getDisplayMode() == INKPLATE_1BIT) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) val = (~val >> 2) & 1; writePixel(x + j, y, val); diff --git a/lib/graphical/src/image_dither.cpp b/lib/graphical/src/image_dither.cpp index c6b4995..5a19813 100644 --- a/lib/graphical/src/image_dither.cpp +++ b/lib/graphical/src/image_dither.cpp @@ -15,28 +15,30 @@ Distributed as-is; no warranty is given. */ #include "image.hpp" +#include uint8_t Image::ditherGetPixelBmp(uint8_t px, int i, int w, bool paletted) { if (paletted) px = ditherPalette[px]; - if (getDisplayMode() == INKPLATE_1BIT) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) px = (uint16_t)px >> 1; - uint8_t oldPixel = min((uint16_t)0xFF, (uint16_t)((uint16_t)ditherBuffer[0][i] + px)); + uint8_t oldPixel = std::min((uint16_t)0xFF, (uint16_t)((uint16_t)ditherBuffer[i] + px)); - uint8_t newPixel = oldPixel & (getDisplayMode() == INKPLATE_1BIT ? B10000000 : B11100000); + uint8_t newPixel = oldPixel & (getDisplayMode() == DisplayMode::INKPLATE_1BIT ? 0b10000000 : 0b11100000); uint8_t quantError = oldPixel - newPixel; - ditherBuffer[1][i + 0] += (quantError * 5) >> 4; + int16_t line_2_offset = e_ink_width + 20; + ditherBuffer[line_2_offset + i + 0] += (quantError * 5) >> 4; if (i != w - 1) { - ditherBuffer[0][i + 1] += (quantError * 7) >> 4; - ditherBuffer[1][i + 1] += (quantError * 1) >> 4; + ditherBuffer[i + 1] += (quantError * 7) >> 4; + ditherBuffer[line_2_offset + i + 1] += (quantError * 1) >> 4; } if (i != 0) - ditherBuffer[1][i - 1] += (quantError * 3) >> 4; + ditherBuffer[line_2_offset + i - 1] += (quantError * 3) >> 4; return newPixel >> 5; } @@ -49,13 +51,13 @@ uint8_t Image::ditherGetPixelJpeg(uint8_t px, int i, int j, int x, int y, int w, blockH = h; } - if (getDisplayMode() == INKPLATE_1BIT) + if (getDisplayMode() == DisplayMode::INKPLATE_1BIT) px = (uint16_t)px >> 1; - uint16_t oldPixel = min((uint16_t)0xFF, (uint16_t)((uint16_t)px + (uint16_t)jpegDitherBuffer[j + 1][i + 1] + - (j ? (uint16_t)0 : (uint16_t)ditherBuffer[0][x + i]))); + uint16_t oldPixel = std::min((uint16_t)0xFF, (uint16_t)((uint16_t)px + (uint16_t)jpegDitherBuffer[j + 1][i + 1] + + (j ? (uint16_t)0 : (uint16_t)ditherBuffer[x + i]))); - uint8_t newPixel = oldPixel & (getDisplayMode() == INKPLATE_1BIT ? B10000000 : B11100000); + uint8_t newPixel = oldPixel & (getDisplayMode() == DisplayMode::INKPLATE_1BIT ? 0b10000000 : 0b11100000); uint8_t quantError = oldPixel - newPixel; jpegDitherBuffer[j + 1 + 1][i + 0 + 1] += (quantError * 5) >> 4; @@ -70,19 +72,21 @@ uint8_t Image::ditherGetPixelJpeg(uint8_t px, int i, int j, int x, int y, int w, void Image::ditherSwap(int w) { + int16_t line_2_offset = e_ink_width + 20; for (int i = 0; i < w; ++i) { - ditherBuffer[0][i] = ditherBuffer[1][i]; - ditherBuffer[1][i] = 0; + ditherBuffer[i] = ditherBuffer[line_2_offset + i]; + ditherBuffer[line_2_offset + i] = 0; } } void Image::ditherSwapBlockJpeg(int x) { + int16_t line_2_offset = e_ink_width + 20; for (int i = 0; i < 18; ++i) { if (x + i) - ditherBuffer[1][x + i - 1] += jpegDitherBuffer[blockH - 1 + 2][i]; + ditherBuffer[line_2_offset + x + i - 1] += jpegDitherBuffer[blockH - 1 + 2][i]; jpegDitherBuffer[i][0 + 1] = jpegDitherBuffer[i][blockW - 1 + 2]; } for (int j = 0; j < 18; ++j) diff --git a/lib/graphical/src/image_jpeg.cpp b/lib/graphical/src/image_jpeg.cpp index 2e8ac1d..d29d642 100644 --- a/lib/graphical/src/image_jpeg.cpp +++ b/lib/graphical/src/image_jpeg.cpp @@ -14,53 +14,50 @@ If you have any questions about licensing, please contact techsupport@e-radionic Distributed as-is; no warranty is given. */ +#include +#include + #include "image.hpp" #include "tjpg_decoder.hpp" +#include "network_client.hpp" +#include "inkplate_platform.hpp" extern Image *_imagePtrJpeg; -bool Image::drawJpegFromSd(const char *fileName, int x, int y, bool dither, bool invert) +bool Image::drawJpegFromFile(const char * fileName, int x, int y, bool dither, bool invert) { - SdFile dat; - if (dat.open(fileName, O_RDONLY)) - return drawJpegFromSd(&dat, x, y, dither, invert); + FILE * dat = fopen(fileName, "r"); + if (dat) + return drawJpegFromFile(dat, x, y, dither, invert); return 0; } -bool Image::drawJpegFromSd(SdFile *p, int x, int y, bool dither, bool invert) +bool Image::drawJpegFromFile(FILE * p, int x, int y, bool dither, bool invert) { uint8_t ret = 0; blockW = -1; blockH = -1; lastY = -1; - memset(ditherBuffer, 0, sizeof ditherBuffer); + memset(ditherBuffer, 0, ditherBufferSize); TJpgDec.setJpgScale(1); TJpgDec.setCallback(drawJpegChunk); - uint32_t pnt = 0; - uint32_t total = p->fileSize(); - uint8_t *buff = (uint8_t *)ps_malloc(total); + struct stat stat_buf; + fstat(fileno(p), &stat_buf); + uint32_t total = stat_buf.st_size; - if (buff == NULL) - return 0; + uint8_t *buff = (uint8_t *)malloc(total); - while (pnt < total) - { - uint32_t toread = p->available(); - if (toread > 0) - { - int read = p->read(buff + pnt, toread); - if (read > 0) - pnt += read; - } - } - p->close(); + if (buff == NULL) return 0; - if (TJpgDec.drawJpg(x, y, buff, total, dither, invert) == 0) - ret = 1; + if (fread(buff, total, 1, p) != 1) return 0; + + fclose(p); + + if (TJpgDec.drawJpg(x, y, buff, total, dither, invert) == 0) ret = 1; free(buff); @@ -71,8 +68,8 @@ bool Image::drawJpegFromWeb(const char *url, int x, int y, bool dither, bool inv { bool ret = 0; - int32_t defaultLen = E_INK_WIDTH * E_INK_HEIGHT * 4; - uint8_t *buff = downloadFile(url, &defaultLen); + int32_t defaultLen = e_ink_width * e_ink_height * 4; + uint8_t *buff = network_client.downloadFile(url, &defaultLen); ret = drawJpegFromBuffer(buff, defaultLen, x, y, dither, invert); free(buff); @@ -85,7 +82,7 @@ bool Image::drawJpegFromWebAtPosition(const char *url, const Position& position, bool ret = 0; int32_t defaultLen = 800 * 600 * 4; - uint8_t *buff = downloadFile(url, &defaultLen); + uint8_t *buff = network_client.downloadFile(url, &defaultLen); uint16_t w = 0; uint16_t h = 0; @@ -130,7 +127,7 @@ bool Image::drawJpegChunk(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t if (dither && y != _imagePtrJpeg->lastY) { - _imagePtrJpeg->ditherSwap(E_INK_WIDTH); + _imagePtrJpeg->ditherSwap(e_ink.get_width()); _imagePtrJpeg->lastY = y; } @@ -142,12 +139,12 @@ bool Image::drawJpegChunk(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t uint16_t rgb = bitmap[j * w + i]; uint8_t val; if (dither) - val = _imagePtrJpeg->ditherGetPixelJpeg(RGB8BIT(RED(rgb), GREEN(rgb), BLUE(rgb)), i, j, x, y, w, h); + val = _imagePtrJpeg->ditherGetPixelJpeg(rgb8Bit(red(rgb), green(rgb), blue(rgb)), i, j, x, y, w, h); else - val = RGB3BIT(RED(rgb), GREEN(rgb), BLUE(rgb)); + val = rgb3Bit(red(rgb), green(rgb), blue(rgb)); if (invert) val = 7 - val; - if (_imagePtrJpeg->getDisplayMode() == INKPLATE_1BIT) + if (_imagePtrJpeg->getDisplayMode() == DisplayMode::INKPLATE_1BIT) val = (~val >> 2) & 1; _imagePtrJpeg->writePixel(x + i, y + j, val); } diff --git a/lib/graphical/src/image_png.cpp b/lib/graphical/src/image_png.cpp index ecf5efe..ba121af 100644 --- a/lib/graphical/src/image_png.cpp +++ b/lib/graphical/src/image_png.cpp @@ -12,9 +12,15 @@ If you have any questions about licensing, please contact techsupport@e-radionic Distributed as-is; no warranty is given. */ +#include +#include + #include "image.hpp" #include "pngle.hpp" +#include "network_client.hpp" + +#include extern Image *_imagePtrPng; @@ -30,13 +36,13 @@ void pngle_on_draw(pngle_t *pngle, uint32_t x, uint32_t y, uint32_t w, uint32_t for (int j = 0; j < h; ++j) for (int i = 0; i < w; ++i) { - uint8_t px = RGB3BIT(rgba[0], rgba[1], rgba[2]); + uint8_t px = Image::rgb3Bit(rgba[0], rgba[1], rgba[2]); if (_pngDither) - px = _imagePtrPng->ditherGetPixelBmp(RGB8BIT(rgba[0], rgba[1], rgba[2]), x + i, + px = _imagePtrPng->ditherGetPixelBmp(Image::rgb8Bit(rgba[0], rgba[1], rgba[2]), x + i, _imagePtrPng->width(), 0); if (_pngInvert) px = 7 - px; - if (_imagePtrPng->getDisplayMode() == INKPLATE_1BIT) + if (_imagePtrPng->getDisplayMode() == DisplayMode::INKPLATE_1BIT) px = (~px >> 2) & 1; _imagePtrPng->drawPixel(_pngX + x + i, _pngY + y + j, px); } @@ -47,54 +53,49 @@ void pngle_on_draw(pngle_t *pngle, uint32_t x, uint32_t y, uint32_t w, uint32_t } } -bool Image::drawPngFromSd(const char *fileName, int x, int y, bool dither, bool invert) +bool Image::drawPngFromFile(const char * fileName, int x, int y, bool dither, bool invert) { - SdFile dat; - if (dat.open(fileName, O_RDONLY)) - { - return drawPngFromSd(&dat, x, y, dither, invert); + FILE * dat = fopen(fileName, "r"); + if (dat) { + return drawPngFromFile(dat, x, y, dither, invert); } return 0; } -bool Image::drawPngFromSd(SdFile *p, int x, int y, bool dither, bool invert) +bool Image::drawPngFromFile(FILE * p, int x, int y, bool dither, bool invert) { _pngDither = dither; _pngInvert = invert; lastY = y; bool ret = 1; - uint32_t remain = 0; - if (dither) - memset(ditherBuffer, 0, sizeof ditherBuffer); + if (dither) memset(ditherBuffer, 0, ditherBufferSize); pngle_t *pngle = pngle_new(); _pngX = x; _pngY = y; pngle_set_draw_callback(pngle, pngle_on_draw); - uint32_t total = p->fileSize(); + + struct stat stat_buf; + fstat(fileno(p), &stat_buf); + uint32_t total = stat_buf.st_size; + uint8_t buff[2048]; - uint32_t pnt = 0; + + uint32_t toread = total; - while (pnt < total) + while (toread > 0) { - uint32_t toread = p->available(); - if (toread > 0) - { - int len = p->read(buff, min((uint32_t)2048, toread)); - int fed = pngle_feed(pngle, buff, len); - if (fed < 0) - { - ret = 0; - break; - } - remain = remain + len - fed; - pnt += len; - } + int len = fread(buff, std::min((uint32_t)2048, toread), 1, p); + if (pngle_feed(pngle, buff, len) < 0) { + ret = 0; + break; + } + toread -= len; } - p->close(); + fclose(p); pngle_destroy(pngle); return ret; } @@ -108,15 +109,15 @@ bool Image::drawPngFromWeb(const char *url, int x, int y, bool dither, bool inve bool ret = 1; if (dither) - memset(ditherBuffer, 0, sizeof ditherBuffer); + memset(ditherBuffer, 0, ditherBufferSize); pngle_t *pngle = pngle_new(); _pngX = x; _pngY = y; pngle_set_draw_callback(pngle, pngle_on_draw); - int32_t defaultLen = E_INK_WIDTH * E_INK_HEIGHT * 4 + 100; - uint8_t *buff = downloadFile(url, &defaultLen); + int32_t defaultLen = e_ink_width * e_ink_height * 4 + 100; + uint8_t *buff = network_client.downloadFile(url, &defaultLen); if (!buff) return 0; @@ -129,31 +130,31 @@ bool Image::drawPngFromWeb(const char *url, int x, int y, bool dither, bool inve return ret; } -bool Image::drawPngFromWeb(WiFiClient *s, int x, int y, int32_t len, bool dither, bool invert) -{ - _pngDither = dither; - _pngInvert = invert; - lastY = y; +// bool Image::drawPngFromWeb(WiFiClient *s, int x, int y, int32_t len, bool dither, bool invert) +// { +// _pngDither = dither; +// _pngInvert = invert; +// lastY = y; - bool ret = 1; +// bool ret = 1; - if (dither) - memset(ditherBuffer, 0, sizeof ditherBuffer); +// if (dither) +// memset(ditherBuffer, 0, ditherBufferSize); - pngle_t *pngle = pngle_new(); - _pngX = x; - _pngY = y; - pngle_set_draw_callback(pngle, pngle_on_draw); +// pngle_t *pngle = pngle_new(); +// _pngX = x; +// _pngY = y; +// pngle_set_draw_callback(pngle, pngle_on_draw); - uint8_t *buff = downloadFile(s, len); +// uint8_t *buff = downloadFile(s, len); - if (!buff) - return 0; +// if (!buff) +// return 0; - if (pngle_feed(pngle, buff, len) < 0) - ret = 0; - pngle_destroy(pngle); +// if (pngle_feed(pngle, buff, len) < 0) +// ret = 0; +// pngle_destroy(pngle); - free(buff); - return ret; -} \ No newline at end of file +// free(buff); +// return ret; +// } \ No newline at end of file diff --git a/lib/graphical/src/inkplate.cpp b/lib/graphical/src/inkplate.cpp new file mode 100644 index 0000000..8919f07 --- /dev/null +++ b/lib/graphical/src/inkplate.cpp @@ -0,0 +1,25 @@ +/* +inkplate.cpp +Inkplate 6 Arduino library +David Zovko, Borna Biro, Denis Vajak, Zvonimir Haramustek @ e-radionica.com +September 24, 2020 +https://github.com/e-radionicacom/Inkplate-6-Arduino-library + +For support, please reach over forums: forum.e-radionica.com/en +For more info about the product, please check: www.inkplate.io + +This code is released under the GNU Lesser General Public License v3.0: https://www.gnu.org/licenses/lgpl-3.0.en.html +Please review the LICENSE file included with this example. +If you have any questions about licensing, please contact techsupport@e-radionica.com +Distributed as-is; no warranty is given. +*/ + +#include "inkplate.hpp" +#include "inkplate_platform.hpp" + +Inkplate::Inkplate(DisplayMode mode) : + Adafruit_GFX(e_ink.get_width(), e_ink.get_height()), + Graphics(e_ink.get_width(), e_ink.get_height()) +{ + setDisplayMode(mode); +} diff --git a/lib/inkplate/src/inkplate.hpp b/lib/graphical/src/inkplate.hpp similarity index 67% rename from lib/inkplate/src/inkplate.hpp rename to lib/graphical/src/inkplate.hpp index cce9066..b3dcab6 100644 --- a/lib/inkplate/src/inkplate.hpp +++ b/lib/graphical/src/inkplate.hpp @@ -17,6 +17,8 @@ Distributed as-is; no warranty is given. #ifndef __INKPLATE_H__ #define __INKPLATE_H__ +#include "defines.hpp" + #include "graphics.hpp" #include "inkplate_platform.hpp" #include "network_client.hpp" @@ -25,25 +27,19 @@ class Inkplate : public Graphics { private: NetworkClient network_client; + public: - Inkplate(uint8_t mode); - - void begin(void); - void clearDisplay(); - void display(); - void preloadScreen(); - void partialUpdate(bool); - void clean(); - void einkOn(); - void einkOff(); - uint8_t readPowerGood(); - bool joinAP(const char *ssid, const char *pass) { - return network_client.joinAP(ssid, pass); - } + Inkplate(DisplayMode mode); + + void begin(void) { inkplate_platform.setup(); } + + uint8_t readPowerGood(); - void disconnect() { network_client.disconnect(); } - bool isConnected() { return network_client.isConnected(); } + inline bool joinAP(const char * ssid, const char * pass) { return network_client.joinAP(ssid, pass); } + inline void disconnect() { network_client.disconnect(); } + inline bool isConnected() { return network_client.isConnected(); } + inline int _getRotation() { return Graphics::getRotation(); }; }; #endif diff --git a/lib/graphical/src/pngle.cpp b/lib/graphical/src/pngle.cpp index 61e9f2a..75f3965 100644 --- a/lib/graphical/src/pngle.cpp +++ b/lib/graphical/src/pngle.cpp @@ -31,18 +31,20 @@ #include "miniz.hpp" #include "pngle.hpp" -#ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif +#include #ifdef PNGLE_DEBUG #define debug_printf(...) fprintf(stderr, __VA_ARGS__) #else -#define debug_printf(...) ((void)0) +#define debug_printf(...) #endif #define PNGLE_ERROR(s) (pngle->error = (s), pngle->state = PNGLE_STATE_ERROR, -1) -#define PNGLE_CALLOC(a, b, name) (debug_printf("[pngle] Allocating %zu bytes for %s\n", (size_t)(a) * (size_t)(b), (name)), calloc((size_t)(a), (size_t)(b))) + +inline uint8_t * PNGLE_CALLOC(size_t a, size_t b, const char * name) { + debug_printf("[pngle] Allocating %d bytes for %s\n", a * b, name); + return (uint8_t *) calloc(a, b); +} #define PNGLE_UNUSED(x) (void)(x) @@ -247,6 +249,8 @@ static inline uint16_t get_value(pngle_t *pngle, size_t *ridx, int *bitcount, in { uint16_t v; + v = 0; + switch (depth) { case 1: case 2: @@ -256,14 +260,17 @@ static inline uint16_t get_value(pngle_t *pngle, size_t *ridx, int *bitcount, in *ridx = (*ridx + 1) % pngle->scanline_ringbuf_size; } *bitcount += depth; - uint8_t mask = ((1UL << depth) - 1); - uint8_t shift = (8 - *bitcount); - return (pngle->scanline_ringbuf[*ridx] >> shift) & mask; + { + uint8_t mask = ((1UL << depth) - 1); + uint8_t shift = (8 - *bitcount); + v = (pngle->scanline_ringbuf[*ridx] >> shift) & mask; + } + break; case 8: v = pngle->scanline_ringbuf[*ridx]; *ridx = (*ridx + 1) % pngle->scanline_ringbuf_size; - return v; + break; case 16: v = pngle->scanline_ringbuf[*ridx]; @@ -271,10 +278,14 @@ static inline uint16_t get_value(pngle_t *pngle, size_t *ridx, int *bitcount, in v = v * 0x100 + pngle->scanline_ringbuf[*ridx]; *ridx = (*ridx + 1) % pngle->scanline_ringbuf_size; - return v; + break; + + default: + v = 0; + break; } - return 0; + return v; } static int pngle_draw_pixels(pngle_t *pngle, size_t scanline_ringbuf_xidx) @@ -325,10 +336,10 @@ static int pngle_draw_pixels(pngle_t *pngle, size_t scanline_ringbuf_xidx) if (pngle->draw_callback) { uint8_t rgba[4] = { - (v[0] * 255 + maxval / 2) / maxval, - (v[1] * 255 + maxval / 2) / maxval, - (v[2] * 255 + maxval / 2) / maxval, - (v[3] * 255 + maxval / 2) / maxval + (uint8_t)((v[0] * 255 + maxval / 2) / maxval), + (uint8_t)((v[1] * 255 + maxval / 2) / maxval), + (uint8_t)((v[2] * 255 + maxval / 2) / maxval), + (uint8_t)((v[3] * 255 + maxval / 2) / maxval) }; #ifndef PNGLE_NO_GAMMA_CORRECTION @@ -340,8 +351,8 @@ static int pngle_draw_pixels(pngle_t *pngle, size_t scanline_ringbuf_xidx) #endif pngle->draw_callback(pngle, pngle->drawing_x, pngle->drawing_y - , MIN(interlace_div_x[pngle->interlace_pass] - interlace_off_x[pngle->interlace_pass], pngle->hdr.width - pngle->drawing_x) - , MIN(interlace_div_y[pngle->interlace_pass] - interlace_off_y[pngle->interlace_pass], pngle->hdr.height - pngle->drawing_y) + , std::min(interlace_div_x[pngle->interlace_pass] - interlace_off_x[pngle->interlace_pass], pngle->hdr.width - pngle->drawing_x) + , std::min(interlace_div_y[pngle->interlace_pass] - interlace_off_y[pngle->interlace_pass], pngle->hdr.height - pngle->drawing_y) , rgba ); } @@ -373,7 +384,8 @@ static int set_interlace_pass(pngle_t *pngle, uint_fast8_t pass) pngle->scanline_ringbuf_size = scanline_stride + bytes_per_pixel * 2; // 2 rooms for c/x and a if (pngle->scanline_ringbuf) free(pngle->scanline_ringbuf); - if ((pngle->scanline_ringbuf = PNGLE_CALLOC(pngle->scanline_ringbuf_size, 1, "scanline ringbuf")) == NULL) return PNGLE_ERROR("Insufficient memory"); + pngle->scanline_ringbuf = PNGLE_CALLOC(pngle->scanline_ringbuf_size, 1, "scanline ringbuf"); + if (!pngle->scanline_ringbuf) return PNGLE_ERROR("Insufficient memory"); pngle->drawing_x = interlace_off_x[pngle->interlace_pass]; pngle->drawing_y = interlace_off_y[pngle->interlace_pass]; @@ -559,49 +571,50 @@ static int pngle_handle_chunk(pngle_t *pngle, const uint8_t *buf, size_t len) break; - case PNGLE_CHUNK_IDAT: - // parse & decode IDAT chunk - if (len < 1) return 0; + case PNGLE_CHUNK_IDAT: { + // parse & decode IDAT chunk + if (len < 1) return 0; - debug_printf("[pngle] Reading IDAT (len %zd / chunk remain %u)\n", len, pngle->chunk_remain); + debug_printf("[pngle] Reading IDAT (len %zd / chunk remain %u)\n", len, pngle->chunk_remain); - size_t in_bytes = len; - size_t out_bytes = pngle->avail_out; + size_t in_bytes = len; + size_t out_bytes = pngle->avail_out; - //debug_printf("[pngle] in_bytes %zd, out_bytes %zd, next_out %p\n", in_bytes, out_bytes, pngle->next_out); + //debug_printf("[pngle] in_bytes %zd, out_bytes %zd, next_out %p\n", in_bytes, out_bytes, pngle->next_out); - // XXX: tinfl_decompress always requires (next_out - lz_buf + avail_out) == TINFL_LZ_DICT_SIZE - tinfl_status status = tinfl_decompress(&pngle->inflator, (const mz_uint8 *)buf, &in_bytes, pngle->lz_buf, (mz_uint8 *)pngle->next_out, &out_bytes, TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_PARSE_ZLIB_HEADER); + // XXX: tinfl_decompress always requires (next_out - lz_buf + avail_out) == TINFL_LZ_DICT_SIZE + tinfl_status status = tinfl_decompress(&pngle->inflator, (const mz_uint8 *)buf, &in_bytes, pngle->lz_buf, (mz_uint8 *)pngle->next_out, &out_bytes, TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_PARSE_ZLIB_HEADER); - //debug_printf("[pngle] tinfl_decompress\n"); - //debug_printf("[pngle] => in_bytes %zd, out_bytes %zd, next_out %p, status %d\n", in_bytes, out_bytes, pngle->next_out, status); + //debug_printf("[pngle] tinfl_decompress\n"); + //debug_printf("[pngle] => in_bytes %zd, out_bytes %zd, next_out %p, status %d\n", in_bytes, out_bytes, pngle->next_out, status); - if (status < TINFL_STATUS_DONE) { - // Decompression failed. - debug_printf("[pngle] tinfl_decompress() failed with status %d!\n", status); - return PNGLE_ERROR("Failed to decompress the IDAT stream"); - } + if (status < TINFL_STATUS_DONE) { + // Decompression failed. + debug_printf("[pngle] tinfl_decompress() failed with status %d!\n", status); + return PNGLE_ERROR("Failed to decompress the IDAT stream"); + } - pngle->next_out += out_bytes; - pngle->avail_out -= out_bytes; + pngle->next_out += out_bytes; + pngle->avail_out -= out_bytes; - // debug_printf("[pngle] => avail_out %zd, next_out %p\n", pngle->avail_out, pngle->next_out); + // debug_printf("[pngle] => avail_out %zd, next_out %p\n", pngle->avail_out, pngle->next_out); - if (status == TINFL_STATUS_DONE || pngle->avail_out == 0) { - // Output buffer is full, or decompression is done, so write buffer to output file. - // XXX: This is the only chance to process the buffer. - uint8_t *read_ptr = pngle->lz_buf; - size_t n = TINFL_LZ_DICT_SIZE - (size_t)pngle->avail_out; + if (status == TINFL_STATUS_DONE || pngle->avail_out == 0) { + // Output buffer is full, or decompression is done, so write buffer to output file. + // XXX: This is the only chance to process the buffer. + uint8_t *read_ptr = pngle->lz_buf; + size_t n = TINFL_LZ_DICT_SIZE - (size_t)pngle->avail_out; - // pngle_on_data() usually returns n, otherwise -1 on error - if (pngle_on_data(pngle, read_ptr, n) < 0) return -1; + // pngle_on_data() usually returns n, otherwise -1 on error + if (pngle_on_data(pngle, read_ptr, n) < 0) return -1; - // XXX: tinfl_decompress always requires (next_out - lz_buf + avail_out) == TINFL_LZ_DICT_SIZE - pngle->next_out = pngle->lz_buf; - pngle->avail_out = TINFL_LZ_DICT_SIZE; - } + // XXX: tinfl_decompress always requires (next_out - lz_buf + avail_out) == TINFL_LZ_DICT_SIZE + pngle->next_out = pngle->lz_buf; + pngle->avail_out = TINFL_LZ_DICT_SIZE; + } - consume = in_bytes; + consume = in_bytes; + } break; case PNGLE_CHUNK_PLTE: @@ -730,8 +743,9 @@ static int pngle_feed_internal(pngle_t *pngle, const uint8_t *buf, size_t len) } if (pngle->chunk_remain % 3) return PNGLE_ERROR("Invalid PLTE chunk size"); - if (pngle->chunk_remain / 3 > MIN(256, (1UL << pngle->hdr.depth))) return PNGLE_ERROR("Too many palettes in PLTE"); - if ((pngle->palette = PNGLE_CALLOC(pngle->chunk_remain / 3, 3, "palette")) == NULL) return PNGLE_ERROR("Insufficient memory"); + if (pngle->chunk_remain / 3 > std::min((long unsigned int)256, (1UL << pngle->hdr.depth))) return PNGLE_ERROR("Too many palettes in PLTE"); + pngle->palette = PNGLE_CALLOC(pngle->chunk_remain / 3, 3, "palette"); + if (pngle->palette) return PNGLE_ERROR("Insufficient memory"); pngle->n_palettes = 0; break; @@ -759,7 +773,8 @@ static int pngle_feed_internal(pngle_t *pngle, const uint8_t *buf, size_t len) default: return PNGLE_ERROR("tRNS chunk is prohibited on the color type"); } - if ((pngle->trans_palette = PNGLE_CALLOC(pngle->chunk_remain, 1, "trans palette")) == NULL) return PNGLE_ERROR("Insufficient memory"); + pngle->trans_palette = PNGLE_CALLOC(pngle->chunk_remain, 1, "trans palette"); + if (pngle->trans_palette) return PNGLE_ERROR("Insufficient memory"); pngle->n_trans_palettes = 0; break; @@ -769,41 +784,42 @@ static int pngle_feed_internal(pngle_t *pngle, const uint8_t *buf, size_t len) return 8; - case PNGLE_STATE_HANDLE_CHUNK: - len = MIN(len, pngle->chunk_remain); + case PNGLE_STATE_HANDLE_CHUNK: { + len = std::min(len, pngle->chunk_remain); - int consumed = pngle_handle_chunk(pngle, buf, len); + int consumed = pngle_handle_chunk(pngle, buf, len); - if (consumed > 0) { - if (pngle->chunk_remain < (uint32_t)consumed) return PNGLE_ERROR("Chunk data has been consumed too much"); + if (consumed > 0) { + if (pngle->chunk_remain < (uint32_t)consumed) return PNGLE_ERROR("Chunk data has been consumed too much"); - pngle->chunk_remain -= consumed; - pngle->crc32 = mz_crc32(pngle->crc32, (const mz_uint8 *)buf, consumed); - } - if (pngle->chunk_remain <= 0) pngle->state = PNGLE_STATE_CRC; + pngle->chunk_remain -= consumed; + pngle->crc32 = mz_crc32(pngle->crc32, (const mz_uint8 *)buf, consumed); + } + if (pngle->chunk_remain <= 0) pngle->state = PNGLE_STATE_CRC; - return consumed; + return consumed; + } - case PNGLE_STATE_CRC: - if (len < 4) return 0; + case PNGLE_STATE_CRC: { + if (len < 4) return 0; - uint32_t crc32 = read_uint32(buf); + uint32_t crc32 = read_uint32(buf); - if (crc32 != pngle->crc32) { - debug_printf("[pngle] CRC: %08x vs %08x => NG\n", crc32, (uint32_t)pngle->crc32); - return PNGLE_ERROR("CRC mismatch"); - } + if (crc32 != pngle->crc32) { + debug_printf("[pngle] CRC: %08x vs %08x => NG\n", crc32, (uint32_t)pngle->crc32); + return PNGLE_ERROR("CRC mismatch"); + } - debug_printf("[pngle] CRC: %08x vs %08x => OK\n", crc32, (uint32_t)pngle->crc32); - pngle->state = PNGLE_STATE_FIND_CHUNK_HEADER; - - // XXX: - if (pngle->chunk_type == PNGLE_CHUNK_IEND) { - pngle->state = PNGLE_STATE_EOF; - if (pngle->done_callback) pngle->done_callback(pngle); - debug_printf("[pngle] DONE\n"); - } + debug_printf("[pngle] CRC: %08x vs %08x => OK\n", crc32, (uint32_t)pngle->crc32); + pngle->state = PNGLE_STATE_FIND_CHUNK_HEADER; + // XXX: + if (pngle->chunk_type == PNGLE_CHUNK_IEND) { + pngle->state = PNGLE_STATE_EOF; + if (pngle->done_callback) pngle->done_callback(pngle); + debug_printf("[pngle] DONE\n"); + } + } return 4; default: @@ -834,11 +850,11 @@ int pngle_feed(pngle_t *pngle, const void *buf, size_t len) void pngle_set_display_gamma(pngle_t *pngle, double display_gamma) { if (!pngle) return ; -#ifndef PNGLE_NO_GAMMA_CORRECTION - pngle->display_gamma = display_gamma; -#else - PNGLE_UNUSED(display_gamma); -#endif + #ifndef PNGLE_NO_GAMMA_CORRECTION + pngle->display_gamma = display_gamma; + #else + PNGLE_UNUSED(display_gamma); + #endif } void pngle_set_init_callback(pngle_t *pngle, pngle_init_callback_t callback) diff --git a/lib/graphical/src/print.cpp b/lib/graphical/src/print.cpp index e638d70..1b91ac7 100644 --- a/lib/graphical/src/print.cpp +++ b/lib/graphical/src/print.cpp @@ -24,12 +24,13 @@ #include #include #include -#include +#include -#include "print.h" +#include "print.hpp" + +#include extern "C" { - #include "stdarg.h" #include "time.h" } @@ -49,7 +50,7 @@ size_t Print::write(const uint8_t *buffer, size_t size) //undefined reference to `Print::printf(char const*, ...) // I just want to use Adafruit_GFX print function but not // overload ESP-IDF owns means to do printf -/* size_t Print::printf(const char *format, ...) +size_t Print::printf(const char *format, ...) { char loc_buf[64]; char * temp = loc_buf; @@ -77,14 +78,9 @@ size_t Print::write(const uint8_t *buffer, size_t size) free(temp); } return len; -} */ - -size_t Print::print(const __FlashStringHelper *ifsh) -{ - return print(reinterpret_cast(ifsh)); } -size_t Print::print(const String &s) +size_t Print::print(const std::string &s) { return write(s.c_str(), s.length()); } @@ -144,13 +140,6 @@ size_t Print::print(double n, int digits) return printFloat(n, digits); } -size_t Print::println(const __FlashStringHelper *ifsh) -{ - size_t n = print(ifsh); - n += println(); - return n; -} - size_t Print::print(const Printable& x) { return x.printTo(*this); @@ -175,7 +164,7 @@ size_t Print::println(void) return print("\r\n"); } -size_t Print::println(const String &s) +size_t Print::println(const std::string &s) { size_t n = print(s); n += println(); diff --git a/lib/graphical/src/print.hpp b/lib/graphical/src/print.hpp index a5199b9..d3e7e95 100644 --- a/lib/graphical/src/print.hpp +++ b/lib/graphical/src/print.hpp @@ -1,5 +1,5 @@ /* - Print.h - Base class that provides print() and println() + print.hpp - Base class that provides print() and println() Copyright (c) 2008 David A. Mellis. All right reserved. This library is free software; you can redistribute it and/or @@ -22,7 +22,9 @@ #include #include -#include "wstring.hpp" +#include +#include + #include "printable.hpp" #define DEC 10 @@ -72,9 +74,8 @@ public: return write((const uint8_t *) buffer, size); } - //size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3))); - size_t print(const __FlashStringHelper *); - size_t print(const String &); + size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3))); + size_t print(const std::string &); size_t print(const char[]); size_t print(char); size_t print(unsigned char, int = DEC); @@ -86,8 +87,7 @@ public: size_t print(const Printable&); size_t print(struct tm * timeinfo, const char * format = NULL); - size_t println(const __FlashStringHelper *); - size_t println(const String &s); + size_t println(const std::string &s); size_t println(const char[]); size_t println(char); size_t println(unsigned char, int = DEC); diff --git a/lib/graphical/src/printable.hpp b/lib/graphical/src/printable.hpp index 011a338..b0b1524 100644 --- a/lib/graphical/src/printable.hpp +++ b/lib/graphical/src/printable.hpp @@ -1,5 +1,5 @@ /* - Printable.h - Interface class that allows printing of complex types + printable.hpp - Interface class that allows printing of complex types Copyright (c) 2011 Adrian McEwen. All right reserved. This library is free software; you can redistribute it and/or diff --git a/lib/graphical/src/shapes.cpp b/lib/graphical/src/shapes.cpp index e806898..ca5f1d8 100644 --- a/lib/graphical/src/shapes.cpp +++ b/lib/graphical/src/shapes.cpp @@ -14,20 +14,9 @@ If you have any questions about licensing, please contact techsupport@e-radionic Distributed as-is; no warranty is given. */ -#include "shapes.hpp" - -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif +#include -#ifndef _swap_int16_t -#define _swap_int16_t(a, b) \ - { \ - int16_t t = a; \ - a = b; \ - b = t; \ - } -#endif +#include "shapes.hpp" void Shapes::drawElipse(int rx, int ry, int xc, int yc, int c) { diff --git a/lib/graphical/src/shapes.hpp b/lib/graphical/src/shapes.hpp index 2207c0a..8f04960 100644 --- a/lib/graphical/src/shapes.hpp +++ b/lib/graphical/src/shapes.hpp @@ -1,5 +1,5 @@ /* -shapes.h +shapes.hpp Inkplate 6 Arduino library David Zovko, Borna Biro, Denis Vajak, Zvonimir Haramustek @ e-radionica.com September 24, 2020 @@ -17,6 +17,7 @@ Distributed as-is; no warranty is given. #ifndef __SHAPES_HPP__ #define __SHAPES_HPP__ +#include "defines.hpp" #include "adafruit_gfx.hpp" #define maxVer 100 @@ -29,45 +30,43 @@ class Shapes : virtual public Adafruit_GFX virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0; - virtual void selectDisplayMode(uint8_t _mode) = 0; - virtual uint8_t getDisplayMode() = 0; + virtual void selectDisplayMode(DisplayMode mode) = 0; + virtual DisplayMode getDisplayMode() = 0; - void drawElipse(int rx, int ry, int xc, int yc, int c); - void fillElipse(int rx, int ry, int xc, int yc, int c); - void drawPolygon(int *x, int *y, int n, int color); - void fillPolygon(int *x, int *y, int n, int color); - void drawThickLine(int x1, int y1, int x2, int y2, int color, float thickness); + void drawElipse(int rx, int ry, int xc, int yc, int c); + void fillElipse(int rx, int ry, int xc, int yc, int c); + void drawPolygon(int *x, int *y, int n, int color); + void fillPolygon(int *x, int *y, int n, int color); + void drawThickLine(int x1, int y1, int x2, int y2, int color, float thickness); void drawGradientLine(int x1, int y1, int x2, int y2, int color1, int color2, float thickness = -1); private: - struct EdgeBucket - { - int ymax; + struct EdgeBucket { + int ymax; float xofymin; float slopeinverse; }; - struct edgeTableTuple - { + struct edgeTableTuple { int countEdgeBucket; EdgeBucket buckets[maxVer]; }; - void initedgeTable(); - void insertionSort(edgeTableTuple *ett); - void storeEdgeInTuple(edgeTableTuple *receiver, int ym, int xm, float slopInv); - void storeEdgeInTable(int x1, int y1, int x2, int y2); - void removeEdgeByYmax(edgeTableTuple *tup, int yy); + void initedgeTable(); + void insertionSort(edgeTableTuple *ett); + void storeEdgeInTuple(edgeTableTuple *receiver, int ym, int xm, float slopInv); + void storeEdgeInTable(int x1, int y1, int x2, int y2); + void removeEdgeByYmax(edgeTableTuple *tup, int yy); void updatexbyslopeinv(edgeTableTuple *tup); - void scanlineFill(uint8_t c); + void scanlineFill(uint8_t c); - virtual void startWrite(void) = 0; - virtual void writePixel(int16_t x, int16_t y, uint16_t color) = 0; - virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) = 0; + virtual void startWrite(void) = 0; + virtual void writePixel(int16_t x, int16_t y, uint16_t color) = 0; + virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) = 0; virtual void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) = 0; virtual void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) = 0; - virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) = 0; - virtual void endWrite(void) = 0; + virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) = 0; + virtual void endWrite(void) = 0; edgeTableTuple *edgeTable, activeEdgeTuple; }; diff --git a/lib/graphical/src/stdio_noniso.cpp b/lib/graphical/src/stdlib_noniso.cpp similarity index 97% rename from lib/graphical/src/stdio_noniso.cpp rename to lib/graphical/src/stdlib_noniso.cpp index add914c..2e3b176 100644 --- a/lib/graphical/src/stdio_noniso.cpp +++ b/lib/graphical/src/stdlib_noniso.cpp @@ -1,5 +1,5 @@ /* - core_esp8266_noniso.c - nonstandard (but usefull) conversion functions + core_esp8266_noniso.cpp - nonstandard (but usefull) conversion functions Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. This file is part of the esp8266 core for Arduino environment. @@ -26,7 +26,8 @@ #include #include #include -#include +#include + #include "stdlib_noniso.hpp" void reverse(char* begin, char* end) { diff --git a/lib/graphical/src/stdio_noniso.hpp b/lib/graphical/src/stdlib_noniso.hpp similarity index 95% rename from lib/graphical/src/stdio_noniso.hpp rename to lib/graphical/src/stdlib_noniso.hpp index 6bdb630..79ba286 100644 --- a/lib/graphical/src/stdio_noniso.hpp +++ b/lib/graphical/src/stdlib_noniso.hpp @@ -18,8 +18,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef STDLIB_NONISO_H -#define STDLIB_NONISO_H +#ifndef __STDLIB_NONISO_HPP__ +#define __STDLIB_NONISO_HPP__ #ifdef __cplusplus extern "C" { diff --git a/lib/graphical/src/tjpg_decoder.cpp b/lib/graphical/src/tjpg_decoder.cpp index eee5f4a..791d9d0 100644 --- a/lib/graphical/src/tjpg_decoder.cpp +++ b/lib/graphical/src/tjpg_decoder.cpp @@ -9,6 +9,8 @@ https://github.com/Bodmer/TJpg_Decoder #include "tjpg_decoder.hpp" +#include + // Create a class instance to be used by the sketch (defined as extern in header) TJpg_Decoder TJpgDec; @@ -94,7 +96,7 @@ uint16_t TJpg_Decoder::jd_input(JDEC *jdec, uint8_t *buf, uint16_t len) // If buf is valid then copy len bytes to buffer if (buf) - memcpy_P(buf, (const uint8_t *)(thisPtr->array_data + thisPtr->array_index), len); + memcpy(buf, (const uint8_t *)(thisPtr->array_data + thisPtr->array_index), len); // Move pointer thisPtr->array_index += len; diff --git a/lib/graphical/src/tjpgd.cpp b/lib/graphical/src/tjpgd.cpp index 93d8103..2b68974 100644 --- a/lib/graphical/src/tjpgd.cpp +++ b/lib/graphical/src/tjpgd.cpp @@ -517,7 +517,7 @@ static JRESULT mcu_load ( d = jd->dcv[cmp]; /* DC value of previous block */ if (b) { /* If there is any difference from previous block */ e = bitext(jd, b); /* Extract data bits */ - if (e < 0) return 0 - e; /* Err: input */ + if (e < 0) return (JRESULT)(0 - e); /* Err: input */ b = 1 << (b - 1); /* MSB position */ if (!(e & b)) e -= (b << 1) - 1; /* Restore sign if needed */ d += e; /* Get current value */ @@ -543,7 +543,7 @@ static JRESULT mcu_load ( } if (b &= 0x0F) { /* Bit length */ d = bitext(jd, b); /* Extract data bits */ - if (d < 0) return 0 - d; /* Err: input device */ + if (d < 0) return (JRESULT)(0 - d); /* Err: input device */ b = 1 << (b - 1); /* MSB position */ if (!(d & b)) d -= (b << 1) - 1;/* Restore negative value if needed */ z = ZIG(i); /* Zigzag-order to raster-order converted index */ @@ -1007,7 +1007,7 @@ JRESULT jd_decomp ( / Mar 16, 2019 R0.01c Supprted stdint.h. /----------------------------------------------------------------------------*/ -#include "tjpgd.h" +#include "tjpgd.hpp" /*-----------------------------------------------*/ @@ -1138,7 +1138,7 @@ static void* alloc_pool ( /* Pointer to allocated memory block (NULL:no memory a /* Create de-quantization and prescaling tables with a DQT segment */ /*-----------------------------------------------------------------------*/ -static int create_qt_tbl ( /* 0:OK, !0:Failed */ +static JRESULT create_qt_tbl ( /* 0:OK, !0:Failed */ JDEC* jd, /* Pointer to the decompressor object */ const uint8_t* data, /* Pointer to the quantizer tables */ uint16_t ndata /* Size of input data */ @@ -1155,7 +1155,7 @@ static int create_qt_tbl ( /* 0:OK, !0:Failed */ d = *data++; /* Get table property */ if (d & 0xF0) return JDR_FMT1; /* Err: not 8-bit resolution */ i = d & 3; /* Get table ID */ - pb = alloc_pool(jd, 64 * sizeof (int32_t));/* Allocate a memory block for the table */ + pb = (int32_t *) alloc_pool(jd, 64 * sizeof (int32_t));/* Allocate a memory block for the table */ if (!pb) return JDR_MEM1; /* Err: not enough memory */ jd->qttbl[i] = pb; /* Register the table */ for (i = 0; i < 64; i++) { /* Load the table */ @@ -1174,7 +1174,7 @@ static int create_qt_tbl ( /* 0:OK, !0:Failed */ /* Create huffman code tables with a DHT segment */ /*-----------------------------------------------------------------------*/ -static int create_huffman_tbl ( /* 0:OK, !0:Failed */ +static JRESULT create_huffman_tbl ( /* 0:OK, !0:Failed */ JDEC* jd, /* Pointer to the decompressor object */ const uint8_t* data, /* Pointer to the packed huffman tables */ uint16_t ndata /* Size of input data */ @@ -1191,13 +1191,13 @@ static int create_huffman_tbl ( /* 0:OK, !0:Failed */ d = *data++; /* Get table number and class */ if (d & 0xEE) return JDR_FMT1; /* Err: invalid class/number */ cls = d >> 4; num = d & 0x0F; /* class = dc(0)/ac(1), table number = 0/1 */ - pb = alloc_pool(jd, 16); /* Allocate a memory block for the bit distribution table */ + pb = (uint8_t *) alloc_pool(jd, 16); /* Allocate a memory block for the bit distribution table */ if (!pb) return JDR_MEM1; /* Err: not enough memory */ jd->huffbits[num][cls] = pb; for (np = i = 0; i < 16; i++) { /* Load number of patterns for 1 to 16-bit code */ np += (pb[i] = *data++); /* Get sum of code words for each code */ } - ph = alloc_pool(jd, (uint16_t)(np * sizeof (uint16_t)));/* Allocate a memory block for the code word table */ + ph = (uint16_t *) alloc_pool(jd, (uint16_t)(np * sizeof (uint16_t)));/* Allocate a memory block for the code word table */ if (!ph) return JDR_MEM1; /* Err: not enough memory */ jd->huffcode[num][cls] = ph; hc = 0; @@ -1209,7 +1209,7 @@ static int create_huffman_tbl ( /* 0:OK, !0:Failed */ if (ndata < np) return JDR_FMT1; /* Err: wrong data size */ ndata -= np; - pd = alloc_pool(jd, np); /* Allocate a memory block for the decoded data */ + pd = (uint8_t *) alloc_pool(jd, np); /* Allocate a memory block for the decoded data */ if (!pd) return JDR_MEM1; /* Err: not enough memory */ jd->huffdata[num][cls] = pd; for (i = 0; i < np; i++) { /* Load decoded data corresponds to each code ward */ @@ -1452,7 +1452,7 @@ static void block_idct ( /*-----------------------------------------------------------------------*/ static JRESULT mcu_load ( - JDEC* jd /* Pointer to the decompressor object */ + JDEC * jd /* Pointer to the decompressor object */ ) { int32_t *tmp = (int32_t*)jd->workbuf; /* Block working buffer for de-quantize and IDCT */ @@ -1477,11 +1477,11 @@ static JRESULT mcu_load ( hc = jd->huffcode[id][0]; hd = jd->huffdata[id][0]; b = huffext(jd, hb, hc, hd); /* Extract a huffman coded data (bit length) */ - if (b < 0) return 0 - b; /* Err: invalid code or input */ + if (b < 0) return (JRESULT)(0 - b); /* Err: invalid code or input */ d = jd->dcv[cmp]; /* DC value of previous block */ if (b) { /* If there is any difference from previous block */ e = bitext(jd, b); /* Extract data bits */ - if (e < 0) return 0 - e; /* Err: input */ + if (e < 0) return (JRESULT)(0 - e); /* Err: input */ b = 1 << (b - 1); /* MSB position */ if (!(e & b)) e -= (b << 1) - 1; /* Restore sign if needed */ d += e; /* Get current value */ @@ -1499,7 +1499,7 @@ static JRESULT mcu_load ( do { b = huffext(jd, hb, hc, hd); /* Extract a huffman coded value (zero runs and bit length) */ if (b == 0) break; /* EOB? */ - if (b < 0) return 0 - b; /* Err: invalid code or input error */ + if (b < 0) return (JRESULT)(0 - b); /* Err: invalid code or input error */ z = (uint16_t)b >> 4; /* Number of leading zero elements */ if (z) { i += z; /* Skip zero elements */ @@ -1507,7 +1507,7 @@ static JRESULT mcu_load ( } if (b &= 0x0F) { /* Bit length */ d = bitext(jd, b); /* Extract data bits */ - if (d < 0) return 0 - d; /* Err: input device */ + if (d < 0) return (JRESULT)(0 - d); /* Err: input device */ b = 1 << (b - 1); /* MSB position */ if (!(d & b)) d -= (b << 1) - 1;/* Restore negative value if needed */ z = ZIG(i); /* Zigzag-order to raster-order converted index */ @@ -1775,7 +1775,7 @@ JRESULT jd_prepare ( } for (i = 0; i < 4; jd->qttbl[i++] = 0) ; - jd->inbuf = seg = alloc_pool(jd, JD_SZBUF); /* Allocate stream input buffer */ + jd->inbuf = seg = (uint8_t *) alloc_pool(jd, JD_SZBUF); /* Allocate stream input buffer */ if (!seg) return JDR_MEM1; if (jd->infunc(jd, seg, 2) != 2) return JDR_INP;/* Check SOI marker */ diff --git a/lib/graphical/src/tjpgd.hpp b/lib/graphical/src/tjpgd.hpp index 3194676..bbc0f0d 100644 --- a/lib/graphical/src/tjpgd.hpp +++ b/lib/graphical/src/tjpgd.hpp @@ -28,7 +28,7 @@ extern "C" typedef unsigned long uint32_t; typedef long int32_t; #else -#include "stdint.h" +#include #endif /* Error code */ diff --git a/lib/graphical/src/wstring.cpp b/lib/graphical/src/wstring.cpp deleted file mode 100644 index d2f56dc..0000000 --- a/lib/graphical/src/wstring.cpp +++ /dev/null @@ -1,863 +0,0 @@ -/* - wstring.cpp - String library for Wiring & Arduino - ...mostly rewritten by Paul Stoffregen... - Copyright (c) 2009-10 Hernando Barragan. All rights reserved. - Copyright 2011, Paul Stoffregen, paul@pjrc.com - Modified by Ivan Grokhotkov, 2014 - esp8266 support - Modified by Michael C. Miller, 2015 - esp8266 progmem support - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "wstring.hpp" -extern "C" { - #include "stdio.h" - #include "stdlib_noniso.h" -} - -/*********************************************/ -/* Constructors */ -/*********************************************/ - -String::String(const char *cstr) { - init(); - if (cstr) - copy(cstr, strlen(cstr)); -} - -String::String(const String &value) { - init(); - *this = value; -} - -String::String(const __FlashStringHelper *pstr) { - init(); - *this = pstr; // see operator = -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -String::String(String &&rval) { - init(); - move(rval); -} - -String::String(StringSumHelper &&rval) { - init(); - move(rval); -} -#endif - -String::String(char c) { - init(); - char buf[2]; - buf[0] = c; - buf[1] = 0; - *this = buf; -} - -String::String(unsigned char value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned char)]; - utoa(value, buf, base); - *this = buf; -} - -String::String(int value, unsigned char base) { - init(); - char buf[2 + 8 * sizeof(int)]; - if (base == 10) { - sprintf(buf, "%d", value); - } else { - itoa(value, buf, base); - } - *this = buf; -} - -String::String(unsigned int value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned int)]; - utoa(value, buf, base); - *this = buf; -} - -String::String(long value, unsigned char base) { - init(); - char buf[2 + 8 * sizeof(long)]; - if (base==10) { - sprintf(buf, "%ld", value); - } else { - ltoa(value, buf, base); - } - *this = buf; -} - -String::String(unsigned long value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned long)]; - ultoa(value, buf, base); - *this = buf; -} - -String::String(float value, unsigned char decimalPlaces) { - init(); - char buf[33]; - *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); -} - -String::String(double value, unsigned char decimalPlaces) { - init(); - char buf[33]; - *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); -} - -String::~String() { - invalidate(); -} - -// /*********************************************/ -// /* Memory Management */ -// /*********************************************/ - -inline void String::init(void) { - setSSO(false); - setCapacity(0); - setLen(0); - setBuffer(nullptr); -} - -void String::invalidate(void) { - if(!isSSO() && wbuffer()) - free(wbuffer()); - init(); -} - -unsigned char String::reserve(unsigned int size) { - if(buffer() && capacity() >= size) - return 1; - if(changeBuffer(size)) { - if(len() == 0) - wbuffer()[0] = 0; - return 1; - } - return 0; -} - -unsigned char String::changeBuffer(unsigned int maxStrLen) { - // Can we use SSO here to avoid allocation? - if (maxStrLen < sizeof(sso.buff) - 1) { - if (isSSO() || !buffer()) { - // Already using SSO, nothing to do - uint16_t oldLen = len(); - setSSO(true); - setLen(oldLen); - return 1; - } else { // if bufptr && !isSSO() - // Using bufptr, need to shrink into sso.buff - char temp[sizeof(sso.buff)]; - memcpy(temp, buffer(), maxStrLen); - free(wbuffer()); - uint16_t oldLen = len(); - setSSO(true); - setLen(oldLen); - memcpy(wbuffer(), temp, maxStrLen); - return 1; - } - } - // Fallthrough to normal allocator - size_t newSize = (maxStrLen + 16) & (~0xf); - // Make sure we can fit newsize in the buffer - if (newSize > CAPACITY_MAX) { - return false; - } - uint16_t oldLen = len(); - char *newbuffer = (char *) realloc(isSSO() ? nullptr : wbuffer(), newSize); - if (newbuffer) { - size_t oldSize = capacity() + 1; // include NULL. - if (isSSO()) { - // Copy the SSO buffer into allocated space - memmove(newbuffer, sso.buff, sizeof(sso.buff)); - } - if (newSize > oldSize) - { - memset(newbuffer + oldSize, 0, newSize - oldSize); - } - setSSO(false); - setCapacity(newSize - 1); - setLen(oldLen); // Needed in case of SSO where len() never existed - setBuffer(newbuffer); - return 1; - } - return 0; -} - -// /*********************************************/ -// /* Copy and Move */ -// /*********************************************/ - -String & String::copy(const char *cstr, unsigned int length) { - if(!reserve(length)) { - invalidate(); - return *this; - } - setLen(length); - memmove(wbuffer(), cstr, length + 1); - return *this; -} - -String & String::copy(const __FlashStringHelper *pstr, unsigned int length) { - if (!reserve(length)) { - invalidate(); - return *this; - } - setLen(length); - memcpy_P(wbuffer(), (PGM_P)pstr, length + 1); // We know wbuffer() cannot ever be in PROGMEM, so memcpy safe here - return *this; -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -void String::move(String &rhs) { - if(buffer()) { - if(capacity() >= rhs.len()) { - memmove(wbuffer(), rhs.buffer(), rhs.length() + 1); - setLen(rhs.len()); - rhs.invalidate(); - return; - } else { - if (!isSSO()) { - free(wbuffer()); - setBuffer(nullptr); - } - } - } - if (rhs.isSSO()) { - setSSO(true); - memmove(sso.buff, rhs.sso.buff, sizeof(sso.buff)); - } else { - setSSO(false); - setBuffer(rhs.wbuffer()); - } - setCapacity(rhs.capacity()); - setLen(rhs.len()); - rhs.setSSO(false); - rhs.setCapacity(0); - rhs.setLen(0); - rhs.setBuffer(nullptr); -} -#endif - -String & String::operator =(const String &rhs) { - if(this == &rhs) - return *this; - - if(rhs.buffer()) - copy(rhs.buffer(), rhs.len()); - else - invalidate(); - - return *this; -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -String & String::operator =(String &&rval) { - if(this != &rval) - move(rval); - return *this; -} - -String & String::operator =(StringSumHelper &&rval) { - if(this != &rval) - move(rval); - return *this; -} -#endif - -String & String::operator =(const char *cstr) { - if(cstr) - copy(cstr, strlen(cstr)); - else - invalidate(); - - return *this; -} - -String & String::operator = (const __FlashStringHelper *pstr) -{ - if (pstr) copy(pstr, strlen_P((PGM_P)pstr)); - else invalidate(); - - return *this; -} - -// /*********************************************/ -// /* concat */ -// /*********************************************/ - -unsigned char String::concat(const String &s) { - // Special case if we're concatting ourself (s += s;) since we may end up - // realloc'ing the buffer and moving s.buffer in the method called - if (&s == this) { - unsigned int newlen = 2 * len(); - if (!s.buffer()) - return 0; - if (s.len() == 0) - return 1; - if (!reserve(newlen)) - return 0; - memmove(wbuffer() + len(), buffer(), len()); - setLen(newlen); - wbuffer()[len()] = 0; - return 1; - } else { - return concat(s.buffer(), s.len()); - } -} - -unsigned char String::concat(const char *cstr, unsigned int length) { - unsigned int newlen = len() + length; - if(!cstr) - return 0; - if(length == 0) - return 1; - if(!reserve(newlen)) - return 0; - if (cstr >= wbuffer() && cstr < wbuffer() + len()) - // compatible with SSO in ram #6155 (case "x += x.c_str()") - memmove(wbuffer() + len(), cstr, length + 1); - else - // compatible with source in flash #6367 - memcpy_P(wbuffer() + len(), cstr, length + 1); - setLen(newlen); - return 1; -} - -unsigned char String::concat(const char *cstr) { - if(!cstr) - return 0; - return concat(cstr, strlen(cstr)); -} - -unsigned char String::concat(char c) { - char buf[2]; - buf[0] = c; - buf[1] = 0; - return concat(buf, 1); -} - -unsigned char String::concat(unsigned char num) { - char buf[1 + 3 * sizeof(unsigned char)]; - sprintf(buf, "%d", num); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(int num) { - char buf[2 + 3 * sizeof(int)]; - sprintf(buf, "%d", num); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(unsigned int num) { - char buf[1 + 3 * sizeof(unsigned int)]; - utoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(long num) { - char buf[2 + 3 * sizeof(long)]; - sprintf(buf, "%ld", num); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(unsigned long num) { - char buf[1 + 3 * sizeof(unsigned long)]; - ultoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(float num) { - char buf[20]; - char* string = dtostrf(num, 4, 2, buf); - return concat(string, strlen(string)); -} - -unsigned char String::concat(double num) { - char buf[20]; - char* string = dtostrf(num, 4, 2, buf); - return concat(string, strlen(string)); -} - -unsigned char String::concat(const __FlashStringHelper * str) { - if (!str) return 0; - int length = strlen_P((PGM_P)str); - if (length == 0) return 1; - unsigned int newlen = len() + length; - if (!reserve(newlen)) return 0; - memcpy_P(wbuffer() + len(), (PGM_P)str, length + 1); - setLen(newlen); - return 1; -} - -/*********************************************/ -/* Concatenate */ -/*********************************************/ - -StringSumHelper & operator +(const StringSumHelper &lhs, const String &rhs) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(rhs.buffer(), rhs.len())) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, const char *cstr) { - StringSumHelper &a = const_cast(lhs); - if(!cstr || !a.concat(cstr, strlen(cstr))) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, char c) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(c)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned char num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, int num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned int num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, long num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, float num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, double num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs) -{ - StringSumHelper &a = const_cast(lhs); - if (!a.concat(rhs)) - a.invalidate(); - return a; -} - -// /*********************************************/ -// /* Comparison */ -// /*********************************************/ - -int String::compareTo(const String &s) const { - if(!buffer() || !s.buffer()) { - if(s.buffer() && s.len() > 0) - return 0 - *(unsigned char *) s.buffer(); - if(buffer() && len() > 0) - return *(unsigned char *) buffer(); - return 0; - } - return strcmp(buffer(), s.buffer()); -} - -unsigned char String::equals(const String &s2) const { - return (len() == s2.len() && compareTo(s2) == 0); -} - -unsigned char String::equals(const char *cstr) const { - if(len() == 0) - return (cstr == NULL || *cstr == 0); - if(cstr == NULL) - return buffer()[0] == 0; - return strcmp(buffer(), cstr) == 0; -} - -unsigned char String::operator<(const String &rhs) const { - return compareTo(rhs) < 0; -} - -unsigned char String::operator>(const String &rhs) const { - return compareTo(rhs) > 0; -} - -unsigned char String::operator<=(const String &rhs) const { - return compareTo(rhs) <= 0; -} - -unsigned char String::operator>=(const String &rhs) const { - return compareTo(rhs) >= 0; -} - -unsigned char String::equalsIgnoreCase(const String &s2) const { - if(this == &s2) - return 1; - if(len() != s2.len()) - return 0; - if(len() == 0) - return 1; - const char *p1 = buffer(); - const char *p2 = s2.buffer(); - while(*p1) { - if(tolower(*p1++) != tolower(*p2++)) - return 0; - } - return 1; -} - -unsigned char String::equalsConstantTime(const String &s2) const { - // To avoid possible time-based attacks present function - // compares given strings in a constant time. - if(len() != s2.len()) - return 0; - //at this point lengths are the same - if(len() == 0) - return 1; - //at this point lenghts are the same and non-zero - const char *p1 = buffer(); - const char *p2 = s2.buffer(); - unsigned int equalchars = 0; - unsigned int diffchars = 0; - while(*p1) { - if(*p1 == *p2) - ++equalchars; - else - ++diffchars; - ++p1; - ++p2; - } - //the following should force a constant time eval of the condition without a compiler "logical shortcut" - unsigned char equalcond = (equalchars == len()); - unsigned char diffcond = (diffchars == 0); - return (equalcond & diffcond); //bitwise AND -} - -unsigned char String::startsWith(const String &s2) const { - if(len() < s2.len()) - return 0; - return startsWith(s2, 0); -} - -unsigned char String::startsWith(const String &s2, unsigned int offset) const { - if(offset > (unsigned)(len() - s2.len()) || !buffer() || !s2.buffer()) - return 0; - return strncmp(&buffer()[offset], s2.buffer(), s2.len()) == 0; -} - -unsigned char String::endsWith(const String &s2) const { - if(len() < s2.len() || !buffer() || !s2.buffer()) - return 0; - return strcmp(&buffer()[len() - s2.len()], s2.buffer()) == 0; -} - -// /*********************************************/ -// /* Character Access */ -// /*********************************************/ - -char String::charAt(unsigned int loc) const { - return operator[](loc); -} - -void String::setCharAt(unsigned int loc, char c) { - if(loc < len()) - wbuffer()[loc] = c; -} - -char & String::operator[](unsigned int index) { - static char dummy_writable_char; - if(index >= len() || !buffer()) { - dummy_writable_char = 0; - return dummy_writable_char; - } - return wbuffer()[index]; -} - -char String::operator[](unsigned int index) const { - if(index >= len() || !buffer()) - return 0; - return buffer()[index]; -} - -void String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index) const { - if(!bufsize || !buf) - return; - if(index >= len()) { - buf[0] = 0; - return; - } - unsigned int n = bufsize - 1; - if(n > len() - index) - n = len() - index; - strncpy((char *) buf, buffer() + index, n); - buf[n] = 0; -} - -// /*********************************************/ -// /* Search */ -// /*********************************************/ - -int String::indexOf(char c) const { - return indexOf(c, 0); -} - -int String::indexOf(char ch, unsigned int fromIndex) const { - if(fromIndex >= len()) - return -1; - const char* temp = strchr(buffer() + fromIndex, ch); - if(temp == NULL) - return -1; - return temp - buffer(); -} - -int String::indexOf(const String &s2) const { - return indexOf(s2, 0); -} - -int String::indexOf(const String &s2, unsigned int fromIndex) const { - if(fromIndex >= len()) - return -1; - const char *found = strstr(buffer() + fromIndex, s2.buffer()); - if(found == NULL) - return -1; - return found - buffer(); -} - -int String::lastIndexOf(char theChar) const { - return lastIndexOf(theChar, len() - 1); -} - -int String::lastIndexOf(char ch, unsigned int fromIndex) const { - if(fromIndex >= len()) - return -1; - char tempchar = buffer()[fromIndex + 1]; - wbuffer()[fromIndex + 1] = '\0'; - char* temp = strrchr(wbuffer(), ch); - wbuffer()[fromIndex + 1] = tempchar; - if(temp == NULL) - return -1; - return temp - buffer(); -} - -int String::lastIndexOf(const String &s2) const { - return lastIndexOf(s2, len() - s2.len()); -} - -int String::lastIndexOf(const String &s2, unsigned int fromIndex) const { - if(s2.len() == 0 || len() == 0 || s2.len() > len()) - return -1; - if(fromIndex >= len()) - fromIndex = len() - 1; - int found = -1; - for(char *p = wbuffer(); p <= wbuffer() + fromIndex; p++) { - p = strstr(p, s2.buffer()); - if(!p) - break; - if((unsigned int) (p - wbuffer()) <= fromIndex) - found = p - buffer(); - } - return found; -} - -String String::substring(unsigned int left, unsigned int right) const { - if(left > right) { - unsigned int temp = right; - right = left; - left = temp; - } - String out; - if(left >= len()) - return out; - if(right > len()) - right = len(); - char temp = buffer()[right]; // save the replaced character - wbuffer()[right] = '\0'; - out = wbuffer() + left; // pointer arithmetic - wbuffer()[right] = temp; //restore character - return out; -} - -// /*********************************************/ -// /* Modification */ -// /*********************************************/ - -void String::replace(char find, char replace) { - if(!buffer()) - return; - for(char *p = wbuffer(); *p; p++) { - if(*p == find) - *p = replace; - } -} - -void String::replace(const String& find, const String& replace) { - if(len() == 0 || find.len() == 0) - return; - int diff = replace.len() - find.len(); - char *readFrom = wbuffer(); - char *foundAt; - if(diff == 0) { - while((foundAt = strstr(readFrom, find.buffer())) != NULL) { - memmove(foundAt, replace.buffer(), replace.len()); - readFrom = foundAt + replace.len(); - } - } else if(diff < 0) { - char *writeTo = wbuffer(); - while((foundAt = strstr(readFrom, find.buffer())) != NULL) { - unsigned int n = foundAt - readFrom; - memmove(writeTo, readFrom, n); - writeTo += n; - memmove(writeTo, replace.buffer(), replace.len()); - writeTo += replace.len(); - readFrom = foundAt + find.len(); - setLen(len() + diff); - } - memmove(writeTo, readFrom, strlen(readFrom)+1); - } else { - unsigned int size = len(); // compute size needed for result - while((foundAt = strstr(readFrom, find.buffer())) != NULL) { - readFrom = foundAt + find.len(); - size += diff; - } - if(size == len()) - return; - if(size > capacity() && !changeBuffer(size)) - return; // XXX: tell user! - int index = len() - 1; - while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) { - readFrom = wbuffer() + index + find.len(); - memmove(readFrom + diff, readFrom, len() - (readFrom - buffer())); - int newLen = len() + diff; - memmove(wbuffer() + index, replace.buffer(), replace.len()); - setLen(newLen); - wbuffer()[newLen] = 0; - index--; - } - } -} - -void String::remove(unsigned int index) { - // Pass the biggest integer as the count. The remove method - // below will take care of truncating it at the end of the - // string. - remove(index, (unsigned int) -1); -} - -void String::remove(unsigned int index, unsigned int count) { - if(index >= len()) { - return; - } - if(count <= 0) { - return; - } - if(count > len() - index) { - count = len() - index; - } - char *writeTo = wbuffer() + index; - unsigned int newlen = len() - count; - setLen(newlen); - memmove(writeTo, wbuffer() + index + count, newlen - index); - wbuffer()[newlen] = 0; -} - -void String::toLowerCase(void) { - if(!buffer()) - return; - for(char *p = wbuffer(); *p; p++) { - *p = tolower(*p); - } -} - -void String::toUpperCase(void) { - if(!buffer()) - return; - for(char *p = wbuffer(); *p; p++) { - *p = toupper(*p); - } -} - -void String::trim(void) { - if(!buffer() || len() == 0) - return; - char *begin = wbuffer(); - while(isspace(*begin)) - begin++; - char *end = wbuffer() + len() - 1; - while(isspace(*end) && end >= begin) - end--; - unsigned int newlen = end + 1 - begin; - setLen(newlen); - if(begin > buffer()) - memmove(wbuffer(), begin, newlen); - wbuffer()[newlen] = 0; -} - -// /*********************************************/ -// /* Parsing / Conversion */ -// /*********************************************/ - -long String::toInt(void) const { - if (buffer()) - return atol(buffer()); - return 0; -} - -float String::toFloat(void) const { - if (buffer()) - return atof(buffer()); - return 0; -} - -double String::toDouble(void) const -{ - if (buffer()) - return atof(buffer()); - return 0.0; -} - -// global empty string to allow returning const String& with nothing - -const String emptyString; \ No newline at end of file diff --git a/lib/graphical/src/wstring.hpp b/lib/graphical/src/wstring.hpp deleted file mode 100644 index 83f724a..0000000 --- a/lib/graphical/src/wstring.hpp +++ /dev/null @@ -1,334 +0,0 @@ -/* -wstring.hpp - String library for Wiring & Arduino - ...mostly rewritten by Paul Stoffregen... - Copyright (c) 2009-10 Hernando Barragan. All right reserved. - Copyright 2011, Paul Stoffregen, paul@pjrc.com - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef String_class_h -#define String_class_h -#ifdef __cplusplus - -#include -#include -#include -#include - -// An inherited class for holding the result of a concatenation. These -// result objects are assumed to be writable by subsequent concatenations. -class StringSumHelper; - -// an abstract class used as a means to proide a unique pointer type -// but really has no body -class __FlashStringHelper; -#define FPSTR(pstr_pointer) (reinterpret_cast(pstr_pointer)) -#define F(string_literal) (FPSTR(PSTR(string_literal))) - -// The string class -class String { - // use a function pointer to allow for "if (s)" without the - // complications of an operator bool(). for more information, see: - // http://www.artima.com/cppsource/safebool.html - typedef void (String::*StringIfHelperType)() const; - void StringIfHelper() const { - } - - public: - // constructors - // creates a copy of the initial value. - // if the initial value is null or invalid, or if memory allocation - // fails, the string will be marked as invalid (i.e. "if (s)" will - // be false). - String(const char *cstr = ""); - String(const String &str); - String(const __FlashStringHelper *str); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - String(String &&rval); - String(StringSumHelper &&rval); -#endif - explicit String(char c); - explicit String(unsigned char, unsigned char base = 10); - explicit String(int, unsigned char base = 10); - explicit String(unsigned int, unsigned char base = 10); - explicit String(long, unsigned char base = 10); - explicit String(unsigned long, unsigned char base = 10); - explicit String(float, unsigned char decimalPlaces = 2); - explicit String(double, unsigned char decimalPlaces = 2); - ~String(void); - - // memory management - // return true on success, false on failure (in which case, the string - // is left unchanged). reserve(0), if successful, will validate an - // invalid string (i.e., "if (s)" will be true afterwards) - unsigned char reserve(unsigned int size); - inline unsigned int length(void) const { - if(buffer()) { - return len(); - } else { - return 0; - } - } - inline void clear(void) { - setLen(0); - } - inline bool isEmpty(void) const { - return length() == 0; - } - - // creates a copy of the assigned value. if the value is null or - // invalid, or if the memory allocation fails, the string will be - // marked as invalid ("if (s)" will be false). - String & operator =(const String &rhs); - String & operator =(const char *cstr); - String & operator = (const __FlashStringHelper *str); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - String & operator =(String &&rval); - String & operator =(StringSumHelper &&rval); -#endif - - // concatenate (works w/ built-in types) - - // returns true on success, false on failure (in which case, the string - // is left unchanged). if the argument is null or invalid, the - // concatenation is considered unsuccessful. - unsigned char concat(const String &str); - unsigned char concat(const char *cstr); - unsigned char concat(char c); - unsigned char concat(unsigned char c); - unsigned char concat(int num); - unsigned char concat(unsigned int num); - unsigned char concat(long num); - unsigned char concat(unsigned long num); - unsigned char concat(float num); - unsigned char concat(double num); - unsigned char concat(const __FlashStringHelper * str); - - // if there's not enough memory for the concatenated value, the string - // will be left unchanged (but this isn't signalled in any way) - String & operator +=(const String &rhs) { - concat(rhs); - return (*this); - } - String & operator +=(const char *cstr) { - concat(cstr); - return (*this); - } - String & operator +=(char c) { - concat(c); - return (*this); - } - String & operator +=(unsigned char num) { - concat(num); - return (*this); - } - String & operator +=(int num) { - concat(num); - return (*this); - } - String & operator +=(unsigned int num) { - concat(num); - return (*this); - } - String & operator +=(long num) { - concat(num); - return (*this); - } - String & operator +=(unsigned long num) { - concat(num); - return (*this); - } - String & operator +=(float num) { - concat(num); - return (*this); - } - String & operator +=(double num) { - concat(num); - return (*this); - } - String & operator += (const __FlashStringHelper *str){ - concat(str); - return (*this); - } - - friend StringSumHelper & operator +(const StringSumHelper &lhs, const String &rhs); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const char *cstr); - friend StringSumHelper & operator +(const StringSumHelper &lhs, char c); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned char num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, float num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, double num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const __FlashStringHelper *rhs); - - // comparison (only works w/ Strings and "strings") - operator StringIfHelperType() const { - return buffer() ? &String::StringIfHelper : 0; - } - int compareTo(const String &s) const; - unsigned char equals(const String &s) const; - unsigned char equals(const char *cstr) const; - unsigned char operator ==(const String &rhs) const { - return equals(rhs); - } - unsigned char operator ==(const char *cstr) const { - return equals(cstr); - } - unsigned char operator !=(const String &rhs) const { - return !equals(rhs); - } - unsigned char operator !=(const char *cstr) const { - return !equals(cstr); - } - unsigned char operator <(const String &rhs) const; - unsigned char operator >(const String &rhs) const; - unsigned char operator <=(const String &rhs) const; - unsigned char operator >=(const String &rhs) const; - unsigned char equalsIgnoreCase(const String &s) const; - unsigned char equalsConstantTime(const String &s) const; - unsigned char startsWith(const String &prefix) const; - unsigned char startsWith(const String &prefix, unsigned int offset) const; - unsigned char endsWith(const String &suffix) const; - - // character access - char charAt(unsigned int index) const; - void setCharAt(unsigned int index, char c); - char operator [](unsigned int index) const; - char& operator [](unsigned int index); - void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index = 0) const; - void toCharArray(char *buf, unsigned int bufsize, unsigned int index = 0) const { - getBytes((unsigned char *) buf, bufsize, index); - } - const char* c_str() const { return buffer(); } - char* begin() { return wbuffer(); } - char* end() { return wbuffer() + length(); } - const char* begin() const { return c_str(); } - const char* end() const { return c_str() + length(); } - - // search - int indexOf(char ch) const; - int indexOf(char ch, unsigned int fromIndex) const; - int indexOf(const String &str) const; - int indexOf(const String &str, unsigned int fromIndex) const; - int lastIndexOf(char ch) const; - int lastIndexOf(char ch, unsigned int fromIndex) const; - int lastIndexOf(const String &str) const; - int lastIndexOf(const String &str, unsigned int fromIndex) const; - String substring(unsigned int beginIndex) const { - return substring(beginIndex, len()); - } - ; - String substring(unsigned int beginIndex, unsigned int endIndex) const; - - // modification - void replace(char find, char replace); - void replace(const String& find, const String& replace); - void remove(unsigned int index); - void remove(unsigned int index, unsigned int count); - void toLowerCase(void); - void toUpperCase(void); - void trim(void); - - // parsing/conversion - long toInt(void) const; - float toFloat(void) const; - double toDouble(void) const; - - protected: - // Contains the string info when we're not in SSO mode - struct _ptr { - char * buff; - uint16_t cap; - uint16_t len; - }; - // This allows strings up up to 11 (10 + \0 termination) without any extra space. - enum { SSOSIZE = sizeof(struct _ptr) + 4 - 1 }; // Characters to allocate space for SSO, must be 12 or more - struct _sso { - char buff[SSOSIZE]; - unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields - unsigned char isSSO : 1; - } __attribute__((packed)); // Ensure that GCC doesn't expand the flag byte to a 32-bit word for alignment issues - enum { CAPACITY_MAX = 65535 }; // If typeof(cap) changed from uint16_t, be sure to update this enum to the max value storable in the type - union { - struct _ptr ptr; - struct _sso sso; - }; - // Accessor functions - inline bool isSSO() const { return sso.isSSO; } - inline unsigned int len() const { return isSSO() ? sso.len : ptr.len; } - inline unsigned int capacity() const { return isSSO() ? (unsigned int)SSOSIZE - 1 : ptr.cap; } // Size of max string not including terminal NUL - inline void setSSO(bool set) { sso.isSSO = set; } - inline void setLen(int len) { if (isSSO()) sso.len = len; else ptr.len = len; } - inline void setCapacity(int cap) { if (!isSSO()) ptr.cap = cap; } - inline void setBuffer(char *buff) { if (!isSSO()) ptr.buff = buff; } - // Buffer accessor functions - inline const char *buffer() const { return (const char *)(isSSO() ? sso.buff : ptr.buff); } - inline char *wbuffer() const { return isSSO() ? const_cast(sso.buff) : ptr.buff; } // Writable version of buffer - - protected: - void init(void); - void invalidate(void); - unsigned char changeBuffer(unsigned int maxStrLen); - unsigned char concat(const char *cstr, unsigned int length); - - // copy and move - String & copy(const char *cstr, unsigned int length); - String & copy(const __FlashStringHelper *pstr, unsigned int length); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - void move(String &rhs); -#endif -}; - -class StringSumHelper: public String { - public: - StringSumHelper(const String &s) : - String(s) { - } - StringSumHelper(const char *p) : - String(p) { - } - StringSumHelper(char c) : - String(c) { - } - StringSumHelper(unsigned char num) : - String(num) { - } - StringSumHelper(int num) : - String(num) { - } - StringSumHelper(unsigned int num) : - String(num) { - } - StringSumHelper(long num) : - String(num) { - } - StringSumHelper(unsigned long num) : - String(num) { - } - StringSumHelper(float num) : - String(num) { - } - StringSumHelper(double num) : - String(num) { - } -}; - -extern const String emptyString; - -#endif // __cplusplus -#endif // String_class_h \ No newline at end of file diff --git a/lib/inkplate/library.json b/lib/inkplate/library.json deleted file mode 100644 index e17007b..0000000 --- a/lib/inkplate/library.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "inkplate", - "frameworks": "espidf", - "platforms": "espressif32", - - "export": { - "include": [ - "src/*.hpp", - "src/*.h" - ] - }, - - "dependencies": [ - { "name": "inkplate_graphical" }, - { "name": "inkplate_drivers" }, - { "name": "services" }, - { "name": "tools" } - ] -} \ No newline at end of file diff --git a/lib/inkplate/src/inkplate.cpp b/lib/inkplate/src/inkplate.cpp deleted file mode 100644 index 7235a18..0000000 --- a/lib/inkplate/src/inkplate.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* -inkplate.cpp -Inkplate 6 Arduino library -David Zovko, Borna Biro, Denis Vajak, Zvonimir Haramustek @ e-radionica.com -September 24, 2020 -https://github.com/e-radionicacom/Inkplate-6-Arduino-library - -For support, please reach over forums: forum.e-radionica.com/en -For more info about the product, please check: www.inkplate.io - -This code is released under the GNU Lesser General Public License v3.0: https://www.gnu.org/licenses/lgpl-3.0.en.html -Please review the LICENSE file included with this example. -If you have any questions about licensing, please contact techsupport@e-radionica.com -Distributed as-is; no warranty is given. -*/ - -#include "inkplate.hpp" - -Inkplate::Inkplate(uint8_t _mode) : Adafruit_GFX(E_INK_WIDTH, E_INK_HEIGHT), Graphics(E_INK_WIDTH, E_INK_HEIGHT) -{ - setDisplayMode(_mode); - for (uint32_t i = 0; i < 256; ++i) - pinLUT[i] = ((i & B00000011) << 4) | (((i & B00001100) >> 2) << 18) | (((i & B00010000) >> 4) << 23) | - (((i & B11100000) >> 5) << 25); -} - - -void Inkplate::clearDisplay() -{ - // Clear 1 bit per pixel display buffer - if (getDisplayMode() == 0) - memset(_partial, 0, E_INK_WIDTH * E_INK_HEIGHT / 8); - - // Clear 3 bit per pixel display buffer - if (getDisplayMode() == 1) - memset(DMemory4Bit, 255, E_INK_WIDTH * E_INK_HEIGHT / 2); -} - -void Inkplate::display() -{ - if (getDisplayMode() == 0) - display1b(); - else if (getDisplayMode() == 1) - display3b(); -} - -void Inkplate::preloadScreen() -{ - memcpy(DMemoryNew, _partial, 60000); -} - -// Turn off epaper power supply and put all digital IO pins in high Z state -void Inkplate::einkOff() -{ - if (getPanelState() == 0) - return; - OE_CLEAR; - GMOD_CLEAR; - GPIO.out &= ~(DATA | LE | CL); - CKV_CLEAR; - SPH_CLEAR; - SPV_CLEAR; - - VCOM_CLEAR; - delay(6); - PWRUP_CLEAR; - WAKEUP_CLEAR; - - unsigned long timer = millis(); - do - { - delay(1); - } while ((readPowerGood() != 0) && (millis() - timer) < 250); - - pinsZstate(); - setPanelState(0); -} - -// Turn on supply for epaper display (TPS65186) [+15 VDC, -15VDC, +22VDC, -20VDC, +3.3VDC, VCOM] -void Inkplate::einkOn() -{ - if (getPanelState() == 1) - return; - WAKEUP_SET; - delay(1); - PWRUP_SET; - - // Enable all rails - Wire.beginTransmission(0x48); - Wire.write(0x01); - Wire.write(B00111111); - Wire.endTransmission(); - pinsAsOutputs(); - LE_CLEAR; - OE_CLEAR; - CL_CLEAR; - SPH_SET; - GMOD_SET; - SPV_SET; - CKV_CLEAR; - OE_CLEAR; - VCOM_SET; - - unsigned long timer = millis(); - do - { - delay(1); - } while ((readPowerGood() != PWR_GOOD_OK) && (millis() - timer) < 250); - if ((millis() - timer) >= 250) - { - WAKEUP_CLEAR; - VCOM_CLEAR; - PWRUP_CLEAR; - return; - } - - OE_SET; - setPanelState(1); -} - -uint8_t Inkplate::readPowerGood() -{ - Wire.beginTransmission(0x48); - Wire.write(0x0F); - Wire.endTransmission(); - - Wire.requestFrom(0x48, 1); - return Wire.read(); -} - -// LOW LEVEL FUNCTIONS - -void Inkplate::vscan_start() -{ - CKV_SET; - delayMicroseconds(7); - SPV_CLEAR; - delayMicroseconds(10); - CKV_CLEAR; - delayMicroseconds(0); - CKV_SET; - delayMicroseconds(8); - SPV_SET; - delayMicroseconds(10); - CKV_CLEAR; - delayMicroseconds(0); - CKV_SET; - delayMicroseconds(18); - CKV_CLEAR; - delayMicroseconds(0); - CKV_SET; - delayMicroseconds(18); - CKV_CLEAR; - delayMicroseconds(0); - CKV_SET; -} - -void Inkplate::hscan_start(uint32_t _d) -{ - SPH_CLEAR; - GPIO.out_w1ts = (_d) | CL; - GPIO.out_w1tc = DATA | CL; - SPH_SET; - CKV_SET; -} - -void Inkplate::vscan_end() -{ - CKV_CLEAR; - LE_SET; - LE_CLEAR; - delayMicroseconds(0); -} - -void Inkplate::pinsZstate() -{ - pinMode(0, INPUT); - pinMode(2, INPUT); - pinMode(32, INPUT); - pinMode(33, INPUT); - pinModeMCP(OE, INPUT); - pinModeMCP(GMOD, INPUT); - pinModeMCP(SPV, INPUT); - - pinMode(4, INPUT); - pinMode(5, INPUT); - pinMode(18, INPUT); - pinMode(19, INPUT); - pinMode(23, INPUT); - pinMode(25, INPUT); - pinMode(26, INPUT); - pinMode(27, INPUT); -} - -void Inkplate::pinsAsOutputs() -{ - pinMode(0, OUTPUT); - pinMode(2, OUTPUT); - pinMode(32, OUTPUT); - pinMode(33, OUTPUT); - pinModeMCP(OE, OUTPUT); - pinModeMCP(GMOD, OUTPUT); - pinModeMCP(SPV, OUTPUT); - - pinMode(4, OUTPUT); - pinMode(5, OUTPUT); - pinMode(18, OUTPUT); - pinMode(19, OUTPUT); - pinMode(23, OUTPUT); - pinMode(25, OUTPUT); - pinMode(26, OUTPUT); - pinMode(27, OUTPUT); -} diff --git a/lib/services/src/network_client.cpp b/lib/services/src/network_client.cpp index 88ff25c..269ecc7 100644 --- a/lib/services/src/network_client.cpp +++ b/lib/services/src/network_client.cpp @@ -14,11 +14,13 @@ If you have any questions about licensing, please contact techsupport@e-radionic Distributed as-is; no warranty is given. */ -#include "NetworkClient.h" +#define __NETWORK_CLIENT__ 1 +#include "network_client.hpp" bool NetworkClient::joinAP(const char * ssid, const char * pass) { + return true; } void @@ -29,6 +31,7 @@ NetworkClient::disconnect() bool NetworkClient::isConnected() { + return true; } diff --git a/lib/services/src/network_client.hpp b/lib/services/src/network_client.hpp index 3533f76..c56927c 100644 --- a/lib/services/src/network_client.hpp +++ b/lib/services/src/network_client.hpp @@ -19,18 +19,6 @@ Distributed as-is; no warranty is given. #include -struct bitmapHeader -{ - uint16_t signature; - uint32_t fileSize; - uint32_t startRAW; - uint32_t dibHeaderSize; - uint32_t width; - uint32_t height; - uint16_t color; - uint32_t compression; -}; - class NetworkClient { public: @@ -38,11 +26,17 @@ class NetworkClient void disconnect(); bool isConnected(); - uint8_t *downloadFile(const char *url, int32_t *defaultLen); + uint8_t * downloadFile(const char * url, int32_t * defaultLen); //uint8_t *downloadFile(WiFiClient *url, int32_t len); private: static constexpr char const * TAG = "NetworkClient"; }; +#if __NETWORK_CLIENT__ + NetworkClient network_client; +#else + extern NetworkClient network_client; +#endif + #endif \ No newline at end of file diff --git a/lib/services/src/wire.cpp b/lib/services/src/wire.cpp index a22f1cc..02e91ee 100644 --- a/lib/services/src/wire.cpp +++ b/lib/services/src/wire.cpp @@ -12,6 +12,8 @@ #include Wire Wire::singleton; +SemaphoreHandle_t Wire::mutex = nullptr; +StaticSemaphore_t Wire::mutex_buffer; void Wire::setup() @@ -19,6 +21,9 @@ Wire::setup() ESP_LOGD(TAG, "Initializing..."); if (!initialized) { + + mutex = xSemaphoreCreateMutexStatic(&mutex_buffer); + i2c_config_t config; memset(&config, 0, sizeof(i2c_config_t)); diff --git a/lib/services/src/wire.hpp b/lib/services/src/wire.hpp index f7f712f..2a72d1d 100644 --- a/lib/services/src/wire.hpp +++ b/lib/services/src/wire.hpp @@ -5,10 +5,9 @@ #ifndef __WIRE_HPP__ #define __WIRE_HPP__ -#include +#include #include "non_copyable.hpp" - #include "driver/i2c.h" class Wire : NonCopyable @@ -16,6 +15,8 @@ class Wire : NonCopyable private: static constexpr char const * TAG = "Wire"; + static SemaphoreHandle_t mutex; + static StaticSemaphore_t mutex_buffer; static const uint8_t BUFFER_LENGTH = 30; bool initialized; @@ -27,7 +28,7 @@ class Wire : NonCopyable uint8_t index; Wire() : - initialized(false), + initialized(false), size_to_read(0), index(0) {} @@ -43,6 +44,9 @@ class Wire : NonCopyable void write(uint8_t val); uint8_t read(); esp_err_t request_from(uint8_t addr, uint8_t size); + + inline static void enter() { xSemaphoreTake(mutex, portMAX_DELAY); } + inline static void leave() { xSemaphoreGive(mutex); } }; #if __WIRE__ diff --git a/lib/tools/src/miniz.cpp b/lib/tools/src/miniz.cpp index 6c28424..35f0796 100644 --- a/lib/tools/src/miniz.cpp +++ b/lib/tools/src/miniz.cpp @@ -1509,12 +1509,16 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex { mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i; r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32); - for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8; + for ( i = 0; i <= 143; ++i) *p++ = 8; + for ( ; i <= 255; ++i) *p++ = 9; + for ( ; i <= 279; ++i) *p++ = 7; + for ( ; i <= 287; ++i) *p++ = 8; } else { for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; } - MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } + MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); + for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } r->m_table_sizes[2] = 19; } for ( ; (int)r->m_type >= 0; r->m_type--) diff --git a/src/logo.hpp b/src/logo.hpp new file mode 100644 index 0000000..208fd50 --- /dev/null +++ b/src/logo.hpp @@ -0,0 +1,381 @@ +// Array that holds data for bitmap image of 576x100 pixels. You can convert your own image using LCD image Converter. +const uint8_t logo[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xf8, 0x00, + 0x00, 0x0f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfc, + 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x07, 0xff, 0xff, + 0xff, 0xfc, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc3, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, + 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0xc3, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0xc3, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1f, 0xf0, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc3, 0xf0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xe0, 0x01, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc3, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xe0, 0x03, 0xff, 0xfc, 0x00, 0x7d, + 0xff, 0xff, 0x80, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x07, 0xfe, 0x30, 0x00, 0x30, 0xff, 0xff, 0x80, 0x01, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x0f, 0xfc, 0x30, 0x00, 0x30, 0xff, 0xff, 0x80, 0x01, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0xc0, 0x1f, 0xf0, 0x38, 0x70, 0x20, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x1f, 0xe0, + 0x3f, 0xf8, 0x78, 0xfc, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1f, 0xff, 0x80, 0x01, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xc1, 0xc0, 0x00, 0xff, 0xfe, 0x00, 0x0f, 0xff, + 0xfe, 0x00, 0x00, 0xe0, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80, 0x3f, 0xc0, 0x3f, 0xf8, 0xf8, 0xfc, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x1f, + 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xc3, 0xe0, 0x0f, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0xf0, + 0x07, 0xff, 0xff, 0xf0, 0x00, 0x7f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x07, 0xff, 0xff, 0xe0, + 0x0f, 0xff, 0xff, 0x07, 0xff, 0xfc, 0x00, 0xff, 0x80, 0x3f, 0x80, 0x3f, 0xf8, 0xf8, 0xfc, 0x00, 0x00, 0x00, 0xff, + 0x80, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0xe0, 0x03, + 0xff, 0xff, 0xff, 0xc3, 0xf0, 0x1f, 0xff, 0xff, 0xf0, 0x1f, 0xff, 0xff, 0xfc, 0x01, 0xf0, 0x0f, 0xff, 0xff, 0xf8, + 0x00, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0x8f, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x7f, 0x00, 0x00, 0xf0, 0x78, 0xfc, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x3f, + 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xc3, + 0xf0, 0x3f, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xfe, 0x01, 0xf0, 0x3f, 0xff, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xff, + 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xc0, 0x1f, 0xff, 0xff, 0xfc, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xff, + 0x00, 0xff, 0x00, 0x00, 0x00, 0x30, 0xfc, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfe, 0x00, + 0x00, 0x00, 0x3f, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xff, 0xc3, 0xf0, 0x7f, 0xff, 0xff, + 0xfc, 0x1f, 0xff, 0xff, 0xff, 0x01, 0xf0, 0x3f, 0xff, 0xff, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xff, + 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0xfc, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xff, 0x00, 0xfe, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x7f, 0x80, 0x01, 0xff, 0x00, 0x00, 0x00, 0x7f, 0xe0, + 0x00, 0x01, 0xfe, 0x00, 0x07, 0xf8, 0x1f, 0xe0, 0x00, 0x0f, 0xc3, 0xf0, 0xff, 0x00, 0x03, 0xfc, 0x1f, 0x80, 0x01, + 0xff, 0x81, 0xf0, 0x7f, 0x80, 0x01, 0xff, 0x07, 0xf8, 0x00, 0x1f, 0xf0, 0x00, 0x03, 0xf0, 0x00, 0x0f, 0xe0, 0x3f, + 0x00, 0x00, 0xfe, 0x0f, 0xc0, 0x07, 0xff, 0x00, 0x1f, 0xf0, 0xff, 0x80, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, + 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x01, 0xfc, 0x00, + 0x01, 0xfc, 0x1f, 0xc0, 0x00, 0x07, 0xc3, 0xf0, 0xfe, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x7f, 0xc1, 0xf0, 0x7f, + 0x00, 0x00, 0x7f, 0x07, 0xf0, 0x00, 0x07, 0xf0, 0x00, 0x07, 0xe0, 0x00, 0x07, 0xf0, 0x7e, 0x00, 0x00, 0x7f, 0x0f, + 0x80, 0x03, 0xff, 0x00, 0x07, 0xf0, 0xff, 0xfc, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x7f, 0xc0, + 0x00, 0x00, 0xfc, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0xfc, 0x3f, 0x00, + 0x00, 0x07, 0xc3, 0xf0, 0xfc, 0x00, 0x00, 0x7e, 0x1f, 0x00, 0x00, 0x1f, 0xc1, 0xf0, 0xfe, 0x00, 0x00, 0x3f, 0x0f, + 0xe0, 0x00, 0x03, 0xf0, 0x00, 0x07, 0xc0, 0x00, 0x03, 0xf0, 0x7c, 0x00, 0x00, 0x3f, 0x0f, 0x80, 0x00, 0xff, 0x00, + 0x03, 0xf0, 0xff, 0xff, 0xfd, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0xfc, 0x00, + 0x00, 0x3f, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, + 0xf8, 0x00, 0x00, 0x3e, 0x1f, 0x00, 0x00, 0x0f, 0xc1, 0xf0, 0xfc, 0x00, 0x00, 0x1f, 0x0f, 0xc0, 0x00, 0x01, 0xf0, + 0x00, 0x0f, 0xc0, 0x00, 0x01, 0xf0, 0xfc, 0x00, 0x00, 0x1f, 0x0f, 0x80, 0x00, 0x7f, 0x00, 0x01, 0xf8, 0xff, 0xff, + 0xff, 0xff, 0x01, 0xc0, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, + 0x01, 0xf8, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x7c, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, + 0x1f, 0x00, 0x00, 0x07, 0xe1, 0xf0, 0xfc, 0x00, 0x00, 0x1f, 0x0f, 0xc0, 0x00, 0x01, 0xf0, 0x00, 0x0f, 0x80, 0x00, + 0x01, 0xf0, 0xf8, 0x00, 0x00, 0x1f, 0x0f, 0x80, 0x00, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x83, 0xe0, + 0x00, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, + 0x03, 0xe0, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, + 0xe1, 0xf0, 0xfc, 0x00, 0x00, 0x0f, 0x0f, 0xc0, 0x00, 0x03, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xf0, 0xf8, 0x00, + 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0xff, 0xfc, 0x00, + 0x00, 0x3f, 0xc0, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, + 0xfc, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xe1, 0xf0, 0xfc, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, + 0x00, 0x3f, 0x00, 0x00, 0x7e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xc0, 0x00, + 0x00, 0xf8, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfc, 0x3f, 0x00, 0x00, + 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0xff, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x3f, 0x00, 0x00, + 0x7e, 0x3f, 0xfd, 0xfd, 0xfe, 0x03, 0xc0, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0xf8, 0x00, 0x0f, + 0xff, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xfc, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, + 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x00, + 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x3f, 0xfc, 0xfc, + 0xfc, 0x00, 0x80, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0xf8, 0x00, 0x7f, 0xfe, 0x00, 0x00, 0x03, + 0xf0, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xfc, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, + 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, + 0x00, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0xf8, 0x1f, 0xff, 0xfc, 0x07, 0xff, 0xc3, 0xf0, 0x00, 0x00, 0x00, + 0x3f, 0xff, 0xff, 0xfc, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, + 0xf0, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, + 0x0f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x7f, 0xc0, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xfc, 0x0f, 0xff, 0xc3, 0xf0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x7c, + 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, + 0x00, 0x01, 0xff, 0xff, 0xf1, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, + 0x1f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0xff, 0x00, 0x70, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xc0, 0x0f, 0xff, 0xc3, 0xf0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x7c, 0x3f, 0x00, 0x00, 0x07, + 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff, 0xfc, + 0x00, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, + 0x00, 0x00, 0x7f, 0x00, 0xf8, 0x02, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x00, + 0x0f, 0xff, 0xc3, 0xf0, 0x00, 0x00, 0x01, 0xff, 0xf8, 0x00, 0x7c, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, + 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0xf0, 0x00, 0x0f, + 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x80, + 0xf8, 0x0f, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xc3, 0xf0, + 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x7c, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, + 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x00, 0x07, 0xfc, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0xc0, 0xf8, 0x0f, 0x80, 0xfc, + 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x03, 0xf8, + 0x00, 0x00, 0x7c, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, + 0xfc, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x0f, + 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x1f, 0xe0, 0xf0, 0x0f, 0x80, 0xfc, 0x00, 0x00, 0x00, 0xff, + 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x0f, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x7c, 0x3f, + 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x0f, + 0x0f, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe0, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x1f, + 0x00, 0x00, 0x3f, 0x00, 0x00, 0x1f, 0xf0, 0x60, 0x0f, 0x80, 0xfc, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xfc, + 0x00, 0x00, 0x1f, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x7c, 0x3f, 0x00, 0x00, 0x07, 0xc3, + 0xf1, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x0f, 0x0f, 0xc0, 0x00, 0x01, + 0xf0, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xf0, 0xf8, 0x00, 0x00, 0x0f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x00, + 0x00, 0x0f, 0xfc, 0x20, 0x06, 0x00, 0xff, 0xff, 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x3f, 0x00, + 0x00, 0x03, 0xf0, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x7c, 0x3f, 0x00, 0x00, 0x07, 0xc3, 0xf1, 0xf0, 0x00, 0x00, + 0x3f, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x1f, 0x0f, 0xc0, 0x00, 0x01, 0xf0, 0x00, 0x0f, 0x80, + 0x00, 0x01, 0xf0, 0xf8, 0x00, 0x00, 0x1f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x07, 0xfe, 0x70, + 0x0e, 0x00, 0xff, 0xff, 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x03, 0xf0, 0x00, + 0x00, 0x03, 0xf0, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x0f, 0xc3, 0xf0, 0xf8, 0x00, 0x00, 0x3e, 0x1f, 0x00, 0x00, + 0x03, 0xf1, 0xf0, 0xfc, 0x00, 0x00, 0x1f, 0x0f, 0xc0, 0x00, 0x01, 0xf0, 0x00, 0x0f, 0xc0, 0x00, 0x01, 0xf0, 0xfc, + 0x00, 0x00, 0x1f, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x07, 0x80, 0x03, 0xff, 0xf8, 0x3e, 0x01, 0xff, 0xff, + 0x80, 0x01, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x03, 0xf8, 0x00, + 0x00, 0xfc, 0x3f, 0x80, 0x00, 0x0f, 0xc3, 0xf0, 0xfc, 0x00, 0x00, 0x7e, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0x7e, + 0x00, 0x00, 0x3f, 0x0f, 0xe0, 0x00, 0x03, 0xf0, 0x00, 0x07, 0xc0, 0x00, 0x03, 0xf0, 0x7c, 0x00, 0x00, 0x3f, 0x0f, + 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x0f, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x03, 0xff, 0x00, + 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x01, 0xfc, 0x1f, 0xc0, + 0x00, 0x1f, 0xc3, 0xf0, 0xfe, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0x7f, 0x00, 0x00, 0x7f, 0x07, + 0xf0, 0x00, 0x07, 0xf0, 0x0e, 0x07, 0xe0, 0x00, 0x07, 0xe0, 0x7e, 0x00, 0x00, 0x7e, 0x0f, 0x80, 0x00, 0x1f, 0x00, + 0x00, 0x3f, 0x0f, 0xe0, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, + 0xff, 0xfe, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0x83, 0xf0, + 0xff, 0xff, 0xff, 0xfc, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0x3f, 0xff, 0xff, 0xfe, 0x07, 0xff, 0xff, 0xff, 0xe0, + 0x1f, 0x03, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xfe, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x1f, 0xf0, + 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, + 0x03, 0xf0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0x83, 0xf0, 0x7f, 0xff, 0xff, 0xfc, + 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0x3f, 0xff, 0xff, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0x03, 0xff, 0xff, + 0xff, 0xc0, 0x3f, 0xff, 0xff, 0xfc, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x1f, 0xf0, 0x00, 0x1f, 0xff, 0xff, + 0xff, 0xfc, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xff, 0x03, 0xf0, 0x3f, 0xff, 0xff, 0xf8, 0x1f, 0x00, 0x00, 0x03, + 0xf1, 0xf0, 0x1f, 0xff, 0xff, 0xfc, 0x01, 0xff, 0xff, 0xff, 0xc0, 0x3f, 0x01, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xff, + 0xff, 0xf8, 0x0f, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x0f, 0xf0, 0x00, 0x07, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, + 0x07, 0xfc, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, + 0xe0, 0x03, 0xff, 0xff, 0xfe, 0x03, 0xf0, 0x1f, 0xff, 0xff, 0xf0, 0x1f, 0x00, 0x00, 0x03, 0xf1, 0xf0, 0x0f, 0xff, + 0xff, 0xf8, 0x00, 0xff, 0xff, 0xff, 0x80, 0x3f, 0x00, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x0f, 0x80, + 0x00, 0x1f, 0x00, 0x00, 0x3f, 0x0f, 0xf8, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, + 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xf0, 0x03, 0xe0, 0x07, 0xff, 0xff, 0xc0, 0x0f, 0x00, 0x00, 0x03, 0xe0, 0xf0, 0x03, 0xff, 0xff, 0xe0, 0x00, 0x3f, + 0xff, 0xfe, 0x00, 0x0e, 0x00, 0x1f, 0xff, 0xf8, 0x00, 0x01, 0xff, 0xff, 0x80, 0x07, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0x3c, 0x0f, 0xfc, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x01, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xc0, 0x00, 0xc0, 0x00, + 0xff, 0xfe, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc0, 0x60, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xe0, 0x00, 0x00, 0x03, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/main.cpp b/src/main.cpp index fd00c6e..e6b5cac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,41 +3,79 @@ #include "logging.hpp" #include +#include #include "inkplate.hpp" +#include "logo.hpp" + +Inkplate display(DisplayMode::INKPLATE_1BIT); static const char * TAG = "Main"; +// Small function that will write on the screen what function is currently in demonstration. +void displayCurrentAction(std::string text) +{ + display.setTextSize(2); + display.setCursor(2, 580); + display.print(text); +} + +void wait_a_bit() { vTaskDelay(5000 / portTICK_PERIOD_MS); } + void mainTask(void * params) { + // Show a downcount of 10 seconds at the usb port for (int i = 10; i > 0; i--) { std::cout << "\r" << i << "..." << std::flush; vTaskDelay(1000 / portTICK_PERIOD_MS); } std::cout << std::endl << std::flush; - if (e_ink.setup()) { - ESP_LOGI(TAG, "EInk initialized!"); + ESP_LOGI(TAG, "Initialization."); - static Graphics graphics; + display.begin(); + display.clearDisplay(); + display.display(); + display.setCursor(150, 320); + display.setTextSize(4); - e_ink.clean(); + #if defined(INKPLATE_6) + display.print("Welcome to Inkplate 6!"); + #else + display.print("Welcome to Inkplate 10!"); + #endif - ESP_LOGI(TAG, "Set Display Mode..."); - graphics.selectDisplayMode(3); - ESP_LOGI(TAG, "writeLine..."); - graphics.writeLine(10, 10, 200, 200, 0); - graphics.writeFillRect(400, 400, 150, 150, 0); - ESP_LOGI(TAG, "Show..."); - graphics.show(); - } - - while (1) { - std::cout << "Job completed..." << std::endl << std::flush; - vTaskDelay(10000 / portTICK_PERIOD_MS); - } + display.display(); // Write hello message + wait_a_bit(); + + for (;;) { + // Example will demostrate funcionality one by one. You always first set everything in the frame buffer and + // afterwards you show it on the screen using display.display(). + + // Let's start by drawing a pixel at x = 100 and y = 50 location + display.clearDisplay(); // Clear everytning that is inside frame buffer in ESP32 + displayCurrentAction( + "Drawing a pixel"); // Function which writes small text at bottom left indicating what's currently done + // NOTE: you do not need displayCurrentAction function to use Inkplate! + display.drawPixel(100, 50, BLACK); // Draw one black pixel at X = 100, Y = 50 position in BLACK color (must be black + // since Inkplate is in BW mode) + display.display(); // Send image to display. You need to call this one each time you want to transfer frame buffer + // to the screen. + wait_a_bit(); + + // Display some bitmap on screen. We are going to display e-radionica logo on display at location X = 200, Y = 200 + // Image is 576x100 pixels and we want to every pixel of this bitmap to be black. + display.clearDisplay(); + display.drawImage(logo, 100, 250, 576, 100, + BLACK); // Arguments are: array variable name, start X, start Y, size X, size Y, color + displayCurrentAction("Drawing e-radionica.com logo"); + display.display(); + wait_a_bit(); + + } // Loop forever } + #define STACK_SIZE 10000 extern "C" {